Bug 14390 - php-apc segfaults with Owncloud+apache ; OK using php-opcache instead
Summary: php-apc segfaults with Owncloud+apache ; OK using php-opcache instead
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Oden Eriksson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-27 18:23 CET by Morgan Leijström
Modified: 2015-04-21 15:17 CEST (History)
3 users (show)

See Also:
Source RPM: owncloud-7.0.2-4.mga5.src.rpm
CVE:
Status comment:


Attachments

Description Morgan Leijström 2014-10-27 18:23:45 CET
Thank you for packaging Owncloud - i will need it :)

Description of problem:
It seem to just crash; on two connection attempts from firefox to http://127.0.0.1/owncloud/ on same machine i get in /var/log/httpd/error_log :
[Mon Oct 27 17:46:40.596959 2014] [core:notice] [pid 2484] AH00052: child pid 7368 exit signal Segmentation fault (11)
[Mon Oct 27 17:47:01.624061 2014] [core:notice] [pid 2484] AH00052: child pid 8560 exit signal Segmentation fault (11)
...and firefox say the connection got broken during page fetch.

History:
The machine is my file server and Owncloud have been running just as a test when it was mga4, did not use it much and a couple months ago a couple clients (laptops of mine) clould not connect.  I read it may be some weird problem other users have experienced so i decided to just wait for mga5beta, and so i yesterday changed repos and upgraded.

Tried:
I also tried uninstalling owncloud, deleting the owncloud data directory and /usr/share/owncloud then installing owncloud.  And rebooting.

Strangely, /etc/httpd/conf/sites.d/owncloud.conf (listed in rpm description) does not exist.

Everything else i use on the machine is working, also the urpmi-proxy running on same install.

Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2014-10-27 21:58:30 CET
Thanks for the report.  This would seem to be a PHP issue.  If you can dig in any further into the crash, that would be helpful.  Are there any other logs (such as in the journal) that might be relevant?  I've also tried following some debugging steps for apache/php crashes online before (on Mageia 4) and had no luck, but maybe you'd have better luck than I did.

CC: (none) => oe

Comment 2 Morgan Leijström 2014-10-27 22:03:41 CET
Any tip on how to search where?
Comment 3 Morgan Leijström 2014-10-27 22:08:45 CET
Maybe you know how to increase logging on owncloud/PHP/Apache?
Comment 4 Morgan Leijström 2014-10-27 23:28:18 CET
Inspired by http://forum.owncloud.org/viewtopic.php?f=26&t=20985 ,
I did the same (adjusted apache name to mageia "httpd"):

# gdb /usr/sbin/httpd
GNU gdb (GDB) 7.8-6.mga5 (Mageia release 5)
-snip-
Missing separate debuginfos, use: debuginfo-install apache-2.4.10-6.mga5.x86_64
(gdb) r -X
Starting program: /usr/sbin/httpd -X
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe1f2feab in apc_new_interned_string () from /usr/lib64/php/extensions/apc-mmap.so

(gdb) bt
#0  0x00007fffe1f2feab in apc_new_interned_string () from /usr/lib64/php/extensions/apc-mmap.so
#1  0x00007fffe1f1993c in my_copy_hashtable_ex () from /usr/lib64/php/extensions/apc-mmap.so
#2  0x00007fffe1f19cb8 in my_copy_zval () from /usr/lib64/php/extensions/apc-mmap.so
#3  0x00007fffe1f231f6 in my_copy_zval_ptr () from /usr/lib64/php/extensions/apc-mmap.so
#4  0x00007fffe1f2596b in my_copy_class_entry () from /usr/lib64/php/extensions/apc-mmap.so
#5  0x00007fffe1f25cf9 in apc_copy_new_classes () from /usr/lib64/php/extensions/apc-mmap.so
#6  0x00007fffe1f27c60 in apc_compile_cache_entry () from /usr/lib64/php/extensions/apc-mmap.so
#7  0x00007fffe1f28821 in my_compile_file () from /usr/lib64/php/extensions/apc-mmap.so
#8  0x00007fffed67b324 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER () from /usr/lib64/libphp5_common.so.5
#9  0x00007fffed600c10 in execute_ex () from /usr/lib64/libphp5_common.so.5
#10 0x00007fffe1ab1f8b in suhosin_execute_ex () from /usr/lib64/php/extensions/suhosin.so
#11 0x00007fffed5af83a in zend_call_function () from /usr/lib64/libphp5_common.so.5
#12 0x00007fffed5db14c in zend_call_method () from /usr/lib64/libphp5_common.so.5
#13 0x00007fffed4b50fa in zif_spl_autoload_call () from /usr/lib64/libphp5_common.so.5
#14 0x00007fffe1ab14b0 in suhosin_execute_internal () from /usr/lib64/php/extensions/suhosin.so
#15 0x00007fffed5af979 in zend_call_function () from /usr/lib64/libphp5_common.so.5
#16 0x00007fffed5b0169 in zend_lookup_class_ex () from /usr/lib64/libphp5_common.so.5
#17 0x00007fffed5b08f3 in zend_fetch_class_by_name () from /usr/lib64/libphp5_common.so.5
#18 0x00007fffed611e49 in zend_fetch_var_address_helper_SPEC_CONST_CONST () from /usr/lib64/libphp5_common.so.5
#19 0x00007fffed600c10 in execute_ex () from /usr/lib64/libphp5_common.so.5
#20 0x00007fffe1ab1f8b in suhosin_execute_ex () from /usr/lib64/php/extensions/suhosin.so
#21 0x00007fffed67d25e in zend_do_fcall_common_helper_SPEC () from /usr/lib64/libphp5_common.so.5
#22 0x00007fffed600c10 in execute_ex () from /usr/lib64/libphp5_common.so.5
#23 0x00007fffe1ab1f8b in suhosin_execute_ex () from /usr/lib64/php/extensions/suhosin.so
#24 0x00007fffed67c478 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER () from /usr/lib64/libphp5_common.so.5
#25 0x00007fffed600c10 in execute_ex () from /usr/lib64/libphp5_common.so.5
#26 0x00007fffe1ab1f8b in suhosin_execute_ex () from /usr/lib64/php/extensions/suhosin.so
#27 0x00007fffed5c1b60 in zend_execute_scripts () from /usr/lib64/libphp5_common.so.5
#28 0x00007fffed556f2b in php_execute_script () from /usr/lib64/libphp5_common.so.5
#29 0x00007fffed9f9482 in php_handler () from /etc/httpd/modules/mod_php.so
#30 0x0000555555599728 in ap_run_handler ()
#31 0x0000555555599ef9 in ap_invoke_handler ()
#32 0x00005555555b1132 in ap_process_async_request ()
#33 0x00005555555b12f4 in ap_process_request ()
#34 0x00005555555ad5b2 in ap_process_http_connection ()
#35 0x00005555555a42f8 in ap_run_process_connection ()
#36 0x00007fffede0897a in child_main () from /etc/httpd/modules/mod_mpm_prefork.so
#37 0x00007fffede08bab in make_child () from /etc/httpd/modules/mod_mpm_prefork.so
#38 0x00007fffede09965 in prefork_run () from /etc/httpd/modules/mod_mpm_prefork.so
#39 0x000055555557af5e in ap_run_mpm ()
#40 0x0000555555573193 in main ()
(gdb)

Also worth a read: https://github.com/owncloud/core/issues/4603
Comment 5 Morgan Leijström 2014-10-27 23:41:30 CET
just to be clear, i stopped httpd service first, and the segmentation fault did not occour until i used firefox to try http://127.0.0.1/owncloud
Comment 6 David Walser 2014-10-28 13:06:00 CET
OK, so the crash is in php-apc.  Thanks.

As a workaround, you could try configuring your server to use php-opcache instead.
Comment 7 Morgan Leijström 2014-10-28 14:14:58 CET
Configuring apache is something i have never done. Not my cup of tea. But if you tell me how or point me to a description i will try :)
Comment 8 Morgan Leijström 2014-10-28 17:16:14 CET
I just installed the cauldron php-opcache, and it removed php-apc.
I did not do anything else except rebooted, and it works! :)
(Owncloud shows up in firefox, have urgent tings to do, must test later)

In my /etc/php.ini, all opcache settings are commented out - also the enable setting.  Anyhow, php -v responds it use Zend OpCache.

Maybe it is time mageia should default to opcache instead of apc?
Do you know if we have some cache monitoring mojo for opcache packaged?
Morgan Leijström 2014-10-28 17:18:22 CET

Summary: Owncloud 7.0.2-4.mga5 (server) segmentation fault => php-apc segfaults with Owncloud+apache ; OK using php-opcache instead

Comment 9 Morgan Leijström 2014-10-29 13:09:16 CET
Client also segfaults... bug 14408
Comment 10 David Walser 2015-01-07 01:22:59 CET
I can confirm this, php-apc crashes with Moodle as well in current Cauldron.

php-opcache works, but it continues to have the bug where reloading the httpd service makes php-opcache kill it and you have to restart it.

CC: (none) => luigiwalser, thomas
Assignee: bugsquad => oe

Comment 11 Thomas Spuhler 2015-01-07 01:30:31 CET
I added a Conflicts: php-apc for Roundcubemail and should do the same for kolab-webadmin because of segfaults

I believe this started after upgrading php early in the mga5 devl cycle.
I do not see any posting in this regard on the kolab-user mailing list, so it may be a mga specific issue.
Well we use a beta version of php-apc and the upstream development is very slow.
If there is a replacement, it would be great.
Comment 12 David Walser 2015-01-07 01:39:21 CET
I don't think adding conflicts for php-apc is the solution.  Either we should find a fix for it (maybe there's one upstream?) or drop it if it can't support PHP 5.6.

It would be nice to have a solution that works without any obvious issues.  php-opcache seems fast, but the reload issue causes problems every time there's an update for php.
Comment 13 Oden Eriksson 2015-01-07 12:04:52 CET
Looked at fedora and adapted.

php-apc is dead upstream it seems. No new release for the past two years. No activity in GIT.

A new package "php-apcu" has been uploaded and submitted that replaces php-apc.
Comment 14 David Walser 2015-01-07 17:14:28 CET
Thanks Oden!  I've confirmed it works great with Moodle.

Thomas, you should remove any conflicts on php-apc you added anywhere.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 15 Morgan Leijström 2015-04-21 15:17:26 CEST
...and remove conflicts php-apcu <-> php-opcache i presume.   Bug 15743

Note You need to log in before you can comment on or make changes to this bug.