Bug 243100 - lang/php74: php-fpm exited on signal 10
Summary: lang/php74: php-fpm exited on signal 10
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Torsten Zuehlsdorff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-05 00:22 UTC by iron.udjin
Modified: 2021-04-06 18:37 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tz)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2020-01-05 00:22:22 UTC
Hello,

OS: FreeBSD 12.1-STABLE r355967
php74-7.4.1

Sometimes in dmesg appear messages like this:

pid 2863 (php-fpm), jid 0, uid 80: exited on signal 10 (core dumped)

Here is backtrace:

#0  0x0000000800dfd75a in memcpy () from /lib/libc.so.7
#1  0x00000000007d69f3 in php_output_handler_append (handler=0x801859000, buf=0x7fffffffabe8) at main/output.c:895
#2  0x00000000007d34db in php_output_handler_op (handler=0x801859000, context=0x7fffffffabe0) at main/output.c:943
#3  0x00000000007d3267 in php_output_op (op=0, str=0x80c418000 "", len=4135) at main/output.c:1059
#4  0x00000000007d3114 in php_output_write (str=0x80c418000 "", len=4135) at main/output.c:254
#5  0x00000000006f37f1 in php_stream_output_write (stream=0x80cf22900, buf=0x80c418000 "", count=4135) at ext/standard/php_fopen_wrapper.c:36
#6  0x00000000007db97b in _php_stream_write_buffer (stream=0x80cf22900, buf=0x80c418000 "", count=4135) at main/streams/streams.c:1127
#7  0x00000000007da928 in _php_stream_write (stream=0x80cf22900,
    buf=0x80c408000 "<?xml version=\"1.0\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\"><channel><title>&#x41D;&#x412;</title><description>&#x413;&#x43B;&#x430;&#x432;&#x43D;&#x44B;&#x435; &#x43D;&#x43E;&#x"..., count=69671)
    at main/streams/streams.c:1254
#8  0x00000000007dccf1 in _php_stream_copy_to_stream_ex (src=0x80cf22800, dest=0x80cf22900, maxlen=0, len=0x7fffffffcf90, __php_stream_call_depth=0, __zend_filename=0x264462 "/tmpfs/usr/ports/lang/php74/work/php-7.4.1/ext/standard/streamsfuncs.c",
    __zend_lineno=489, __zend_orig_filename=0x0, __zend_orig_lineno=0) at main/streams/streams.c:1568
#9  0x0000000000714509 in zif_stream_copy_to_stream (execute_data=0x8018151c0, return_value=0x7fffffffd008) at ext/standard/streamsfuncs.c:489
#10 0x000000000094d7fc in ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x801815130) at Zend/zend_vm_execute.h:1441
#11 0x00000000008e1c1b in execute_ex (ex=0x801815020) at Zend/zend_vm_execute.h:53379
#12 0x00000000008e1e1e in zend_execute (op_array=0x801865000, return_value=0x0) at Zend/zend_vm_execute.h:57664
#13 0x000000000086b518 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at Zend/zend.c:1663
#14 0x00000000007b3e9e in php_execute_script (primary_file=0x7fffffffeae0) at main/main.c:2619
#15 0x0000000000993d9a in main (argc=1, argv=0x7fffffffed30) at sapi/fpm/fpm/fpm_main.c:1940

Is there a way to fix it?

Thank you!
Comment 1 Torsten Zuehlsdorff freebsd_committer 2020-02-09 22:30:17 UTC
Hi, i am sorry for the late response. I tried to reproduce this issue but failed. Does it still occur with 7.4.2?

After some investigation and checks i would judge, that this is an PHP issue. In PHP 7.1 was an issue like this based on strange chars in the stream, which also let to segfaults. I would suggest that you wrote a PHP issue if the issue still persists.

Greetings,
Torsten
Comment 2 iron.udjin 2020-02-09 22:59:13 UTC
(In reply to Torsten Zuehlsdorff from comment #1)

Yes, it still occur with 7.4.2:

# uptime
 0:56  up 17 days, 40 mins, 2 users, load averages: 6,58 6,12 5,98

# php -v
PHP 7.4.2 (cli) (built: Jan 25 2020 05:57:13) ( NTS DEBUG )

# dmesg | grep php-fpm | grep 'exited on signal 10' | wc -l
    4446
Comment 3 Fred Condo 2021-03-04 17:36:16 UTC
This is also happening with PHP 7.3.27
Comment 4 iron.udjin 2021-03-05 07:12:54 UTC
I've upgraded my servers to 13-STABLE and don't see the errors anymore.
Comment 5 Fred Condo 2021-03-25 17:13:45 UTC
I've tested this on 11.4-STABLE, 12.2-STABLE, and 13.0-BETA4. On 11.4, PHP throws signal 11; on 13.0 and 12.2, it throws this sequence repeatedly:

Mar 25 16:55:45 php4 kernel: vm_fault: pager read error, pid 85145 (php-fpm)
Mar 25 16:55:45 php4 kernel: pid 85145 (php-fpm), jid 0, uid 80: exited on signal 10

Only php-fpm processes do this. No other processes trigger vm_fault or exit on signal 10.

The environment is php-fpm running behind nginx. The PHP servers mount filesystems from an NFS server. All the servers are running (except for experimentation) FreeBSD 12.2-RELEASE-p4 and PHP 7.3.27 (which is slightly off-topic, I know).

I replaced one of the PHP servers with an Ubuntu server running the same version of PHP and mounting the same filesystems over NFS. It does not exhibit this crashing behavior.

All the servers in question are VPS at Vultr.
Comment 6 Fred Condo 2021-04-06 18:37:23 UTC
Update: this seems to be a PHP-FPM bug. The Linux servers I mentioned in my previous comment are now also throwing SIGBUS.