<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:DengXian;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="ZH-CN" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi, </span></p>
<p class="MsoNormal"><span lang="EN-US">   Sorry I forget the mail I send before.
</span></p>
<p class="MsoNormal"><span lang="EN-US">   Now the core file generate by nginx 1.22.0.</span></p>
<p class="MsoNormal"><span lang="EN-US">   It is meaningless to run nginx without third-party modules.</span></p>
<p class="MsoNormal"><span lang="EN-US">   I want to know if  it crash when calling functions in nginx ( not in third-party module ) , it is not the problem relate to third-party modules?  Or it also be likely to cause by third-party modules?</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The print in gdb with ‘bt’ and ‘info local’:</span></p>
<p class="MsoNormal"><span lang="EN-US">````</span></p>
<p class="MsoNormal"><span lang="EN-US">Core was generated by `nginx: worker process                                '.</span></p>
<p class="MsoNormal"><span lang="EN-US">Program terminated with signal 11, Segmentation fault.</span></p>
<p class="MsoNormal"><span lang="EN-US">#0  0x0000000000464af6 in ngx_log_error_core (level=8, log=0x3f05518, err=<optimized out>, fmt=0x7ffdf20c6124 "") at src/core/ngx_log.c:168</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">warning: Source file is more recent than executable.</span></p>
<p class="MsoNormal"><span lang="EN-US">168              log->writer(log, level, errstr, p - errstr);</span></p>
<p class="MsoNormal"><span lang="EN-US">Missing separate debuginfos, use: debuginfo-install glibc-2.17-317.el7.x86_64 nss-softokn-freebl-3.34.0-2.el7.x86_64 sssd-client-1.16.0-19.el7.x86_64</span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) bt</span></p>
<p class="MsoNormal"><span lang="EN-US">#0  0x0000000000464af6 in ngx_log_error_core (level=8, log=0x3f05518, err=<optimized out>, fmt=0x7ffdf20c6124 "") at src/core/ngx_log.c:168</span></p>
<p class="MsoNormal"><span lang="EN-US">#1  0x00000000004873d7 in ngx_memalign (alignment=16, size=4096, log=0x3f05518) at src/os/unix/ngx_alloc.c:65</span></p>
<p class="MsoNormal"><span lang="EN-US">#2  0x000000000046508f in ngx_palloc_block (pool=0x4028770, size=72) at src/core/ngx_palloc.c:186</span></p>
<p class="MsoNormal"><span lang="EN-US">#3  0x000000000046527f in ngx_palloc_small (align=1, size=<optimized out>, pool=<optimized out>) at src/core/ngx_palloc.c:173</span></p>
<p class="MsoNormal"><span lang="EN-US">#4  ngx_palloc (pool=<optimized out>, size=<optimized out>) at src/core/ngx_palloc.c:127</span></p>
<p class="MsoNormal"><span lang="EN-US">#5  0x0000000000465342 in ngx_pcalloc (pool=<optimized out>, size=72) at src/core/ngx_palloc.c:302</span></p>
<p class="MsoNormal"><span lang="EN-US">#6  0x0000000000554834 in ngx_rtmp_shared_alloc_frame (size=4096, cl=0x402e830, mandatory=0) at ../nginx-rtmp-module/ngx_rtmp_shared_module.c:229</span></p>
<p class="MsoNormal"><span lang="EN-US">#7  0x000000000053c134 in ngx_rtmp_live_av (s=0x47d6eb0, h=0x47cee70, in=0x402e830) at ../nginx-rtmp-module/ngx_rtmp_live_module.c:773</span></p>
<p class="MsoNormal"><span lang="EN-US">#8  0x000000000053124a in ngx_rtmp_receive_message (s=0x47d6eb0, h=0x47cee70, in=0x402e830) at ../nginx-rtmp-module/ngx_rtmp_handler.c:875</span></p>
<p class="MsoNormal"><span lang="EN-US">#9  0x000000000053200e in ngx_rtmp_recv (rev=<optimized out>) at ../nginx-rtmp-module/ngx_rtmp_handler.c:486</span></p>
<p class="MsoNormal"><span lang="EN-US">#10 0x000000000048e148 in ngx_epoll_process_events (cycle=0x4470dd0, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:901</span></p>
<p class="MsoNormal"><span lang="EN-US">#11 0x0000000000483747 in ngx_process_events_and_timers (cycle=0x4470dd0) at src/event/ngx_event.c:248</span></p>
<p class="MsoNormal"><span lang="EN-US">#12 0x000000000048bc23 in ngx_worker_process_cycle (cycle=0x4470dd0, data=<optimized out>) at src/os/unix/ngx_process_cycle.c:721</span></p>
<p class="MsoNormal"><span lang="EN-US">#13 0x000000000048a310 in ngx_spawn_process (cycle=0x4470dd0, proc=0x48bb90 <ngx_worker_process_cycle>, data=0x0, name=0x7503bd "worker process", respawn=2)</span></p>
<p class="MsoNormal"><span lang="EN-US">    at src/os/unix/ngx_process.c:199</span></p>
<p class="MsoNormal"><span lang="EN-US">#14 0x000000000048c6ab in ngx_reap_children (cycle=0x4470dd0) at src/os/unix/ngx_process_cycle.c:598</span></p>
<p class="MsoNormal"><span lang="EN-US">#15 ngx_master_process_cycle (cycle=0x4470dd0) at src/os/unix/ngx_process_cycle.c:174</span></p>
<p class="MsoNormal"><span lang="EN-US">#16 0x0000000000463f1c in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:383</span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">(gdb) info local</span></p>
<p class="MsoNormal"><span lang="EN-US">args = {{gp_offset = 48, fp_offset = 48, overflow_arg_area = 0x7ffdf20c69d8, reg_save_area = 0x7ffdf20c68e0}}</span></p>
<p class="MsoNormal"><span lang="EN-US">p = 0x7ffdf20c6124 ""</span></p>
<p class="MsoNormal"><span lang="EN-US">last = 0x7ffdf20c68c0 "0"</span></p>
<p class="MsoNormal"><span lang="EN-US">msg = 0x7ffdf20c60fa "posix_memalign: 0000000003EBB6C0:4096 @16\n"</span></p>
<p class="MsoNormal"><span lang="EN-US">n = <optimized out></span></p>
<p class="MsoNormal"><span lang="EN-US">wrote_stderr = <optimized out></span></p>
<p class="MsoNormal"><span lang="EN-US">debug_connection = <optimized out></span></p>
<p class="MsoNormal"><span lang="EN-US">errstr = "2022/11/07 16:31:26 [debug] 6668#0: *15946442335153920488 posix_memalign: 0000000003EBB6C0:4096 @16\n", '\000' <repeats 1947 times></span></p>
<p class="MsoNormal"><span lang="EN-US">````</span><span lang="EN-US" style="font-size:12.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">从<span lang="EN-US"> Windows </span>版<span lang="EN-US"><a href="https://go.microsoft.com/fwlink/?LinkId=550986"><span lang="EN-US"><span lang="EN-US">邮件</span></span></a></span>发送</p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;font-family:SimSun"><o:p> </o:p></span></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>发件人:</b> nginx <nginx-bounces@nginx.org> 代表 Sergey A. Osokin <osa@freebsd.org.ru><br>
<b>发送时间:</b> Tuesday, August 31, 2021 6:30:00 AM<br>
<b>收件人:</b> nginx@nginx.org <nginx@nginx.org><br>
<b>主题:</b> Re: Segmentation fault sometimes</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi there,<br>
<br>
is it reproducible without the third-party module?<br>
Could you try to reproduce the issue with the recent version from<br>
the stable branch, i.e. 1.20.1.<br>
<br>
Thanks.<br>
<br>
-- <br>
Sergey Osokin<br>
<br>
On Tue, Aug 24, 2021 at 08:37:47AM +0000, 王 静凯 wrote:<br>
> Hi,<br>
> <br>
> The ‘nginx -V’ info:<br>
> ````<br>
> nginx version: nginx/1.20.0<br>
> built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)<br>
> built with OpenSSL 1.1.1k  25 Mar 2021<br>
> TLS SNI support enabled<br>
> configure arguments: --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --error-log-path=/usr/local/nginx/logs/error.log --http-client-body-temp-path=/usr/local/nginx/client_temp
 --http-proxy-temp-path=/usr/local/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/nginx/scgi_temp --user=nginx --group=nginx --add-module=../fastdfs-nginx-module-1.22/src
 --add-module=../nginx-client-module --add-module=../nginx-multiport-module --add-module=../nginx-toolkit-module --add-module=../nginx-rtmp-module --add-module=../nginx-ts-module --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module
 --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module
 --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-openssl=../openssl-1.1.1k --with-pcre=../pcre-8.44
 --with-zlib=../zlib-1.2.11 --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-debug<br>
> ````<br>
> <br>
> The nginx compile with ‘https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpingostack%2Fpingos%25E2%2580%2599&amp;data=04%7C01%7C%7C2b3c1ee12ca94586388f08d96c05c78c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637659594355757137%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=99WVAQjYt3ZNlu9omy4mNJfm6gaqa15KMDXjUKV%2BaQo%3D&amp;reserved=0
 project and ‘https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhappyfish100%2Ffastdfs-nginx-module%25E2%2580%2599&amp;data=04%7C01%7C%7C2b3c1ee12ca94586388f08d96c05c78c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637659594355757137%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=lNEJOyFUwjKytPl1Xo4f182Z6vR1QKa3Va6O8JFatzw%3D&amp;reserved=0
 project.<br>
> <br>
> Sometimes it crashed serveral times continuously. But then it works for a long time normally.<br>
> <br>
> It shows<br>
> ````<br>
> #0  0x0000006e6f697461 in ?? ()<br>
> #1  0x0000000000464ed6 in ngx_log_error_core (level=level@entry=8, log=log@entry=0x3d27608, err=err@entry=0, fmt=fmt@entry=0x7a2816 "posix_memalign: %p:%uz @%uz")<br>
>     at src/core/ngx_log.c:168<br>
> #2  0x000000000048ab24 in ngx_memalign (alignment=alignment@entry=16, size=size@entry=4096, log=0x3d27608) at src/os/unix/ngx_alloc.c:65<br>
> #3  0x0000000000465aa2 in ngx_palloc_block (pool=0x3bf9b50, size=72) at src/core/ngx_palloc.c:186<br>
> #4  0x000000000046608e in ngx_pcalloc (pool=<optimized out>, size=size@entry=72) at src/core/ngx_palloc.c:302<br>
> #5  0x0000000000582c73 in ngx_rtmp_shared_alloc_frame (size=4096, cl=cl@entry=0x3d3c960, mandatory=mandatory@entry=0)<br>
>     at ../nginx-rtmp-module/ngx_rtmp_shared_module.c:225<br>
> #6  0x00000000005689e9 in ngx_rtmp_live_av (s=0x3fb8bf0, h=0x3bb1290, in=0x3d3c960) at ../nginx-rtmp-module/ngx_rtmp_live_module.c:773<br>
> #7  0x000000000055d1d8 in ngx_rtmp_receive_message (s=s@entry=0x3fb8bf0, h=h@entry=0x3bb1290, in=in@entry=0x3d3c960)<br>
>     at ../nginx-rtmp-module/ngx_rtmp_handler.c:874<br>
> #8  0x000000000055d991 in ngx_rtmp_recv (rev=<optimized out>) at ../nginx-rtmp-module/ngx_rtmp_handler.c:486<br>
> #9  0x0000000000491f11 in ngx_epoll_process_events (cycle=0x43bde90, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:901<br>
> #10 0x00000000004861d6 in ngx_process_events_and_timers (cycle=cycle@entry=0x43bde90) at src/event/ngx_event.c:247<br>
> #11 0x000000000048f9e5 in ngx_worker_process_cycle (cycle=cycle@entry=0x43bde90, data=data@entry=0x0) at src/os/unix/ngx_process_cycle.c:719<br>
> #12 0x000000000048df5f in ngx_spawn_process (cycle=cycle@entry=0x43bde90, proc=proc@entry=0x48f990 <ngx_worker_process_cycle>, data=data@entry=0x0,<br>
>     name=name@entry=0x7a3486 "worker process", respawn=respawn@entry=-4) at src/os/unix/ngx_process.c:199<br>
> ````<br>
> Or<br>
> <br>
> ````<br>
> (gdb) bt<br>
> #0  0x0000000000464f13 in ngx_write_fd (n=100, buf=0x7ffd8d7ef2f0, fd=<error reading variable: Cannot access memory at address 0x66736e6172740064>)<br>
>     at src/os/unix/ngx_files.h:147<br>
> #1  ngx_log_error_core (level=level@entry=8, log=log@entry=0x3b94c58, err=err@entry=0, fmt=fmt@entry=0x7a2816 "posix_memalign: %p:%uz @%uz")<br>
>     at src/core/ngx_log.c:183<br>
> #2  0x000000000048ab24 in ngx_memalign (alignment=alignment@entry=16, size=size@entry=4096, log=0x3b94c58) at src/os/unix/ngx_alloc.c:65<br>
> #3  0x0000000000465aa2 in ngx_palloc_block (pool=0x3c3c0b0, size=96) at src/core/ngx_palloc.c:186<br>
> #4  0x000000000046608e in ngx_pcalloc (pool=<optimized out>, size=size@entry=96) at src/core/ngx_palloc.c:302<br>
> ````<br>
> <br>
> In gdb<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
nginx@nginx.org<br>
<a href="https://apac01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.nginx.org%2Fmailman%2Flistinfo%2Fnginx&amp;data=04%7C01%7C%7C2b3c1ee12ca94586388f08d96c05c78c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637659594355757137%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=BHHjltjAbdoSBaw2Sv8b2H6UAle%2BoALK57ZQ9F5dCIA%3D&amp;reserved=0">https://apac01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.nginx.org%2Fmailman%2Flistinfo%2Fnginx&amp;data=04%7C01%7C%7C2b3c1ee12ca94586388f08d96c05c78c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637659594355757137%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=BHHjltjAbdoSBaw2Sv8b2H6UAle%2BoALK57ZQ9F5dCIA%3D&amp;reserved=0</a></div>
</span></font></div>
</body>
</html>