Skip to content

libphp.so dumps core in sapi_register_post_entry+0x31() #8445

Open

Description

@psumbera

Description

Starting Apache with libphp imediately ends with core dump:

httpd:core> $C
    7fdd8f067660 libphp8.1.so`sapi_register_post_entry+0x31()
    7fdd8f067680 libphp8.1.so`sapi_register_post_entries+0x2a()
    7fdd8f067690 libphp8.1.so`php_setup_sapi_content_types+0x10()
    7fdd8f0676e0 libphp8.1.so`tsrm_update_active_threads+0xb0()
    7fdd8f067720 libphp8.1.so`ts_allocate_fast_id+0xe3()
    7fdd8f067760 libphp8.1.so`php_apache_server_startup+0x6c()
    7fdd8f0677b0 ap_run_post_config+0x54()
    7fdd8f0678f0 main+0x1873()
    7fdd8f067900 0x465fc4()

This worked well with PHP 8.1.0.

git bisessct gives following output:

72f8dbb31295e4e5633a9033c6d91a45d102c485 is the first bad commit
commit 72f8dbb31295e4e5633a9033c6d91a45d102c485
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Nov 24 20:43:30 2021 +0300

    Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag)

 TSRM/TSRM.h              | 8 ++++++--
 Zend/zend.c              | 2 +-
 Zend/zend.h              | 4 ++++
 build/php.m4             | 2 +-
 win32/build/confutils.js | 2 +-
 5 files changed, 13 insertions(+), 5 deletions(-)

Apply reversely patch from above commit allows me to use PHP 8.1.5.

PHP Version

PHP 8.1.5

Operating System

Solaris

Activity

  1. psumbera commented on Apr 27, 2022

    @psumbera
    ContributorAuthor

    Following is stack with more information:

    Core was generated by `/usr/apache2/2.4/bin/httpd -k start'.
    Program terminated with signal SIGSEGV, Segmentation fault.
    #0  0x00007feafb625240 in sapi_register_post_entry (post_entry=0x7feafb9773e0 <php_post_entries>) at ./php-8.1.5/main/SAPI.c:936
    936             if (SG(sapi_started) && EG(current_execute_data)) {
    [Current thread is 3 (LWP    1        )]
    (gdb) where
    #0  0x00007feafb625240 in sapi_register_post_entry (post_entry=0x7feafb9773e0 <php_post_entries>) at ./php-8.1.5/main/SAPI.c:936
    #1  0x00007feafb6251f0 in sapi_register_post_entries (post_entries=0x7feafb9773e0 <php_post_entries>) at ./php-8.1.5/main/SAPI.c:923
    #2  0x00007feafb6299ac in php_setup_sapi_content_types () at ./php-8.1.5/main/php_content_types.c:56
    #3  0x00007feafb621d09 in sapi_globals_ctor (sapi_globals=0x564568a60) at ./php-8.1.5/main/SAPI.c:58
    #4  0x00007feafb60f602 in tsrm_update_active_threads () at ./php-8.1.5/TSRM/TSRM.c:264
    #5  0x00007feafb60fa66 in ts_allocate_fast_id (rsrc_id=0x7feafba6b840 <sapi_globals_id>, offset=0x7feafba6b848 <sapi_globals_offset>, size=544,
        ctor=0x7feafb621cbf <sapi_globals_ctor>, dtor=0x7feafb621d0c <sapi_globals_dtor>) at ./php-8.1.5/TSRM/TSRM.c:363
    #6  0x00007feafb621d93 in sapi_startup (sf=0x7feafb96b200 <apache2_sapi_module>) at ./php-8.1.5/main/SAPI.c:76
    #7  0x00007feafb85b5ce in php_apache_server_startup (pconf=0x5644d3be8, plog=0x564503ea8, ptemp=0x564501e98, s=0x5644fff70)
        at ./php-8.1.5/sapi/apache2handler/sapi_apache2.c:489
    #8  0x000000000049d754 in ap_run_post_config ()
    #9  0x00000000004683b3 in main ()
    
  2. cmb69 commented on May 2, 2022

    @cmb69
    Member

    @dstogov, since you committed 72f8dbb , could you please have a look at this?

  3. cmb69 commented on May 12, 2022

    @cmb69
    Member

    FWIW, there is no issue on Windows. @psumbera, did you make sure that all used extensions have been recompiled (or better yet, don't use any shared extension)?

  4. github-actions commented on May 27, 2022

    @github-actions

    No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you.

  5. psumbera commented on May 27, 2022

    @psumbera
    ContributorAuthor

    All PHP bundled extensions were recompiled. This is how we build it:
    https://github.com/oracle/solaris-userland/blob/master/components/php/php81

  6. reopened this on May 27, 2022
  7. kamil-tekiela commented on Nov 5, 2026

    @kamil-tekiela
    Member

    @psumbera Is this still an issue on PHP 8.6?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions