Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line option --debugAssertBreak #1189

Merged
merged 4 commits into from
Feb 22, 2017

Conversation

daschuer
Copy link
Member

If you currently build with MIXXX_DEBUG_ASSERTIONS_FATAL, you cannot continue Mixxx after this.
But it should be not a problem because in a release build it will continue anyway.

The new command line option --debugAssertBreak can be used when Mixxx is started under a debugger. In case of a false debug assert, it just breaks. Without a debugger this is fatal.

Before, this PR I have tried to get this behavior by placing a breakpoint at qWarning inn assert.c but this slows down the debug process a lot, and it leads to false positives because of inlining and optimization.

This new option will also avoid to switch the MIXXX_DEBUG_ASSERTIONS_FATAL flag which leads to a time consuming full rebuild. Now the MIXXX_DEBUG_ASSERTIONS_FATAL is only respected if --debugAssertBreak is not passed.

@daschuer
Copy link
Member Author

strange win 32 bit test fails:

[ RUN      ] EngineBufferE2ETest.CueStartPlayTest
Loading resources from  "C:/projects/mixxx/dist32/" 
Compressor attack per frame:  0.000408163 decay per frame:  4.08163e-05 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterLow" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterMid" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterHigh" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterLowKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterMidKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel1]" , "filterHighKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterLow" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterMid" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterHigh" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterLowKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterMidKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel2]" , "filterHighKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterLow" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterMid" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterHigh" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterLowKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterMidKill" ) 
ControlDoublePrivate::getControl returning NULL for ( "[Channel3]" , "filterHighKill" ) 
Command exited with code 3
echo "*** FAILURE ***"
"*** FAILURE ***"
echo "*** DONE ***"
"*** DONE ***"

@daschuer
Copy link
Member Author

Clang mac builds fails with:

clang++ -o osx64_build/plugins/osx64_build/m4a/libsoundsourcem4a.dylib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.8 -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -arch x86_64 -framework QtCore -framework QtGui -framework QtOpenGL -framework QtXml -framework QtSvg -framework QtSql -framework QtScript -framework QtNetwork -framework QtTest -framework QtScriptTools -framework QtWidgets -framework QtConcurrent -F/usr/local/Cellar/qt5/5.8.0_1/Frameworks -Wl,-rpath,/usr/local/Cellar/qt5/5.8.0_1/Frameworks -L/usr/local/Cellar/qt5/5.8.0_1/Frameworks -framework Security -framework CoreServices -framework IOKit -Wl,-headerpad,ffff -Wl,-headerpad_max_install_names -dynamiclib osx64_build/plugins/osx64_build/m4a/soundsourcem4a.os osx64_build/plugins/osx64_build/m4a/sources/audiosource.os osx64_build/plugins/osx64_build/m4a/sources/soundsource.os osx64_build/plugins/osx64_build/m4a/sources/soundsourceplugin.os osx64_build/plugins/osx64_build/m4a/track/bpm.os osx64_build/plugins/osx64_build/m4a/track/replaygain.os osx64_build/plugins/osx64_build/m4a/track/trackmetadata.os osx64_build/plugins/osx64_build/m4a/track/trackmetadatataglib.os osx64_build/plugins/osx64_build/m4a/track/tracknumbers.os osx64_build/plugins/osx64_build/m4a/util/audiosignal.os osx64_build/plugins/osx64_build/m4a/util/sample.os osx64_build/plugins/osx64_build/m4a/util/samplebuffer.os osx64_build/plugins/osx64_build/m4a/util/singularsamplebuffer.os -L/usr/local/lib -L/usr/local/Cellar/ffmpeg/3.2.4/lib -lportaudio -lportmidi -lsndfile -lFLAC -lvorbisfile -lvorbis -logg -lvorbisenc -ltag -lprotobuf-lite -lchromaprint -lrubberband -lmad -lid3tag -lshout -lopusfile -lwavpack -lmodplug -lavcodec -lavformat -lavutil -lmp4v2 -lfaad -framework OpenGL -framework AudioToolbox -framework CoreFoundation -framework IOKit

Undefined symbols for architecture x86_64:

  "CmdlineArgs::CmdlineArgs()", referenced from:

      CmdlineArgs::Instance() in soundsourcem4a.os

      CmdlineArgs::Instance() in audiosource.os

      CmdlineArgs::Instance() in soundsource.os

      CmdlineArgs::Instance() in bpm.os

      CmdlineArgs::Instance() in replaygain.os

      CmdlineArgs::Instance() in trackmetadatataglib.os

      CmdlineArgs::Instance() in sample.os

      ...

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

scons: *** [osx64_build/plugins/osx64_build/m4a/libsoundsourcem4a.dylib] Error 1

scons: building terminated because of errors.

@daschuer
Copy link
Member Author

The clang issue is somehow a relationship issue. The plug-ins depends on header only assert.h.
Now it depends on the CmdlineArgs object which is a kind of bad. Any ideas to fix this?

@daschuer
Copy link
Member Author

I think I have got a good solution. The different behavior is now moved to the logging class.
The plugins are directly not depending on any debug assert setting.

#else
qWarning("DEBUG ASSERT: \"%s\" in function %s at %s:%d", assertion, function, file, line);
#endif
qCritical("DEBUG ASSERT: \"%s\" in function %s at %s:%d", assertion, function, file, line);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Logging::kAssertPrefix?

@rryan
Copy link
Member

rryan commented Feb 21, 2017

Nice -- LGTM other than my one comment.

@daschuer
Copy link
Member Author

Thank you for review!

@daschuer daschuer merged commit cf2fdf6 into mixxxdj:master Feb 22, 2017
@esbrandt esbrandt mentioned this pull request Jun 24, 2017
37 tasks
@daschuer daschuer deleted the debugAssertBreak branch September 26, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants