{"action":"created","issue":{"url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/56","repository_url":"https://api.github.com/repos/unittest-cpp/unittest-cpp","labels_url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/56/comments","events_url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/56/events","html_url":"https://github.com/unittest-cpp/unittest-cpp/issues/56","id":44916590,"number":56,"title":"Crash in TestUnitTest++.exe","user":{"login":"wintertime","id":6032572,"avatar_url":"https://avatars.githubusercontent.com/u/6032572?v=3","gravatar_id":"","url":"https://api.github.com/users/wintertime","html_url":"https://github.com/wintertime","followers_url":"https://api.github.com/users/wintertime/followers","following_url":"https://api.github.com/users/wintertime/following{/other_user}","gists_url":"https://api.github.com/users/wintertime/gists{/gist_id}","starred_url":"https://api.github.com/users/wintertime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wintertime/subscriptions","organizations_url":"https://api.github.com/users/wintertime/orgs","repos_url":"https://api.github.com/users/wintertime/repos","events_url":"https://api.github.com/users/wintertime/events{/privacy}","received_events_url":"https://api.github.com/users/wintertime/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-10-05T15:00:25Z","updated_at":"2016-05-07T03:58:00Z","closed_at":"2016-05-07T03:58:00Z","body":"I wanted to try the latest git version and used the cmake-gui program from cmake 3.0.2 to produce a mingw makefile for TDM-gcc-32 4.8.1 .\r\nWhen I first tried \"mingw32-make\" and \"mingw32-make check\" did work flawlessly.\r\nThen I noticed I had forgotten to set CMAKE_BUILD_TYPE inside the cmake gui. So I deleted everything and set it to Release (which sets -O3 -DNDEBUG when compiling), but this time make check crashed with a seg fault.\r\nI repeated that with RelWithDebInfo setting (this sets -O2 -g -DNDEBUG), and got a crash again.\r\nI then started the TestUnitTest++.exe with gdb and got a stacktrace:\r\n\r\n```\r\n(gdb) run\r\nStarting program: C:\\prg\\lib\\unittest-cpp\\builds/TestUnitTest++.exe\r\n[New Thread 3812.0xa58]\r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0x77c160ad in strcat () from C:\\WINDOWS\\system32\\msvcrt.dll\r\n(gdb) bt\r\n#0  0x77c160ad in strcat () from C:\\WINDOWS\\system32\\msvcrt.dll\r\n#1  0x0022f340 in ?? ()\r\n#2  0x0046b8bd in (anonymous namespace)::TestTimeConstraintMacroComparesAgainstP\r\nreciseActual::RunImpl (this=<optimized out>)\r\n    at ..\\tests\\TestTimeConstraintMacro.cpp:45\r\n#3  0x004a1606 in UnitTest::ExecuteTest<UnitTest::Test> (testObject=...,\r\n    details=..., isMockTest=<optimized out>) at ../UnitTest++/ExecuteTest.h:33\r\n#4  0x004766aa in UnitTest::Test::Run (\r\n    this=this@entry=0x529540 <(anonymous namespace)::testTimeConstraintMacroComp\r\naresAgainstPreciseActualInstance>) at ..\\UnitTest++\\Test.cpp:34\r\n#5  0x00475f73 in UnitTest::TestRunner::RunTest (this=this@entry=0x22ff34,\r\n    result=<optimized out>, curTest=<optimized out>,\r\n    maxTestTimeInMs=<optimized out>) at ..\\UnitTest++\\TestRunner.cpp:67\r\n#6  0x0047646c in RunTestsIf<UnitTest::True> (suiteName=0x0,\r\n    maxTestTimeInMs=0, predicate=..., list=..., this=0x22ff34)\r\n    at ../UnitTest++/TestRunner.h:39\r\n#7  UnitTest::RunAllTests () at ..\\UnitTest++\\TestRunner.cpp:17\r\n#8  0x004f6ca0 in main () at ..\\tests\\Main.cpp:5\r\n```\r\n\r\nSo the crash happened somewhere inside the UNITTEST_TIME_CONSTRAINT macro, but when I tried to look at the source files where that call leads to, I saw no probable cause, and the next stack frame shows only ??. Could it be some miscompilation when doing an optimized build?\r\n"},"comment":{"url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/comments/217604891","html_url":"https://github.com/unittest-cpp/unittest-cpp/issues/56#issuecomment-217604891","issue_url":"https://api.github.com/repos/unittest-cpp/unittest-cpp/issues/56","id":217604891,"user":{"login":"pjohnmeyer","id":122016,"avatar_url":"https://avatars.githubusercontent.com/u/122016?v=3","gravatar_id":"","url":"https://api.github.com/users/pjohnmeyer","html_url":"https://github.com/pjohnmeyer","followers_url":"https://api.github.com/users/pjohnmeyer/followers","following_url":"https://api.github.com/users/pjohnmeyer/following{/other_user}","gists_url":"https://api.github.com/users/pjohnmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/pjohnmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjohnmeyer/subscriptions","organizations_url":"https://api.github.com/users/pjohnmeyer/orgs","repos_url":"https://api.github.com/users/pjohnmeyer/repos","events_url":"https://api.github.com/users/pjohnmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/pjohnmeyer/received_events","type":"User","site_admin":false},"created_at":"2016-05-07T03:58:00Z","updated_at":"2016-05-07T03:58:00Z","body":"Closing this due to inability to reproduce."}}