Bug 220942 - www/mod_php56 opcache makes httpd segfault using phpPgAdmin 5.1_3
Summary: www/mod_php56 opcache makes httpd segfault using phpPgAdmin 5.1_3
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-23 10:56 UTC by P. Chevalier
Modified: 2017-07-28 10:16 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description P. Chevalier 2017-07-23 10:56:58 UTC
When browsing databases with phpPgAdmin, httpd randomly crashes, with :

[core:notice] [pid 778] AH00052: child pid 803 exit signal Segmentation fault (11)

Using mpm_prefork or mpm_itk, the result is the same.

It happened on random pages, after clicking around. Mostly coming back to a page already visited.

After some fiddling, I managed to get a core of httpd and a backtrace :

(gdb) bt
#0  0x000000081f15c000 in ?? ()
#1  0x000000080a20a08d in accel_shutdown () from /usr/local/lib/php/20131226/opcache.so
#2  0x000000080a206efb in validate_timestamp_and_record () from /usr/local/lib/php/20131226/opcache.so
#3  0x000000080a207d14 in persistent_compile_file () from /usr/local/lib/php/20131226/opcache.so
#4  0x0000000808841772 in zend_execute_scripts () from /usr/local/libexec/apache24/libphp5.so
#5  0x00000008087e39d9 in php_execute_script () from /usr/local/libexec/apache24/libphp5.so
#6  0x00000008088cd5bb in zend_get_zval_ptr_ptr () from /usr/local/libexec/apache24/libphp5.so
#7  0x00000000004449f6 in ap_pass_brigade (next=0x81f15bcb0, bb=0x81f159f80) at util_filter.c:590
#8  0x000000000045c053 in default_handler (r=0x81f1580a0) at core.c:4746
#9  0x000000000046b4b2 in ap_run_handler (r=0x81f1580a0) at config.c:170
#10 0x000000000046bd0c in ap_invoke_handler (r=0x81f1580a0) at config.c:434
#11 0x000000000048fcbc in ap_process_async_request (r=0x81f1580a0) at http_request.c:436
#12 0x000000000048fd91 in ap_process_request (r=0x81f1580a0) at http_request.c:471
#13 0x000000000048b0d0 in ap_process_http_sync_connection (c=0x81aef5290) at http_core.c:210
#14 0x000000000048ac6d in ap_process_http_connection (c=0x81aef5290) at http_core.c:251
#15 0x000000000047c122 in ap_run_process_connection (c=0x81aef5290) at connection.c:42
#16 0x0000000809c91c64 in itk_fork_process (c=0x81aef5290) at mpm_itk.c:220
#17 0x000000000047c122 in ap_run_process_connection (c=0x81aef5290) at connection.c:42
#18 0x000000000047c905 in ap_process_connection (c=0x81aef5290, csd=0x81aef50a0) at connection.c:226
#19 0x000000080607222a in child_main (child_num_arg=0, child_bucket=0) at prefork.c:612
#20 0x00000008060712a3 in make_child (s=0x802454110, slot=0, bucket=0) at prefork.c:706
#21 0x000000080607136d in startup_children (number_to_start=5) at prefork.c:725
#22 0x0000000806070288 in prefork_run (_pconf=0x802429028, plog=0x802458028, s=0x802454110) at prefork.c:894
#23 0x0000000000441402 in ap_run_mpm (pconf=0x802429028, plog=0x802458028, s=0x802454110) at mpm_common.c:94
#24 0x0000000000434f30 in main (argc=1, argv=0x7fffffffed28) at main.c:792


It pointed to opcache.so, so in php.ini I put opcache.enable=0

Problem disappeared.

I would like to get the opcache back, eventually.
Comment 1 P. Chevalier 2017-07-23 11:54:19 UTC
Added debug symbols to opcache. I narrowed it down to the schemas.php page :

(gdb) bt
#0  0x000000081f35c000 in ?? ()
#1  0x000000080a40a772 in zend_get_file_handle_timestamp (file_handle=0x7fffffffe1a8, size=0x0) at ZendAccelerator.c:830
#2  0x000000080a4092b1 in compile_and_cache_file (file_handle=0x7fffffffe1a8, type=8, key=0x80a636d54 "/usr/local/www/phpPgAdmin/schemas.php", key_length=37, op_array_p=0x7fffffffc690,
    from_shared_memory=0x7fffffffc6b0) at ZendAccelerator.c:1367
#3  0x000000080a408910 in persistent_compile_file (file_handle=0x7fffffffe1a8, type=8) at ZendAccelerator.c:1680
#4  0x000000080914cfa0 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:1333
#5  0x00000008090ad1c4 in php_execute_script (primary_file=0x7fffffffe1a8) at main.c:2613
#6  0x0000000809292011 in php_output_filter (f=0x81f35bcb0, bb=0x81f359f80) at sapi_apache2.c:548
#7  0x00000000004449f6 in ap_pass_brigade (next=0x81f35bcb0, bb=0x81f359f80) at util_filter.c:590
#8  0x000000000045c053 in default_handler (r=0x81f3580a0) at core.c:4746
#9  0x000000000046b4b2 in ap_run_handler (r=0x81f3580a0) at config.c:170
#10 0x000000000046bd0c in ap_invoke_handler (r=0x81f3580a0) at config.c:434
#11 0x000000000048fcbc in ap_process_async_request (r=0x81f3580a0) at http_request.c:436
#12 0x000000000048fd91 in ap_process_request (r=0x81f3580a0) at http_request.c:471
#13 0x000000000048b0d0 in ap_process_http_sync_connection (c=0x81b0f5290) at http_core.c:210
#14 0x000000000048ac6d in ap_process_http_connection (c=0x81b0f5290) at http_core.c:251
#15 0x000000000047c122 in ap_run_process_connection (c=0x81b0f5290) at connection.c:42
#16 0x0000000809e35c64 in itk_fork_process (c=0x81b0f5290) at mpm_itk.c:220
#17 0x000000000047c122 in ap_run_process_connection (c=0x81b0f5290) at connection.c:42
#18 0x000000000047c905 in ap_process_connection (c=0x81b0f5290, csd=0x81b0f50a0) at connection.c:226
#19 0x000000080607222a in child_main (child_num_arg=2, child_bucket=0) at prefork.c:612
#20 0x00000008060712a3 in make_child (s=0x802454110, slot=2, bucket=0) at prefork.c:706
#21 0x000000080607136d in startup_children (number_to_start=3) at prefork.c:725
#22 0x0000000806070288 in prefork_run (_pconf=0x802429028, plog=0x802458028, s=0x802454110) at prefork.c:894
#23 0x0000000000441402 in ap_run_mpm (pconf=0x802429028, plog=0x802458028, s=0x802454110) at mpm_common.c:94
#24 0x0000000000434f30 in main (argc=1, argv=0x7fffffffed28) at main.c:792

This page makes httpd crash consistently. More often than not.
Comment 2 P. Chevalier 2017-07-23 12:43:17 UTC
Page seems to be random. Depending on the cache content I guess. I changed browser to test with chrome and it started to crash on different pages.

Tried with roundcube : doesn't crash at all. No idea where the problem comes from and if it happens only with phpPgAdmin.

I'll stay with opcache disabled for now.
Comment 3 P. Chevalier 2017-07-23 12:50:04 UTC
Changing opcache.validate_timestamps to 0 in php.ini stops the crash.

It can only be temporary because if the users change their pages, php will not notice it and keep using the cache.
Comment 4 P. Chevalier 2017-07-28 10:15:40 UTC
I upgraded my system to FreeBSD 11.1-RELEASE and can't reproduce it anymore.

Since I recompiled all ports, I'm not sure what "solved" the problem, or if it won't come back.

If that's the case, I will probably open a bug at php.net, since it seems linked to php and not specifically to FreeBSD.