ankitks Posted February 28, 2017 Report Share Posted February 28, 2017 seeing this crazy behavior that when I add a 'double m_temp' variable to my class, I end up getting very different behavior where my sc_assert fires. This only happens when I set my optimization flag -O3 with g++. If I remove -O3 and add -g (for debug) to my g++ flag, I go back to my original behavior and everything passes. This doesn't look random, as I can reproduce it. I ran it with valgrind and I don't see any memory leak. ==23030== LEAK SUMMARY: ==23030== definitely lost: 0 bytes in 0 blocks ==23030== indirectly lost: 0 bytes in 0 blocks ==23030== possibly lost: 177,955 bytes in 592 blocks ==23030== still reachable: 3,585,485 bytes in 2,563 blocks ==23030== suppressed: 0 bytes in 0 blocks ==23030== ==23030== For counts of detected and suppressed errors, rerun with: -v ==23030== Use --track-origins=yes to see where uninitialised values come from ==23030== ERROR SUMMARY: 25300 errors from 286 contexts (suppressed: 6 from 6) Not sure what's going on. Any suggestions. Can't seem to run gdb/ddd since adding -g to g++ doesn't reproduce the behavior. Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted February 28, 2017 Report Share Posted February 28, 2017 Hi, Can you share the build command (i.e. g++ <options> <input file> -o <output file>) in Release build? If you are using CMake you can generate build commands by running. make VERBOSE=1 in case you are using the autotools you can give this command to show the build commands. make V=1 For other tools you will have to look into documentation for getting the g++ build commands. Kindly post the results here to analyze further. Also if possible kindly share minimal code which reproduces this behavior. Regards, Ameya Vikram Singh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.