现象:
1 fastcgi load的http服务,在每次有请求打过来时,都会出现segment fault异常退出
dmesg查看如下:
[2413269.761926] initSession[22470]: segfault at 67581fe9 ip 00000000080958cf sp 00000000ffee4360 error 6 in initSession[8048000+64000]
[2413329.775804] initSession[22551]: segfault at 66ca8d09 ip 00000000080958cf sp 00000000ffc78080 error 6 in initSession[8048000+64000]
[2413389.790086] initSession[22638]: segfault at 664d3d49 ip 00000000080958cf sp 00000000ffd510c0 error 6 in initSession[8048000+64000]
[2413449.803824] initSession[22735]: segfault at 6665d4b9 ip 00000000080958cf sp 00000000ff85d830 error 6 in initSession[8048000+64000]
[2413509.817405] initSession[22823]: segfault at 66a51d49 ip 00000000080958cf sp 00000000ff8ca0c0 error 6 in initSession[8048000+64000]
[2413569.831553] initSession[22907]: segfault at 6808eb09 ip 00000000080958cf sp 00000000ffbf9e80 error 6 in initSession[8048000+64000]
[2413629.844877] initSession[22991]: segfault at 676ac3d9 ip 00000000080958cf sp 00000000ffb14750 error 6 in initSession[8048000+64000]
[2413689.858531] initSession[23104]: segfault at 6789f479 ip 00000000080958cf sp 00000000ffbf97f0 error 6 in initSession[8048000+64000]
2 原因:
应用服务每次有请求时,都会调用了年月日时分秒等参数来记录日志,而在默认的 tengine/conf/fastcgi_params又缺省这些参数配置,导致每次返回NULL值进行操作,程序异常退出
3 解决方法:
在fastcgi_params文件里,添加如下参数:
fastcgi_param YEAR $year;
fastcgi_param MONTH $month;
fastcgi_param DAY $day;
fastcgi_param HOUR $hour;
fastcgi_param MINUTE $minute;
fastcgi_param SECOND $second;