Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vectors: segmentation fault __memcpy_sse2_unaligned () #1

Open
CapsAdmin opened this issue Oct 11, 2016 · 2 comments
Open

vectors: segmentation fault __memcpy_sse2_unaligned () #1

CapsAdmin opened this issue Oct 11, 2016 · 2 comments

Comments

@CapsAdmin
Copy link

CapsAdmin commented Oct 11, 2016

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.

@fsfod
Copy link
Owner

fsfod commented Oct 15, 2016

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

@CapsAdmin
Copy link
Author

CapsAdmin commented Oct 15, 2016

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

fsfod pushed a commit that referenced this issue Nov 22, 2017
Add a C version of the VM event hooks
fsfod pushed a commit that referenced this issue Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants