Closed gromero closed 1 year ago
Interesting... the 2 segfaults are related to these lines: https://github.com/PPC64/LuaJIT/blob/ppc64-port/src/vm_ppc64.dasc#L4028 https://github.com/PPC64/LuaJIT/blob/ppc64-port/src/vm_ppc64.dasc#L3123
They don't look related but I'll take a closer look. Thanks for the report.
Thanks gut for taking a look at it. Could that be related to a .so (libsocket.so from lua-socket) when it was linked or loaded improperly?
I can't say ATM. I'll try to reproduce and analyse it. Thanks for the hint
I could reproduce the problem and it's not directly on those bytecodes:
Amount | Frame happening SIGSEGV |
---|---|
0.42% | lj_BC_GGET |
2.49% | lj_BC_TGETS |
5.95% | gc_traverse_frames |
91.14% | lj_BC_RET0 |
(sample size: ~1500)
All of those frames have lj_ff_coroutine_resume
as its caller, but as other bytecodes ran before, we can't assume much.
Well, I'll post here once I have some guesses.
I reviewed many bytecodes on our LuaJIT port and I didn't find a problem. I started to investigate the socket usage on luasocket and I noticed a threshold where LuaJIT on PPC64le starts to fail. That is sending something above of 2742200 bytes. I develop a sample application in C to see that this kind of failure happens besides LuaJIT implementation.
If you're interested, please check https://github.com/gut/socketxp . I see the same behavior also on X64.
For now, I'm stopping my investigation as it looks like something specific to socket implementation and would probably be fixed on luasocket, not on LuaJIT.
Currently code in
ppc64-port
branch (v2.0.4-607-gbb23a15
) segfaults when it runs against a lua-copas test (which in turn uses also lua-socket)The segfault was first identified on Alpine build system:
http://build.alpinelinux.org/buildlogs/build-edge-ppc64le/community/lua-copas/lua-copas-2.0.2-r1.log
I'm able to reproduce using upstream lua-copas with upstream lua-socket:
lua-copas:
git@github.com:keplerproject/copas.git
lua-socket:git@github.com:diegonehab/luasocket.git
gdb shows two problematic bytecodes
BC_RET0
andBC_UGET
:and