Skip to content

In the ARM arch, the version 1.15.8.1 rc0 has a segmentation fault #1481

Closed
@luohuichang

Description

@luohuichang

In the ARM arch, the version 1.15.8.1 rc0 has a segmentation fault

dict.flush_all() function will cause the Segmentation fault

nginx.conf:
lua_shared_dict test_dict 1m; in http

dofile code:
test_dict = ngx.shared.test_dict
test_dict:set("key", "value", 1000)
test_dict.flush_all() -- will cause segmentation fault

version:
https://openresty.org/download/openresty-1.15.8.1rc0.tar.gz
[root@kwephicprc03649 ELB_V3_nginx]# /usr/local/NSP/sbin/nginx -V
nginx version: openresty/1.15.8.1rc0
built by gcc 4.9.3 20160525 (prerelease) (GCC)
built with OpenSSL 1.1.0h 27 Mar 2018
TLS SNI support enabled

uname -r

4.1.43-01.25.vhulk1708.1.1.aarch64

dmesg:
[610835.327726] nginx[9053]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[610835.327731] pgd = ffff80038d345000
[610835.327733] [00000000] *pgd=00000003caaae003, *pud=00000003c8fc4003, *pmd=0000000000000000
[610835.327740] CPU: 7 PID: 9053 Comm: nginx Tainted: G E 4.1.44-06.160.vhulk1711.1.1.aarch64 #1
[610835.327743] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
[610835.327745] task: ffff8000ba9ae200 ti: ffff80038c6d0000 task.ti: ffff80038c6d0000
[610835.327760] PC is at 0x597f00
[610835.327762] LR is at 0x59ba00
[610835.327764] pc : [<0000000000597f00>] lr : [<000000000059ba00>] pstate: 20000000
[610835.327766] sp : 0000ffffe5b43510
[610835.327767] x29: 0000ffffe5b43510 x28: 000029faa1dbb710
[610835.327771] x27: 000029faa1de2b68 x26: 0000ffffe5b437b0
[610835.327773] x25: 0000000000000000 x24: 0000000000000003
[610835.327776] x23: 0000ffffe5b43708 x22: 0000000000000000
[610835.327779] x21: 000029faa1db21c8 x20: 0000000000000000
[610835.327781] x19: 0000ffffe5b43708 x18: 0000ffffe5b43400
[610835.327783] x17: 0000ffffa7f1e230 x16: 0000ffffa8284000
[610835.327786] x15: fffffffffffffff5 x14: 0000000000000031
[610835.327788] x13: 000029faa1dbf8a0 x12: 0000000000000065
[610835.327791] x11: 000000000059b8dc x10: 0000ffffe5b437a0
[610835.327793] x9 : ffffffffffffffff x8 : 0000ffffa8211d28
[610835.327796] x7 : 00000000000f4240 x6 : 0000000000000005
[610835.327798] x5 : 000029faa1db2150 x4 : 0000000000000004
[610835.327801] x3 : 0000000000000000 x2 : 0000000000000000
[610835.327803] x1 : 0000000000000002 x0 : fffffffffffffff8

Activity

thibaultcha

thibaultcha commented on Feb 26, 2019

@thibaultcha
Member

@luohuichang Could you share more info to help us reproduce this? I haven't been able to reproduce so far, with the following:

nginx -V
nginx version: openresty/1.15.8.1rc0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/opt/openresty-rc0/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.1rc1 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.14 --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.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.6 --with-ld-opt=-Wl,-rpath,/usr/local/opt/openresty-rc0/luajit/lib --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_ssl_module
  • rc0 (from your link) and the current state (practically rc1 from the openresty/openresty repository)
  • arm64
  • in a content_by_lua_handler
  • with and without lua-resty-core
  • with and without the typo in your code: test_dict.flush_all() vs test_dict:flush_all()
master_process off;
worker_processes 1;
error_log logs/error.log notice;

events {
}

http {
    lua_shared_dict test_dict 1m;

    init_by_lua_block {
        --require "resty.core"
    }

    server {
        listen 9000;

        location / {
            content_by_lua_block {
                test_dict = ngx.shared.test_dict
                test_dict:set("key", "value", 1000)
                test_dict.flush_all()
            }
        }
    }
}

Only by including the typo, a runtime error is thrown when calling flush_all() (due to the lack of arguments), but no segfault so far.

luohuichang

luohuichang commented on Feb 27, 2019

@luohuichang
Author

@thibaultcha
Hi, thibaultcha, thankyou!

I try again, mabe I used the old lua-resty-core in my own code.

luohuichang

luohuichang commented on Feb 28, 2019

@luohuichang
Author

Sorry, I have mistake to use the wrong lib(resty.core), the version work well at ARM now!

David-Bo

David-Bo commented on Jan 22, 2021

@David-Bo

@luohuichang
请问,你现在用的哪个版本的lua-restay-core解决的?还有其他操作吗?
如果可以的话把你现有的配置发我下,谢谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @thibaultcha@luohuichang@David-Bo

        Issue actions

          In the ARM arch, the version 1.15.8.1 rc0 has a segmentation fault · Issue #1481 · openresty/lua-nginx-module