# SIGSEGV/ php_mod_global_dtor

- Thread: https://externals.io/message/29036
- Original archive: https://news-web.php.net/php.internals/29036
- Started by Oliver Block on 2007-04-25T22:56:25+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #29036 — Oliver Block — 2007-04-25T22:56:25+00:00

URL: https://externals.io/message/29036#29036

Hello internals,

I am facing a problem with tsrm_ls. I receive a `SIGSEGV` on a specific memory address.

Program received signal SIGSEGV, Segmentation fault.
0x40019880 in ?? ()

During a second execution I get

(gdb) x/ 0x40019880
0x40019880 <php_cforum_globals_dtor>:   0x5de58955

My code is PHP_MINIT_FUNCTION(cforum) {

#ifdef ZTS
        ts_allocate_id(&cforum_globals_id,
                        sizeof(zend_cforum_globals),
                        (ts_allocate_ctor)php_cforum_globals_ctor,
                        (ts_allocate_dtor)php_cforum_globals_dtor);
#else
        php_cforum_globals_ctor(&cforum_globals TSRMLS_CC);
#endif

...
}

static void php_cforum_globals_ctor( zend_cforum_globals *cforum_globals TSRMLS_
DC )
{
}
static void php_cforum_globals_dtor( zend_cforum_globals *cforum_globals TSRMLS_
DC )
{
}

Any suggestions? Help is appreciated.

Best regards,

Oliver

---

## #29037 — Marcus Boerger — 2007-04-25T23:16:48+00:00

URL: https://externals.io/message/29036#29037 · In reply to: #29036

Hello Oliver,

  we have a bunch of macros for globals. Please use those. For example
look into ext/ext_skel for help (or any extension php comeswith).

best regards
marcus

Thursday, April 26, 2007, 12:56:25 AM, you wrote:

> Hello internals,

> I am facing a problem with tsrm_ls. I receive a `SIGSEGV` on a specific memory address.

> Program received signal SIGSEGV, Segmentation fault.
> 0x40019880 in ?? ()

> During a second execution I get

> (gdb) x/ 0x40019880
> 0x40019880 <php_cforum_globals_dtor>:   0x5de58955

> My code is PHP_MINIT_FUNCTION(cforum) {

> #ifdef ZTS
>         ts_allocate_id(&cforum_globals_id,
>                         sizeof(zend_cforum_globals),
>                         (ts_allocate_ctor)php_cforum_globals_ctor,
>                         (ts_allocate_dtor)php_cforum_globals_dtor);
> #else
>         php_cforum_globals_ctor(&cforum_globals TSRMLS_CC);
> #endif

> ...
> }

> static void php_cforum_globals_ctor( zend_cforum_globals *cforum_globals TSRMLS_
> DC )
> {
> }
> static void php_cforum_globals_dtor( zend_cforum_globals *cforum_globals TSRMLS_
> DC )
> {
> }

> Any suggestions? Help is appreciated.

> Best regards,

> Oliver




Best regards,
 Marcus
