Page MenuHomePhabricator

Wikidiff2 makes apache2 crash
Open, Needs TriagePublic

Description

When I call this URL : https://MyMediawikiDoma.in/index.php?title=MyArticle&type=revision&diff=3441&oldid=3424

Apache2 crashes with this backtrace:

(gdb) where
#0 0x00007fe6039edc8a in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
#1 0x00007fe6039ee6eb in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
#2 0x00007fe6039eea96 in zend_parse_parameters () from target:/usr/lib/apache2/modules/libphp7.2.so
#3 0x00007fe5f1bdf268 in zif_wikidiff2_do_diff(_zend_execute_data*, _zval_struct*) () from target:/usr/lib/php/20170718/wikidiff2.so
#4 0x00007fe603a8f3fb in execute_ex () from target:/usr/lib/apache2/modules/libphp7.2.so
#5 0x00007fe603a97267 in zend_execute () from target:/usr/lib/apache2/modules/libphp7.2.so
#6 0x00007fe6039e59f2 in zend_execute_scripts () from target:/usr/lib/apache2/modules/libphp7.2.so
#7 0x00007fe603981450 in php_execute_script () from target:/usr/lib/apache2/modules/libphp7.2.so
#8 0x00007fe603a99422 in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
#9 0x000055906ce68cc0 in ap_run_handler ()
#10 0x000055906ce6923d in ap_invoke_handler ()
#11 0x000055906ce80c7b in ap_process_async_request ()
#12 0x000055906ce80e50 in ap_process_request ()
#13 0x000055906ce7d21d in ?? ()
#14 0x000055906ce72ad0 in ap_run_process_connection ()
#15 0x00007fe604004831 in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#16 0x00007fe604004b34 in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#17 0x00007fe60400557e in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#18 0x000055906ce4c28e in ap_run_mpm ()
#19 0x000055906ce44b2b in main ()

The server runs Ubuntu 18.04 and Mediawiki from https://launchpad.net/~legoktm/+archive/ubuntu/mediawiki-lts/

If I uninstall wikidiff2 with apt remove php-wikidiff2. It is running fine.

Event Timeline

Jona created this task.Dec 12 2019, 8:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 12 2019, 8:57 PM

Hi @Jona, thanks for taking the time to report this. This means you are running MediaWiki 1:1.31.5-1ppa1~bionic1 ?

When I call this URL : https://MyMediawikiDoma.in/index.php?title=MyArticle&type=revision&diff=3441&oldid=3424

Cannot reach that page - I guess that is not a public installation?

Can you please install corresponding debug packages to get a better stacktrace of the crash? Currently the stacktrace only shows the name of the compiled shared object (e.g. libphp7.2.so or wikidiff2.so). With debug packages it would show the function name, the name of the actual source code file and the line number. Thanks!

Jona added a comment.Dec 13 2019, 9:16 AM

Hi @Aklapper , thank you for taking time to look for a solution.

This means you are running MediaWiki 1:1.31.5-1ppa1~bionic1 ?

Yes

I anonymized the URL. I am very cautious when publishing things online. The real URL is :
https://wiki.makilab.org/index.php?title=Accueil&type=revision&diff=3441&oldid=3424

Do you want me to install php7.2-phpdbg ? Something more ?

Thank you

I don't know how each debug package on Debian is called. Whatever is needed to not see only libphp7.2.so or wikidiff2.so in the stacktrace :)

Jona added a comment.Dec 15 2019, 10:22 AM

I have used wikidiff2 from the source (wikidiff2-1.10.0.tar.gz) and I don't have the crash anymore. I will see if I can install the same setting on a test server.

Jona added a comment.Dec 18 2019, 9:14 PM

I was able to reproduce the issue on a test server (with wikidiff2-1.10.0.tar.gz)

Here is the backtrace :

(gdb) bt full
#0  0x00007f535766dc8a in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#1  0x00007f535766e6eb in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#2  0x00007f535766ea96 in zend_parse_parameters () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#3  0x00007f5348471648 in zif_wikidiff2_do_diff (execute_data=<optimized out>, return_value=0x7f535261d260)
    at /home/jona/Downloads/wikidiff2/php_wikidiff2.cpp:102
        text1 = 0x7f53527c6618 "<strong>MediaWiki has been installed.</strong>\n\nConsult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.\n\n== Getting start"...
        text2 = 0x7f53527c6918 "<strong>MediaWiki has been installed.</strong>\n\nfoo\n\nConsult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.\n\n== Getting "...
        argc = <optimized out>
        text1_len = 735
        text2_len = 740
        numContextLines = 2
#4  0x00007f535770f3fb in execute_ex () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#5  0x00007f5357717267 in zend_execute () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#6  0x00007f53576659f2 in zend_execute_scripts () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#7  0x00007f5357601450 in php_execute_script () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#8  0x00007f5357719422 in ?? () from target:/usr/lib/apache2/modules/libphp7.2.so
No symbol table info available.
#9  0x0000555cd398fcc0 in ap_run_handler (r=r@entry=0x7f535b3330a0) at config.c:170
        pHook = <optimized out>
        n = 3
        rv = -1
#10 0x0000555cd399023d in ap_invoke_handler (r=r@entry=0x7f535b3330a0) at config.c:434
        handler = <optimized out>
        p = <optimized out>
        result = <optimized out>
        old_handler = 0x7f535b32f3a0 "application/x-httpd-php"
        ignore = <optimized out>
#11 0x0000555cd39a7c7b in ap_process_async_request (r=0x7f535b3330a0) at http_request.c:436

I don't know how to get symbol table for libphp7.2.so

dpkg -S libphp7.2.so should show you the package the file belongs to, which could be a hint. Please ask in an Ubuntu support forum if you cannot find the debug package.

@Jona: Hi, any success providing a better stacktrace by installing debug packages?

Jona added a comment.Mar 10 2020, 9:59 PM

@Aklapper Hi,
I hope this trace is enough.

Yes, thanks.