pandorabox-io / pandorabox.io

Pandorabox infrastructure code
https://pandorabox.io
31 stars 4 forks source link

Segfault in c_internal.cpp #446

Closed thomasrudin closed 4 years ago

thomasrudin commented 4 years ago
Core was generated by `minetestserver --config /data/minetest.conf --world /data/world/ --quiet'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055749caa7fc8 in script_exception_wrapper (L=0x41bb2378, f=0x6c61635f42cc4c90) at /git/minetest/src/script/common/c_internal.cpp:38
38          return f(L);  // Call wrapped function and return result.
[Current thread is 1 (Thread 0x7f532a7fc700 (LWP 18))]
(gdb) backtrace
#0  0x000055749caa7fc8 in script_exception_wrapper (L=0x41bb2378, f=0x6c61635f42cc4c90) at /git/minetest/src/script/common/c_internal.cpp:38
#1  0x00007f5332d7be97 in ?? ()
#2  0x0000000200000003 in ?? ()
#3  0x000055749e98c1b0 in ?? ()
#4  0x0000001000000002 in ?? ()
#5  0x0000000041bb2378 in ?? ()
#6  0x0000000000000000 in ?? ()
Core was generated by `minetestserver --config /data/minetest.conf --world /data/world/ --quiet'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000041c07000 in ?? ()
[Current thread is 1 (Thread 0x7f503e76f700 (LWP 17))]
(gdb) backtrace
#0  0x0000000041c07000 in ?? ()
#1  0x0000557d90ae0fea in script_exception_wrapper (L=0x4059c378, f=<optimized out>) at /git/minetest/src/script/common/c_internal.cpp:38
#2  0x00007f50468a4e97 in ?? ()
#3  0x0000000200000003 in ?? ()
#4  0x0000557d92aa34d0 in ?? ()
#5  0x0000001000000002 in ?? ()
#6  0x000000004059c378 in ?? ()
#7  0x0000000000000000 in ?? ()

https://github.com/minetest/minetest/blob/c02f13d33f87e030e89a63767f5f96e03fedc6fe/src/script/common/c_internal.cpp#L38

BuckarooBanzay commented 4 years ago

Upstream issue: https://github.com/minetest/minetest/issues/9497

BuckarooBanzay commented 4 years ago

Current progress

Semi-Debug build

The backtraces are revealing not that much information:

Core was generated by `minetestserver --config /data/minetest.conf --world /data/world/ --quiet'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fa8671ca5d6 in ?? ()
[Current thread is 1 (Thread 0x7fa856ffd700 (LWP 17))]
(gdb) backtrace
#0  0x00007fa8671ca5d6 in ?? ()
#1  0x00007fa8671ca6d3 in ?? ()
#2  0x00007fa867204bf1 in ?? ()
#3  0x0000000045486288 in ?? ()
#4  0x0000000041452378 in ?? ()
#5  0x000001ea00000000 in ?? ()
#6  0x0000000042550a40 in ?? ()

Full debug build

As proposed by Krock in https://github.com/minetest/minetest/issues/9497#issuecomment-600843589

This failed due to a deadlock introduced by https://github.com/minetest/minetest/issues/9543 there were connection issues a few days back they were caused by this..

After i applied the fix (https://github.com/pandorabox-io/minetest_docker/blob/ec998931f0505f83b4d264af7a9e3fcefaf74e96/Dockerfile#L46) the new version caused a few crashes in other libraries:

[16615711.120827] Server[10329]: segfault at fffffffffffffff8 ip 00007fa8671ca5d6 sp 00007fa856ffb8d0 error 5 in libluajit-5.1.so.2.1.0[7fa8671ba000+76000]

And one was even in libc :confounded:

I went deeper down the rabbit-hole and started to build debug-version of libluajit but i gave up after a few more unrelated crashes in the build process..

Memtest

I also let the memtester run for a few hours just in case, but everything looked good, the problems aren't from defective RAM...

Further steps

I've given up at this point and waiting for a new minetest-release to throw out a few patches (https://github.com/pandorabox-io/minetest_docker/blob/ec998931f0505f83b4d264af7a9e3fcefaf74e96/Dockerfile#L39-L61) and make a "cleaner" build of the engine...

btw: Help is welcome if anyone has experience debugging with core-dumps and gdb...

@OgelGames

BuckarooBanzay commented 4 years ago

closing this, reopening another one if the problem persists with 5.2.0