nfprojects / nfengine

Game engine
GNU General Public License v2.0
55 stars 4 forks source link

Crash in Window test when repeating the test multiple times #167

Closed Witek902 closed 8 years ago

Witek902 commented 8 years ago

Console output

michal ~/DEV/nfengine $ Bin/x86_64/Debug/nfCommonTest --gtest_filter=Window* --gtest_repeat=2
0.0002 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Logger.cpp:80: nfCommon build date: May 29 2016, 13:12:45
0.0002 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Logger.cpp:83: nfCommon built with SSE instructions
0.0002 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Logger.cpp:85: nfCommon built with SSE4.1 instructions
0.0003 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Logger.cpp:106: Run date: May 29 2016, 15:43:00
0.0007 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/FileSystem.cpp:86: Current directory changed to: '/home/michal/DEV/nfengine/Bin/x86_64/Debug/../../..'

Repeating all tests (iteration 1) . . .

Note: Google Test filter = Window*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from WindowTest
[ RUN      ] WindowTest.CreateTest
0.0072 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:165: Found 5 matching FB configs:
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:178:   #0: visualID 0x32, SAMPLE_BUFFERS = 0, SAMPLES = 0
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:178:   #1: visualID 0x111, SAMPLE_BUFFERS = 0, SAMPLES = 0
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:178:   #2: visualID 0x188, SAMPLE_BUFFERS = 1, SAMPLES = 4
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:178:   #3: visualID 0x189, SAMPLE_BUFFERS = 1, SAMPLES = 8
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:178:   #4: visualID 0x183, SAMPLE_BUFFERS = 0, SAMPLES = 0
0.0073 [INFO   ] /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:189: Choosing FB config #0
[       OK ] WindowTest.CreateTest (7 ms)
[----------] 1 test from WindowTest (7 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (7 ms total)
[  PASSED  ] 1 test.

Repeating all tests (iteration 2) . . .

Note: Google Test filter = Window*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from WindowTest
[ RUN      ] WindowTest.CreateTest
[xcb] Unknown sequence number while appending request
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
nfCommonTest: xcb_io.c:161: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Przerwane (zrzut pamięci)

Backtrace

#0  0x00007ffff6477a28 in raise () from /lib64/libc.so.6
#1  0x00007ffff647962a in abort () from /lib64/libc.so.6
#2  0x00007ffff6470227 in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff64702d2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff759663f in append_pending_request () from /lib64/libX11.so.6
#5  0x00007ffff7597118 in _XReply () from /lib64/libX11.so.6
#6  0x00007ffff758d146 in XQueryExtension () from /lib64/libX11.so.6
#7  0x00007ffff7580c52 in XInitExtension () from /lib64/libX11.so.6
#8  0x00007ffff72d97dc in __glXInitialize () from /lib64/libGL.so.1
#9  0x00007ffff72d57d7 in glXGetFBConfigs () from /lib64/libGL.so.1
#10 0x00007ffff72d6a92 in glXChooseFBConfigSGIX () from /lib64/libGL.so.1
#11 0x00007ffff7b9e0d7 in NFE::Common::Window::Open (this=0x7fffffffd4f0) at /home/michal/DEV/nfengine/nfEngine/nfCommon/Linux/Window.cpp:162
#12 0x000000000057dda2 in WindowTest_CreateTest_Test::TestBody (this=0x899990) at /home/michal/DEV/nfengine/nfEngine/nfCommonTest/WindowTest.cpp:11
#13 0x00000000005c1454 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x899990, method=&virtual testing::Test::TestBody(), location=0x6123e3 "the test body")
    at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2078
#14 0x00000000005be092 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x899990, method=&virtual testing::Test::TestBody(), location=0x6123e3 "the test body")
    at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2114
#15 0x00000000005af412 in testing::Test::Run (this=0x899990) at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2151
#16 0x00000000005afbca in testing::TestInfo::Run (this=0x898180) at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2326
#17 0x00000000005b021b in testing::TestCase::Run (this=0x898270) at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2444
#18 0x00000000005b6d59 in testing::internal::UnitTestImpl::RunAllTests (this=0x88c230) at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:4315
#19 0x00000000005c2189 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x88c230, 
    method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x5b6a96 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x612bf0 "auxiliary test code (environments or event listeners)")
    at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2078
#20 0x00000000005bec90 in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x88c230, 
    method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x5b6a96 <testing::internal::UnitTestImpl::RunAllTests()>, location=0x612bf0 "auxiliary test code (environments or event listeners)")
    at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:2114
#21 0x00000000005b5a35 in testing::UnitTest::Run (this=0x877e60 <testing::UnitTest::GetInstance()::instance>) at /home/michal/DEV/nfengine/nfEngineDeps/gtest/src/gtest.cc:3926
#22 0x000000000057dc80 in RUN_ALL_TESTS () at /home/michal/DEV/nfengine/nfEngineDeps/gtest/include/gtest/gtest.h:2288
#23 0x000000000057dbb4 in main (argc=1, argv=0x7fffffffdc88) at /home/michal/DEV/nfengine/nfEngine/nfCommonTest/Main.cpp:11

To do

lookeypl commented 8 years ago

Workaround in review: https://review.gerrithub.io/#/c/278281/

I'll make it a slightly better solution in the future (probably a Linux-specific singleton, holding ownership of Display connection, together with other improvements to Window module.

mkulagowski commented 8 years ago

this can be closed afaik