OpenPower 8机器,系统是centos 7.9,1.21.4.1rc1和1.19.9.1版本都试过,按照官网指导步骤编译后启动报Segmentation fault错误,具体信息如图。
请大神帮忙指点下哪儿出了问题,多谢。
ppc64le平台编译成功后启动失败
这个是编译的日志:
http://23.105.219.253/ppc64le.txt
/var/log/message日志显示:
Jan 6 20:00:52 openpower kernel: nginx[49130]: unhandled signal 11 at 000000000000312c nip 000000000000312c lr 00003fff8e8b9f00 code 30001
麻烦能使用 gdb 获取一下 openresty 启动后崩溃时的调用栈吗,如果可以的话,也麻烦提供一下 nginx -V
的输出
gdb $(command -v openresty)
xiaocang
您看下面这样行不行。
另外更新一下后来的情况:我在github上openresty/luajit2找到了去年的一个“Patch for PPC64 support”的提交,把那个替换掉bundle/LuaJIT-2.1-20211210,编译启动就没没问题了。
[2022-01-25 12:07:39] ~/openresty-1.21.4.1rc1/build/nginx-1.21.4/objs
./nginx '.
[root@vm1] # gdb -c core.12008 ./nginx
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "ppc64le-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/openresty-1.21.4.1rc1/build/nginx-1.21.4/objs/nginx...done.
[New LWP 12008]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by
Program terminated with signal 11, Segmentation fault.
#0 0x000000000000312c in ?? ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-325.el7_9.ppc64le keyutils-libs-1.5.8-3.el7.ppc64le krb5-libs-1.15.1-51.el7_9.ppc64le libcom_err-1.42.9-19.el7.ppc64le libgcc-4.8.5-44.el7.ppc64le libselinux-2.5-15.el7.ppc64le nss-softokn-freebl-3.67.0-3.el7_9.ppc64le openssl-libs-1.0.2k-24.el7_9.ppc64le pcre-8.32-17.el7.ppc64le zlib-1.2.7-19.el7_9.ppc64le
(gdb) l
189 static char *ngx_signal;
190 ngx_pool_t *saved_init_cycle_pool = NULL;
191
192
193 static char **ngx_os_environ;
194
195
196 int ngx_cdecl
197 main(int argc, char *const *argv)
198 {
(gdb)
199 ngx_buf_t *b;
200 ngx_log_t *log;
201 ngx_uint_t i;
202 ngx_cycle_t *cycle, init_cycle;
203 ngx_conf_dump_t *cd;
204 ngx_core_conf_t *ccf;
205
206 ngx_debug_init();
207
208 if (ngx_strerror_init() != NGX_OK) {
(gdb) bt
#0 0x000000000000312c in ?? ()
#1 0x00003fff8b4c9f00 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#2 0x00003fff8b4e34cc in lua_call (L=<optimized out>, nargs=<optimized out>, nresults=<error reading variable: value has been optimized out>) at lj_api.c:1127
#3 0x00003fff8b50a310 in lj_cf_package_require (L=0x0) at lib_package.c:464
#4 0x00003fff8b4c9f00 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#5 0x00003fff8b4e34cc in lua_call (L=<optimized out>, nargs=<optimized out>, nresults=<error reading variable: value has been optimized out>) at lj_api.c:1127
#6 0x00003fff8b50a310 in lj_cf_package_require (L=0x0) at lib_package.c:464
#7 0x00003fff8b4c9f00 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#8 0x00003fff8b4e3538 in lua_pcall (L=<optimized out>, nargs=<optimized out>, nresults=<error reading variable: value has been optimized out>, errfunc=<optimized out>) at lj_api.c:1145
#9 0x000000001012de64 in ngx_http_lua_init_vm (new_vm=0x1002ab1fc50, parent_vm=<optimized out>, cycle=<optimized out>, pool=<optimized out>, lmcf=0x0, log=0x20df03d0, pcln=0x0)
at ../ngx_lua-0.10.21rc1/src/ngx_http_lua_util.c:3958
#10 0x00000000101215c0 in ngx_http_lua_init (cf=0x3fffc0657f10) at ../ngx_lua-0.10.21rc1/src/ngx_http_lua_module.c:865
#11 0x000000001006f2a4 in ngx_http_block (cf=0x101c5ba0, cmd=<optimized out>, conf=<optimized out>) at src/http/ngx_http.c:310
#12 0x000000001003ef9c in ngx_conf_handler (last=1, cf=0x3fffc0657f10) at src/core/ngx_conf_file.c:463
#13 ngx_conf_parse (cf=0x3fffc0657f10, filename=0x1002ab14e48) at src/core/ngx_conf_file.c:319
#14 0x000000001003c438 in ngx_init_cycle (old_cycle=0x3fffc0658070) at src/core/ngx_cycle.c:284
#15 0x0000000010023008 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:295
(gdb) Z
[6]+ Stopped gdb -c core.12008 ./nginx
[2022-01-25 12:07:58] ~/openresty-1.21.4.1rc1/build/nginx-1.21.4/objs
[root@vm1] #
[2022-01-25 12:07:58] ~/openresty-1.21.4.1rc1/build/nginx-1.21.4/objs
[root@vm1] #
[2022-01-25 12:07:58] ~/openresty-1.21.4.1rc1/build/nginx-1.21.4/objs
[root@vm1] # ./nginx -V
nginx version: openresty/1.21.4.1rc1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-debug --with-cc-opt='-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O2' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.32 --add-module=../ngx_lua-0.10.21rc1 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.11rc1 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module
`
感谢提供的信息,我们排查一下是不是新版本 LuaJIT 引入的 bug
@id92307 抱歉,ppc64le 平台不是 luajit2 官方支持的平台,关于这个问题欢迎在 https://github.com/openresty/luajit2/issues 提出 issue,由社区的人们帮忙解决