fogleman/Craft

Crash while closing window on Ubuntu 18.04

juozaspo opened this issue · 1 comments

Craft built on Ubuntu 18.04 crash when closing it's window (as no other way to properly exit game is provided)
Gdb backtrace (all threads, built with -DCMAKE_BUILD_TYPE=Debug
in cmake command line):

(gdb) r
Starting program: /home/juozas/test/Craft/craft 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffec665700 (LWP 12735)]
[New Thread 0x7fffebe64700 (LWP 12736)]
[New Thread 0x7fffeb663700 (LWP 12737)]
[New Thread 0x7fffeae62700 (LWP 12738)]
[New Thread 0x7fffea661700 (LWP 12739)]
[Thread 0x7fffea661700 (LWP 12739) exited]

Thread 1 "craft" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x55a49d90) at malloc.c:3103
3103	malloc.c: No such file or directory.
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffeae62700 (LWP 12738)):
#0  0x00007ffff6eda9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555558bb308 <model+968>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5555558bb2b8 <model+888>, cond=0x5555558bb2e0 <model+928>) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x5555558bb2e0 <model+928>, mutex=0x5555558bb2b8 <model+888>) at pthread_cond_wait.c:655
#3  0x0000555555673459 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:289
#4  0x000055555559e29b in worker_run (arg=arg@entry=0x5555558bb2a8 <model+872>) at /home/juozas/test/Craft/src/main.c:1437
#5  0x00005555556732b7 in _thrd_wrapper_function (aArg=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:346
#6  0x00007ffff6ed46db in start_thread (arg=0x7fffeae62700) at pthread_create.c:463
#7  0x00007ffff5c0488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7fffeb663700 (LWP 12737)):
#0  0x00007ffff6eda9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555558bb1e8 <model+680>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5555558bb198 <model+600>, cond=0x5555558bb1c0 <model+640>) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x5555558bb1c0 <model+640>, mutex=0x5555558bb198 <model+600>) at pthread_cond_wait.c:655
#3  0x0000555555673459 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:289
#4  0x000055555559e29b in worker_run (arg=arg@entry=0x5555558bb188 <model+584>) at /home/juozas/test/Craft/src/main.c:1437
#5  0x00005555556732b7 in _thrd_wrapper_function (aArg=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:346
#6  0x00007ffff6ed46db in start_thread (arg=0x7fffeb663700) at pthread_create.c:463
#7  0x00007ffff5c0488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7fffebe64700 (LWP 12736)):
#0  0x00007ffff6eda9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555558bb0c8 <model+392>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5555558bb078 <model+312>, cond=0x5555558bb0a0 <model+352>) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x5555558bb0a0 <model+352>, mutex=0x5555558bb078 <model+312>) at pthread_cond_wait.c:655
#3  0x0000555555673459 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:289
#4  0x000055555559e29b in worker_run (arg=arg@entry=0x5555558bb068 <model+296>) at /home/juozas/test/Craft/src/main.c:1437
#5  0x00005555556732b7 in _thrd_wrapper_function (aArg=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:346
#6  0x00007ffff6ed46db in start_thread (arg=0x7fffebe64700) at pthread_create.c:463
#7  0x00007ffff5c0488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fffec665700 (LWP 12735)):
#0  0x00007ffff6eda9f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555558bafa8 <model+104>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  __pthread_cond_wait_common (abstime=0x0, mutex=0x5555558baf58 <model+24>, cond=0x5555558baf80 <model+64>) at pthread_cond_wait.c:502
#2  __pthread_cond_wait (cond=0x5555558baf80 <model+64>, mutex=0x5555558baf58 <model+24>) at pthread_cond_wait.c:655
#3  0x0000555555673459 in cnd_wait (cond=<optimized out>, mtx=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:289
#4  0x000055555559e29b in worker_run (arg=arg@entry=0x5555558baf48 <model+8>) at /home/juozas/test/Craft/src/main.c:1437
#5  0x00005555556732b7 in _thrd_wrapper_function (aArg=<optimized out>) at /home/juozas/test/Craft/deps/tinycthread/tinycthread.c:346
#6  0x00007ffff6ed46db in start_thread (arg=0x7fffec665700) at pthread_create.c:463
#7  0x00007ffff5c0488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7ffff7fae780 (LWP 12731)):
#0  __GI___libc_free (mem=0x55a49d90) at malloc.c:3103
#1  0x000055555567557c in _glfwFreeMonitor (monitor=0x555555a49e00) at /home/juozas/test/Craft/deps/glfw/src/monitor.c:185
#2  0x00005555556755bc in _glfwFreeMonitors (monitors=0x555555a49db0, count=<optimized out>) at /home/juozas/test/Craft/deps/glfw/src/monitor.c:211
#3  0x00005555556745c0 in glfwTerminate () at /home/juozas/test/Craft/deps/glfw/src/init.c:162
#4  0x00005555555943fe in main (argc=<optimized out>, argv=<optimized out>) at /home/juozas/test/Craft/src/main.c:2960

Cmake output:

juozas@xubuntu:~/test/Craft$ cmake . -DCMAKE_BUILD_TYPE=Debug
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.13") found components:  doxygen 
-- Using X11 for window creation
-- Using GLX for context creation
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.58.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/juozas/test/Craft

Oops. This was already reported in #217. Closing this