LuaJIT icon indicating copy to clipboard operation
LuaJIT copied to clipboard

vectors: segmentation fault __memcpy_sse2_unaligned ()

Open CapsAdmin opened this issue 9 years ago • 2 comments

compiled with gcc 5.4.0 on x64 linux with the flags LUA_USE_ASSERT, CCDEBUG=-g and CCOPT=-fomit-frame-pointer

I applied this patch on the vectors branch to get it compiling https://gist.github.com/CapsAdmin/00326ad8eda9ca48557013bcd90546fc

Only happens when jit is on.

Program received signal SIGSEGV, Segmentation fault.
__memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:38
38      ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S: No such file or directory.
(gdb) bt
#0  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:38
#1  0x000000000043f1dd in lj_cf_ffi_copy (L=0x40000378) at lib_ffi.c:721
#2  0x000000000044249e in lj_BC_FUNCC ()
#3  0x000000000041ac9e in lua_pcall (L=0x40000378, nargs=0, nresults=-1, errfunc=2) at lj_api.c:1055
#4  0x000000000040440e in docall (L=0x40000378, narg=0, clear=0) at luajit.c:121
#5  0x0000000000404dee in handle_script (L=0x40000378, argv=0x7fffffffde28, n=1) at luajit.c:288
#6  0x0000000000405b23 in pmain (L=0x40000378) at luajit.c:537
#7  0x000000000044249e in lj_BC_FUNCC ()
#8  0x000000000041af48 in lua_cpcall (L=0x40000378, func=0x405965 <pmain>, ud=0x0) at lj_api.c:1079
#9  0x0000000000405c29 in main (argc=2, argv=0x7fffffffde28) at luajit.c:565
(gdb) 

I'm able to pinpoint where it crashes in some situations but it seems random and attempting to debug the code will move the crash somewhere else. When it's not crashing there is weird behavior such as random nonsense lua errors.

CapsAdmin avatar Oct 11 '16 21:10 CapsAdmin

One thing to quickly do is check all the tests still pass with your build running tests/runtests.sh some of them were upgraded to test vectors in the JIT for the branch

fsfod avatar Oct 15 '16 19:10 fsfod

I updated and applied the changes again in order to compile. https://gist.github.com/CapsAdmin/ce5971c7e7ecf4828af935acf840bceb

runtests.sh attempts to run test.lua which i assume is runtests.lua.

There are errors in the telescope test as well. Something about if contexts[a].before then and if contexts[a].after then where context[a] is nil. If I just add an additional check contexts[a] and and hope for the best this is the result's output: https://gist.github.com/CapsAdmin/dcf749a00264282975baf45d84d09fb6

build output: https://gist.github.com/CapsAdmin/980fd36ea766614a399d3f9b05983275

52compat doesn't seem to make a difference

CapsAdmin avatar Oct 15 '16 23:10 CapsAdmin