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

segfault error #265

Open
DavidLeeUX opened this issue Oct 15, 2019 · 3 comments
Open

segfault error #265

DavidLeeUX opened this issue Oct 15, 2019 · 3 comments

Comments

@DavidLeeUX
Copy link

Tengine version: Tengine/2.3.0 (nginx/1.15.9)
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.1.0g 2 Nov 2017

nginx-upsync-module 使用的是master分支代码

有时进程会出现segfault error
gdb如下

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-64.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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/sbin/nginx...Reading symbols from /usr/lib/debug/usr/sbin/nginx.debug...done.
done.
[New LWP 7004]
[New LWP 8731]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `nginx: worker pr'.
Program terminated with signal 11, Segmentation fault.
#0 ngx_http_upstream_get_peer (rrp=0x14c5d84b04c8) at src/http/ngx_http_upstream_round_robin.c:626
626 if (peer->down) {
Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 jemalloc-3.6.0-1.el7.x86_64 libgcc-4.8.5-28.el7_5.1.x86_64 nss-softokn-freebl-3.16.2.3-9.el7.x86_64 pcre-8.32-14.el7.x86_64 sssd-client-1.12.2-58.el7.x86_64 zlib-1.2.7-13.el7.x86_64
(gdb) list
621
622 if (rrp->tried[n] & m) {
623 continue;
624 }
625
626 if (peer->down) {
627 continue;
628 }
629
630 #if (NGX_HTTP_UPSTREAM_CHECK)
(gdb) bt
#0 ngx_http_upstream_get_peer (rrp=0x14c5d84b04c8) at src/http/ngx_http_upstream_round_robin.c:626
#1 ngx_http_upstream_get_round_robin_peer (pc=0x14c5db8989e8, data=0x14c5d84b04c8) at src/http/ngx_http_upstream_round_robin.c:520
#2 0x00000000004ee4ca in ngx_http_upstream_get_keepalive_peer (pc=0x14c5db8989e8, data=0x14c5d84b0490) at src/http/modules/ngx_http_upstream_keepalive_module.c:241
#3 0x0000000000478728 in ngx_event_connect_peer (pc=pc@entry=0x14c5db8989e8) at src/event/ngx_event_connect.c:34
#4 0x00000000004ab87a in ngx_http_upstream_connect (r=r@entry=0x14c5dbc64050, u=u@entry=0x14c5db8989d8) at src/http/ngx_http_upstream.c:1611
#5 0x00000000004acb42 in ngx_http_upstream_init_request (r=r@entry=0x14c5dbc64050) at src/http/ngx_http_upstream.c:871
#6 0x00000000004ad63d in ngx_http_upstream_init (r=r@entry=0x14c5dbc64050) at src/http/ngx_http_upstream.c:549
#7 0x000000000049ff07 in ngx_http_read_client_request_body (r=r@entry=0x14c5dbc64050, post_handler=0x4ad623 <ngx_http_upstream_init>) at src/http/ngx_http_request_body.c:77
#8 0x00000000004db181 in ngx_http_proxy_handler (r=0x14c5dbc64050) at src/http/modules/ngx_http_proxy_module.c:946
#9 0x0000000000493bb8 in ngx_http_core_content_phase (r=0x14c5dbc64050, ph=) at src/http/ngx_http_core_module.c:1314
#10 0x000000000048e6b3 in ngx_http_core_run_phases (r=r@entry=0x14c5dbc64050) at src/http/ngx_http_core_module.c:937
#11 0x000000000048e7c2 in ngx_http_handler (r=r@entry=0x14c5dbc64050) at src/http/ngx_http_core_module.c:920
#12 0x000000000049769d in ngx_http_process_request (r=r@entry=0x14c5dbc64050) at src/http/ngx_http_request.c:2204
#13 0x00000000004c763b in ngx_http_v2_run_request (r=0x14c5dbc64050) at src/http/v2/ngx_http_v2.c:3789
#14 0x00000000004c76c7 in ngx_http_v2_state_header_complete (h2c=h2c@entry=0x14c5d8476a20, pos=pos@entry=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066",
end=end@entry=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066") at src/http/v2/ngx_http_v2.c:1704
#15 0x00000000004c7f6e in ngx_http_v2_state_process_header (h2c=h2c@entry=0x14c5d8476a20, pos=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066",
end=end@entry=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066") at src/http/v2/ngx_http_v2.c:1675
#16 0x00000000004c86cd in ngx_http_v2_state_header_block (h2c=0x14c5d8476a20, pos=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066", end=0x14c5dc94f1cf "\240\361\356Ke\370\211\t\032mDF\222\006\232\023\256\064\333\357\066")
at src/http/v2/ngx_http_v2.c:1273
#17 0x00000000004c665f in ngx_http_v2_read_handler (rev=rev@entry=0x14c5e544d028) at src/http/v2/ngx_http_v2.c:413
#18 0x00000000004c6b7c in ngx_http_v2_idle_handler (rev=0x14c5e544d028) at src/http/v2/ngx_http_v2.c:4536
#19 0x0000000000481ff5 in ngx_epoll_process_events (cycle=, timer=, flags=) at src/event/modules/ngx_epoll_module.c:973
#20 0x0000000000476ee2 in ngx_process_events_and_timers (cycle=cycle@entry=0x14c60bcae050) at src/event/ngx_event.c:255
#21 0x00000000004801ee in ngx_worker_process_cycle (cycle=0x14c60bcae050, data=) at src/os/unix/ngx_process_cycle.c:811
#22 0x000000000047c6bb in ngx_spawn_process (cycle=cycle@entry=0x14c60bcae050, proc=proc@entry=0x48017d <ngx_worker_process_cycle>, data=data@entry=0xb, name=name@entry=0x71b4e7 "worker process", respawn=respawn@entry=-3) at src/os/unix/ngx_process.c:199
#23 0x000000000047f45b in ngx_start_worker_processes (cycle=cycle@entry=0x14c60bcae050, n=20, type=type@entry=-3) at src/os/unix/ngx_process_cycle.c:395
#24 0x00000000004808ee in ngx_master_process_cycle (cycle=cycle@entry=0x14c60bcae050) at src/os/unix/ngx_process_cycle.c:138
#25 0x0000000000457ae4 in main (argc=, argv=) at src/core/nginx.c:418
(gdb) print peer
$1 = (ngx_http_upstream_rr_peer_t *) 0x0

@xiaokai-wang
Copy link
Member

./configure 后面完整参数麻烦列一下,请参考read.me 进行配置、编译

@mawag
Copy link

mawag commented Nov 24, 2020

有后续吗?我这边也出现了这个问题,使用的是 tengine 2.3.2

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.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 "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/work/.nginx.packages/a94f341230872178/sbin/nginx...done.
[New LWP 18262]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `nginx: worker process      '.
Program terminated with signal 11, Segmentation fault.
#0  ngx_http_upstream_get_peer (rrp=0x256eee0) at src/http/ngx_http_upstream_round_robin.c:639
639	src/http/ngx_http_upstream_round_robin.c: 没有那个文件或目录.
Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.1.x86_64 libgcc-4.8.5-28.el7_5.1.x86_64 nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64 sssd-client-1.14.0-43.el7_3.14.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt
#0  ngx_http_upstream_get_peer (rrp=0x256eee0) at src/http/ngx_http_upstream_round_robin.c:639
#1  ngx_http_upstream_get_round_robin_peer (pc=0x256e548, data=0x256eee0) at src/http/ngx_http_upstream_round_robin.c:529
#2  0x000000000046fbe8 in ngx_event_connect_peer (pc=pc@entry=0x256e548) at src/event/ngx_event_connect.c:34
#3  0x00000000004a2bd7 in ngx_http_upstream_connect (r=r@entry=0x24c8340, u=u@entry=0x256e538) at src/http/ngx_http_upstream.c:1617
#4  0x00000000004a3e79 in ngx_http_upstream_init_request (r=r@entry=0x24c8340) at src/http/ngx_http_upstream.c:871
#5  0x00000000004a49b5 in ngx_http_upstream_init (r=r@entry=0x24c8340) at src/http/ngx_http_upstream.c:574
#6  0x00000000004971e7 in ngx_http_read_client_request_body (r=r@entry=0x24c8340, post_handler=0x4a4938 <ngx_http_upstream_init>) at src/http/ngx_http_request_body.c:77
#7  0x00000000004d18a7 in ngx_http_proxy_handler (r=0x24c8340) at src/http/modules/ngx_http_proxy_module.c:946
#8  0x000000000048af3f in ngx_http_core_content_phase (r=0x24c8340, ph=<optimized out>) at src/http/ngx_http_core_module.c:1314
#9  0x0000000000485a93 in ngx_http_core_run_phases (r=r@entry=0x24c8340) at src/http/ngx_http_core_module.c:937
#10 0x0000000000485ba2 in ngx_http_handler (r=r@entry=0x24c8340) at src/http/ngx_http_core_module.c:920
#11 0x000000000048eaa3 in ngx_http_process_request (r=r@entry=0x24c8340) at src/http/ngx_http_request.c:2218
#12 0x0000000000490b90 in ngx_http_process_request_headers (rev=rev@entry=0x7f02836408d0) at src/http/ngx_http_request.c:1618
#13 0x0000000000490e69 in ngx_http_process_request_line (rev=rev@entry=0x7f02836408d0) at src/http/ngx_http_request.c:1279
#14 0x00000000004911fd in ngx_http_wait_request_handler (rev=0x7f02836408d0) at src/http/ngx_http_request.c:535
#15 0x0000000000479058 in ngx_epoll_process_events (cycle=<optimized out>, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:973
#16 0x000000000046e3e2 in ngx_process_events_and_timers (cycle=cycle@entry=0x1c765e0) at src/event/ngx_event.c:255
#17 0x00000000004776a5 in ngx_worker_process_cycle (cycle=0x1c765e0, data=<optimized out>) at src/os/unix/ngx_process_cycle.c:811
#18 0x0000000000473b7b in ngx_spawn_process (cycle=cycle@entry=0x1c765e0, proc=0x477634 <ngx_worker_process_cycle>, data=0xf, name=0x6c21a7 "worker process",
    respawn=respawn@entry=15) at src/os/unix/ngx_process.c:199
#19 0x0000000000478035 in ngx_reap_children (cycle=0x1c765e0) at src/os/unix/ngx_process_cycle.c:666
#20 ngx_master_process_cycle (cycle=cycle@entry=0x1c765e0) at src/os/unix/ngx_process_cycle.c:189
#21 0x000000000044eeff in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:418
(gdb) bt full
#0  ngx_http_upstream_get_peer (rrp=0x256eee0) at src/http/ngx_http_upstream_round_robin.c:639
        m = 128
        flag = 0
        i = 7
        peer = 0x0
        best = <optimized out>
        now = 1606197986
        total = <optimized out>
        n = 0
        p = <optimized out>
#1  ngx_http_upstream_get_round_robin_peer (pc=0x256e548, data=0x256eee0) at src/http/ngx_http_upstream_round_robin.c:529
        rrp = 0x256eee0
        rc = <optimized out>
        i = <optimized out>
        n = <optimized out>
        peer = <optimized out>
        peers = 0x1d30880
#2  0x000000000046fbe8 in ngx_event_connect_peer (pc=pc@entry=0x256e548) at src/event/ngx_event_connect.c:34
        rc = <optimized out>
        type = <optimized out>
        value = 0
        port = <optimized out>
        event = <optimized out>
        err = <optimized out>
        level = <optimized out>
        s = <optimized out>
        rev = <optimized out>
        wev = <optimized out>
        c = <optimized out>
#3  0x00000000004a2bd7 in ngx_http_upstream_connect (r=r@entry=0x24c8340, u=u@entry=0x256e538) at src/http/ngx_http_upstream.c:1617
        rc = <optimized out>
        c = <optimized out>
#4  0x00000000004a3e79 in ngx_http_upstream_init_request (r=r@entry=0x24c8340) at src/http/ngx_http_upstream.c:871
        host = <optimized out>
        i = <optimized out>
        part = <optimized out>
        ctx = <optimized out>
        temp = {next = 0x1e4adc0, resolver = 0x0, node = 0x2561da4, ident = 39198137, state = 47, name = {len = 5570071, data = 0x0}, service = {len = 4538238,
            data = 0x303032b0 <Address 0x303032b0 out of bounds>}, valid = 0, naddrs = 140731964668652, addrs = 0x1, addr = {sockaddr = 0x2178ab0, socklen = 0, name = {
              len = 39198116, data = 0x1d900000004 <Address 0x1d900000004 out of bounds>}, priority = 35440, weight = 535}, sin = {sin_family = 7588, sin_port = 598,
            sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\001\000\000"}, count = 0, nsrvs = 0, srvs = 0x2561db1, handler = 0x7ffeb6c33ae0, data = 0x24c8340,
          timeout = 31765408, quick = 0, async = 0, cancelable = 1, recursion = 31765408, event = 0x2b}
---Type <return> to continue, or q <return> to quit---q
Quit

编译参数信息如下:

Tengine version: Tengine/2.3.2
nginx version: nginx/1.17.3
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/home/work/nginx --error-log-path=/home/work/log/nginx/error.log --http-log-path=/home/work/log/nginx/access.log --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_stub_status_module --with-http_degradation_module --with-http_lua_module --with-luajit-inc=/home/work/nginx/modules/luajit/include/luajit-2.1 --with-luajit-lib=/home/work/nginx/modules/luajit/lib --with-ld-opt=-Wl,-rpath,/home/work/nginx/modules/luajit/lib --http-client-body-temp-path=/home/work/nginx/tmp/body --http-proxy-temp-path=/home/work/nginx/tmp/proxy --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-pcre-jit --with-file-aio --with-pcre=./modules/pcre --with-openssl=./modules/openssl --with-openssl-opt=enable-shared --add-module=./modules/ngx_devel_kit --add-module=./modules/ngx_http_concat_module --add-module=./modules/ngx_http_upstream_session_sticky_module --add-module=./modules/ngx_http_upstream_check_module --add-module=./modules/nginx-module-vts --add-module=./modules/nginx-upsync-module

@1450793561
Copy link

这个有解决么?

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

4 participants