support RELEASE_ASSERT and DEBUG_ASSERT for release and debug mode
Bug #1393821 reported by
RJ Skerry-Ryan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Low
|
RJ Skerry-Ryan |
Bug Description
From the discussion in https:/
Add a RELEASE_ASSERT macro:
* fatal (quits immediately) always
* prints a message to the log about the failure
Add a DEBUG_ASSERT macro:
* compiled away in release builds
* in debug builds, print a failure warning
* if DEBUG_ASSERT_FATAL defined, quit immediately
Add a scons flag, debug_asserts_
* Define DEBUG_ASSERT_FATAL
Changed in mixxx: | |
status: | New → Confirmed |
assignee: | nobody → RJ Ryan (rryan) |
importance: | Undecided → Low |
milestone: | none → 1.12.0 |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I wasn't following the discussion in the PR so I'll chime in here:
- We never want to quit immediately in a release build! We want to recover as much as possible.
- Doesn't ErrorHandler already address the RELEASE_ASSERT case, in that you can call it with a critical error and it will log it and attempt a graceful shutdown? (It just needs to be macro-ized.)
- Qt docs say that Q_ASSERTs are intended for development and are meant to be disabled in release builds. We should really add error-handling code after all asserts as if they aren't there so we can recover from problems as gracefully as possible for each one.