openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.2k stars 193 forks source link

Tests failing for ppc64le #186

Open ambujkumar3 opened 1 year ago

ambujkumar3 commented 1 year ago

Test failing on ppc64le, when i have tested with luajit2-test-suite using luajit

[root@2092f12255fb luajit2-test-suite]# gdb --args luajit test/misc/tonumber_scan.lua

Starting program: /usr/local/bin/luajit test/misc/tonumber_scan.lua

Program received signal SIGSEGV, Segmentation fault. 0x00000000000030e8 in ?? () Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-189.5.el8_6.ppc64le libgcc-8.5.0-15.el8.ppc64le (gdb) bt

0 0x00000000000030e8 in ?? ()

1 0x000000001003fcf4 in lj_BC_FUNCC ()

2 0x000000001001cb68 in lua_pcall (L=0x79600380, nargs=0, nresults=-1, errfunc=2) at lj_api.c:1145

3 0x0000000010004de8 in docall (L=0x79600380, narg=0, clear=0) at luajit.c:122

4 0x0000000010005ae4 in handle_script (L=0x79600380, argx=0x7ffffffffb30) at luajit.c:292

5 0x00000000100069ec in pmain (L=0x79600380) at luajit.c:550

6 0x000000001003fcf4 in lj_BC_FUNCC ()

7 0x000000001001cda0 in lua_cpcall (L=0x79600380, func=0x10006808 , ud=0x0) at lj_api.c:1173

8 0x0000000010006b8c in main (argc=2, argv=0x7ffffffffb28) at luajit.c:581

(gdb) info f 0x00000000000030e8 Stack frame at 0x30e8: pc = 0x0; saved pc = Outermost frame: previous frame identical to this frame (corrupt stack?) Arglist at 0x7ffffffff260, args: Locals at 0x7ffffffff260, Previous frame's sp is 0x7ffffffff260 (gdb) info f 0x000000001003fcf4 Stack frame at 0x1003fcf4: pc = 0x0; saved pc = Outermost frame: previous frame identical to this frame (corrupt stack?) Arglist at 0x7ffffffff260, args: Locals at 0x7ffffffff260, Previous frame's sp is 0x7ffffffff260

vaibhav-bhadade commented 1 year ago

Hi team, @zhuizhuhaomeng same issue has been observed while testing for few of our product. we have a fix for this issue and want to upstream these changes . So please let me know how to proceed further.

zhuizhuhaomeng commented 1 year ago

@vaibhav-bhadade if https://github.com/LuaJIT/LuaJIT supports PPCle, then you should create PR for the LuaJIT first. we will sync from https://github.com/LuaJIT/LuaJIT/tree/v2.1/src.

If not, please create a PR for openresty/luajit2

vikasgupta8 commented 1 year ago

Hi @zhuizhuhaomeng /Team,

https://github.com/LuaJIT/LuaJIT does not support ppc64le and the PR (https://github.com/LuaJIT/LuaJIT/pull/140) was raised to add support for ppc64le but it is not merged yet.

Also, we have observed from the history of file (vm_ppc.dasc), the commit 2763a421d6219c8cb2bbd39246de619dc796bab6 had changes to support ppc64le but the immediate commit ae20998ff5aaacc8e3afd46c64e28a8e039b58a1 does not have these changes or changes were overwritten.

Which brings the question how the merge happens in luajit2. If we raise PR to luajit2 and later commits could again overwrite these changes. As per below commits it get overwritten.

https://github.com/openresty/luajit2/commit/2763a421d6219c8cb2bbd39246de619dc796bab6 (May 3, 2020) https://github.com/openresty/luajit2/commit/ae20998ff5aaacc8e3afd46c64e28a8e039b58a1 (May 19, 2020)

We would like to raise PR with openresty/luajit2, please let us know how to avoid our changes to get overwritten in luajit2.

Thanks, Vikas Gupta

zhuizhuhaomeng commented 1 year ago

We will periodically sync the latest code from https://github.com/LuaJIT/LuaJIT. Current tests cover x64, arm64, and s390x hardware platforms. The new synced code may not be compatible with PPC64le, so we need your help to improve it. You can follow our repository and perform regression tests when new syncs are available.