Skip to content

Add excimer profiler support #1017

Closed

Description

@andrei-stsiapanau

Add the excimer profiler support please. It used by Sentry to create request profiles for futher analysis and may be verify helpful.

Activity

  1. added
    new feature
    on Jan 17, 2026
  2. henderkes commented on Jan 17, 2026

    @henderkes
    Collaborator

    Static compilation works, shared extension segfaults on all compilers.

  3. henderkes commented on Jan 17, 2026

    @henderkes
    Collaborator
    (gdb) run
    Starting program: /home/m/static-php-cli/buildroot/bin/php -n -d extension_dir=/home/m/static-php-cli/buildroot/modules -d extension=excimer --ri excimer
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib64/libthread_db.so.1".
    
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7251ca9 in zend_register_ini_entries_ex (ini_entry=0x7ffff77ed120 <ini_entries>, module_number=9, module_type=1) at /home/m/static-php-cli/source/php-src/Zend/zend_ini.c:219
    219             if (directives != EG(ini_directives)) {
    (gdb) bt full
    #0  0x00007ffff7251ca9 in zend_register_ini_entries_ex (ini_entry=0x7ffff77ed120 <ini_entries>, module_number=9, module_type=1) at /home/m/static-php-cli/source/php-src/Zend/zend_ini.c:219
            p = 0x1
            default_value = 0x9f55e11600000004
            directives = 0x0
    #1  0x00007ffff6e085e8 in zm_startup_excimer (type=1, module_number=9) at /home/m/static-php-cli/source/php-src/ext/excimer/excimer.c:498
            ce = {type = 0 '\000', name = 0x0, {parent = 0x0, parent_name = 0x0}, refcount = 0, ce_flags = 0, default_properties_count = 0, default_static_members_count = 0, default_properties_table = 0x0, default_static_members_table = 0x0, 
              static_members_table__ptr = 0x0, function_table = {gc = {refcount = 0, u = {type_info = 0}}, u = {v = {flags = 0 '\000', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 0}, nTableMask = 0, {arHash = 0x0, 
                  arData = 0x0, arPacked = 0x0}, nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}, properties_info = {gc = {refcount = 0, u = {type_info = 0}}, u = {v = {
                    flags = 0 '\000', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, flags = 0}, nTableMask = 0, {arHash = 0x0, arData = 0x0, arPacked = 0x0}, nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, 
                nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}, constants_table = {gc = {refcount = 0, u = {type_info = 0}}, u = {v = {flags = 0 '\000', _unused = 0 '\000', nIteratorsCount = 0 '\000', _unused2 = 0 '\000'}, 
                  flags = 0}, nTableMask = 0, {arHash = 0x0, arData = 0x0, arPacked = 0x0}, nNumUsed = 0, nNumOfElements = 0, nTableSize = 0, nInternalPointer = 0, nNextFreeElement = 0, pDestructor = 0x0}, mutable_data__ptr = 0x0, 
              inheritance_cache = 0x0, properties_info_table = 0x0, constructor = 0x0, destructor = 0x555555ff5680 <std_object_handlers>, clone = 0x0, __get = 0x0, __set = 0x0, __unset = 0x0, __isset = 0x0, __call = 0x0, __callstatic = 0x0, 
              __tostring = 0x0, __debugInfo = 0x0, __serialize = 0x0, __unserialize = 0x0, default_object_handlers = 0x0, iterator_funcs_ptr = 0x0, arrayaccess_funcs_ptr = 0x0, {create_object = 0x0, interface_gets_implemented = 0x0}, 
              get_iterator = 0x0, get_static_method = 0x0, serialize = 0x555555f7ef20 <class_MultipleIterator_methods>, unserialize = 0x0, num_interfaces = 2460292608, num_traits = 2673205526, num_hooked_props = 8, 
              num_hooked_prop_variance_checks = 0, {interfaces = 0x0, interface_names = 0x0}, trait_names = 0x7ffff7ffd000 <_rtld_local>, trait_aliases = 0x555555f639b8, trait_precedences = 0x7fffffffc170, 
              attributes = 0x55555578099c <zm_startup_spl_observer+520>, enum_backing_type = 4154490880, backed_enum_table = 0x100000008, doc_comment = 0x7fffffffc190, info = {user = {filename = 0x55555573f16e <zm_startup_spl+151>, 
                  line_start = 4154490880, line_end = 32767}, internal = {builtin_functions = 0x55555573f16e <zm_startup_spl+151>, module = 0x7ffff7a08000}}}
    --Type <RET> for more, q to quit, c to continue without paging--
    #2  0x0000555555a47019 in zend_startup_module_ex (module=0x7ffff787e6e0 <excimer_module_entry>) at /home/m/static-php-cli/source/php-src/Zend/zend_API.c:2446
            name_len = 4
            lcname = 0x7ffff7a08000
    #3  0x0000555555a47092 in zend_startup_module_zval (zv=0x555556026240) at /home/m/static-php-cli/source/php-src/Zend/zend_API.c:2461
            module = 0x7ffff787e6e0 <excimer_module_entry>
    #4  0x0000555555c61b00 in zend_hash_apply (ht=0x55555600e3c0 <module_registry>, apply_func=0x555555a4706f <zend_startup_module_zval>) at /home/m/static-php-cli/source/php-src/Zend/zend_hash.c:2092
            p = 0x555556026240
            idx = 9
            result = 0
    #5  0x0000555555a47834 in zend_startup_modules () at /home/m/static-php-cli/source/php-src/Zend/zend_API.c:2584
    No locals.
    #6  0x0000555555930ef1 in php_module_startup (sf=0x555555ff9d80 <cli_sapi_module>, additional_module=0x0) at /home/m/static-php-cli/source/php-src/main/main.c:2290
            zuf = {error_function = 0x55555592e06e <php_error_cb>, printf_function = 0x55555592cc57 <php_printf>, write_function = 0x5555559355a4 <php_output_write>, fopen_function = 0x55555592f463 <php_fopen_wrapper_for_zend>, 
              message_handler = 0x55555592f7c5 <php_message_handler_for_zend>, get_configuration_directive = 0x55555592f6eb <php_get_configuration_directive_for_zend>, ticks_function = 0x55555593e73c <php_run_ticks>, 
              on_timeout = 0x55555592fbb0 <php_on_timeout>, stream_open_function = 0x55555592f544 <php_stream_open_for_zend>, printf_to_smart_string_function = 0x555555952c32 <php_printf_to_smart_string>, 
              printf_to_smart_str_function = 0x555555952c62 <php_printf_to_smart_str>, getenv_function = 0x55555594c742 <sapi_getenv>, resolve_path_function = 0x55555592f6a6 <php_resolve_path_for_zend>, 
              random_bytes_function = 0x5555556e54df <php_random_bytes_ex>, random_bytes_insecure_function = 0x5555556f3433 <php_random_bytes_insecure_for_zend>}
    --Type <RET> for more, q to quit, c to continue without paging--
            zuv = {html_errors = true}
            retval = SUCCESS
            module_number = 0
            module = 0x555556012cd0
    #7  0x0000555555d3e3ba in php_cli_startup (sapi_module=0x555555ff9d80 <cli_sapi_module>) at /home/m/static-php-cli/source/php-src/sapi/cli/php_cli.c:397
    No locals.
    #8  0x0000555555d40dbe in main (argc=8, argv=0x555556013df0) at /home/m/static-php-cli/source/php-src/sapi/cli/php_cli.c:1277
            c = -1
            exit_status = 0
            module_started = 0
            sapi_started = 1
            php_optarg = 0x555556013f60 "excimer"
            php_optind = 8
            use_extended_info = 0
            ini_path_override = 0x0
            ini_builder = {value = 0x5555560174f0 "html_errors=0\nregister_argc_argv=1\nimplicit_flush=1\noutput_buffering=0\nmax_execution_time=0\nmax_input_time=-1\nextension_dir=\"/home/m/static-php-cli/buildroot/modules\"\nextension=excimer\n", 
              length = 185}
    --Type <RET> for more, q to quit, c to continue without paging--
            ini_ignore = 1
            sapi_module = 0x555555ff9d80 <cli_sapi_module>
    (gdb) info locals
    p = 0x1
    default_value = 0x9f55e11600000004
    directives = 0x0
    (gdb) frame 0
    #0  0x00007ffff7251ca9 in zend_register_ini_entries_ex (ini_entry=0x7ffff77ed120 <ini_entries>, module_number=9, module_type=1) at /home/m/static-php-cli/source/php-src/Zend/zend_ini.c:219
    219             if (directives != EG(ini_directives)) {
    (gdb) info args
    ini_entry = 0x7ffff77ed120 <ini_entries>
    module_number = 9
    module_type = 1
    (gdb) list
    214              * This solves two problems: one is that ini entries for dl()'d
    215              * extensions will now work, and the second is that updating the
    216              * global hash here from dl() is not mutex protected and can
    217              * lead to death.
    218              */
    219             if (directives != EG(ini_directives)) {
    220                     directives = EG(ini_directives);
    221             } else {
    222                     ZEND_ASSERT(module_type == MODULE_PERSISTENT);
    223             }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

new feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions