crash in sqlite_oo/spl

php.internals

Ard Biesheuvel

22 years ago
Currently, ext/sqlite/tests/sqlite_oo_031.phpt crashes after completion of the script. If I unset($menu_iterator) first, the crash disappears.
-- Ard

Ard Biesheuvel

22 years ago
#0 0x081b81ed in _zend_is_inconsistent (ht=0x5a5a5a5a, file=0x821d580 "/home/abies/build/php5-cvs/Zend/zend_hash.c", line=504) at /home/abies/build/php5-cvs/Zend/zend_hash.c:53 #1 0x081b99b2 in zend_hash_destroy (ht=0x5a5a5a5a) at /home/abies/build/php5-cvs/Zend/zend_hash.c:504 #2 0x08090c25 in sqlite_object_free_storage (object=0x402839d4) at /home/abies/build/php5-cvs/ext/sqlite/sqlite.c:764 #3 0x081c8b75 in zend_objects_store_del_ref (zobject=0x4028b50c) at /home/abies/build/php5-cvs/Zend/zend_objects_API.c:140 #4 0x081b0142 in _zval_dtor (zvalue=0x4028b50c, __zend_filename=0x821b7e0 "/home/abies/build/php5-cvs/Zend/zend_execute_API.c", __zend_lineno=359) at /home/abies/build/php5-cvs/Zend/zend_variables.c:61 #5 0x081a5f9b in _zval_ptr_dtor (zval_ptr=0x4028d348, __zend_filename=0x821c540 "/home/abies/build/php5-cvs/Zend/zend_variables.c", __zend_lineno=196) at /home/abies/build/php5-cvs/Zend/zend_execute_API.c:359 #6 0x081b0470 in _zval_ptr_dtor_wrapper (zval_ptr=0x4028d348) at /home/abies/build/php5-cvs/Zend/zend_variables.c:196 #7 0x081b99f9 in zend_hash_destroy (ht=0x4028cf9c) at /home/abies/build/php5-cvs/Zend/zend_hash.c:513 #8 0x081c6305 in zend_objects_free_object_storage (object=0x40287774) at /home/abies/build/php5-cvs/Zend/zend_objects.c:77 #9 0x081c8971 in zend_objects_store_free_object_storage (objects=0x823a120) at /home/abies/build/php5-cvs/Zend/zend_objects_API.c:71 #10 0x081a5d17 in shutdown_executor () at /home/abies/build/php5-cvs/Zend/zend_execute_API.c:273 #11 0x081b1864 in zend_deactivate () at /home/abies/build/php5-cvs/Zend/zend.c:814 #12 0x0816e07c in php_request_shutdown (dummy=0x0) at /home/abies/build/php5-cvs/main/main.c:1243 #13 0x081e16e3 in main (argc=2, argv=0xbffffd74) at /home/abies/build/php5-cvs/sapi/cli/php_cli.c:1044

Marcus Börger

22 years ago
Hello Ard, on the first sight it looks pretty much as if you havn't updated your build tree completley. Please check that ext/spl, ext/sqlite and Zend are up to date. Because for me it works pretty well. However i think this may not be your problem since looking at the backtrace shows that an uninitialized sqlite object gets gestroyed (#1: ht=0x5a5a5a5a). Tuesday, February 24, 2004, 2:49:01 PM, you wrote:
> #0 0x081b81ed in _zend_is_inconsistent (ht=0x5a5a5a5a, file=0x821d580 > "/home/abies/build/php5-cvs/Zend/zend_hash.c", line=504) > at /home/abies/build/php5-cvs/Zend/zend_hash.c:53 > #1 0x081b99b2 in zend_hash_destroy (ht=0x5a5a5a5a) at > /home/abies/build/php5-cvs/Zend/zend_hash.c:504 > #2 0x08090c25 in sqlite_object_free_storage (object=0x402839d4) at > /home/abies/build/php5-cvs/ext/sqlite/sqlite.c:764 > #3 0x081c8b75 in zend_objects_store_del_ref (zobject=0x4028b50c) at > /home/abies/build/php5-cvs/Zend/zend_objects_API.c:140 > #4 0x081b0142 in _zval_dtor (zvalue=0x4028b50c, > __zend_filename=0x821b7e0 > "/home/abies/build/php5-cvs/Zend/zend_execute_API.c", > __zend_lineno=359) at > /home/abies/build/php5-cvs/Zend/zend_variables.c:61 > #5 0x081a5f9b in _zval_ptr_dtor (zval_ptr=0x4028d348, > __zend_filename=0x821c540 > "/home/abies/build/php5-cvs/Zend/zend_variables.c", __zend_lineno=196) > at /home/abies/build/php5-cvs/Zend/zend_execute_API.c:359 > #6 0x081b0470 in _zval_ptr_dtor_wrapper (zval_ptr=0x4028d348) at > /home/abies/build/php5-cvs/Zend/zend_variables.c:196 > #7 0x081b99f9 in zend_hash_destroy (ht=0x4028cf9c) at > /home/abies/build/php5-cvs/Zend/zend_hash.c:513 > #8 0x081c6305 in zend_objects_free_object_storage (object=0x40287774) > at /home/abies/build/php5-cvs/Zend/zend_objects.c:77 > #9 0x081c8971 in zend_objects_store_free_object_storage (objects=0x823a120) > at /home/abies/build/php5-cvs/Zend/zend_objects_API.c:71 > #10 0x081a5d17 in shutdown_executor () at > /home/abies/build/php5-cvs/Zend/zend_execute_API.c:273 > #11 0x081b1864 in zend_deactivate () at > /home/abies/build/php5-cvs/Zend/zend.c:814 > #12 0x0816e07c in php_request_shutdown (dummy=0x0) at > /home/abies/build/php5-cvs/main/main.c:1243 > #13 0x081e16e3 in main (argc=2, argv=0xbffffd74) at > /home/abies/build/php5-cvs/sapi/cli/php_cli.c:1044
-- Best regards, Marcus mailto:helly@php.net

Ard Biesheuvel

22 years ago
Marcus Boerger wrote:
> Hello Ard, > > on the first sight it looks pretty much as if you havn't updated your build > tree completley. Please check that ext/spl, ext/sqlite and Zend are up to > date. Because for me it works pretty well. However i think this may not be > your problem since looking at the backtrace shows that an uninitialized > sqlite object gets gestroyed (#1: ht=0x5a5a5a5a).
This is from a fresh checkout on another machine: #0 0x00000001202c5ab0 in _zend_is_inconsistent (ht=0x5a5a5a5a5a5a5a5a, file=0x12034f962 "/home/abies/build/php5-cvs/Zend/zend_hash.c", line=504) at /home/abies/build/php5-cvs/Zend/zend_hash.c:53 #1 0x00000001202c800c in zend_hash_destroy (ht=0x1200ecbf4) at /home/abies/build/php5-cvs/Zend/zend_hash.c:504 #2 0x00000001200ecbf4 in sqlite_object_free_storage (object=0x1203eb180) at /home/abies/build/php5-cvs/ext/sqlite/sqlite.c:764 #3 0x00000001202e15b4 in zend_objects_store_del_ref (zobject=0x1203d26a8) at /home/abies/build/php5-cvs/Zend/zend_objects_API.c:140 #4 0x00000001202b77b8 in _zval_dtor (zvalue=0x1203f6308, __zend_filename=0x12034dbc0 "/home/abies/build/php5-cvs/Zend/zend_execute_API.c", __zend_lineno=359) at /home/abies/build/php5-cvs/Zend/zend_variables.c:61 #5 0x00000001202a6078 in _zval_ptr_dtor (zval_ptr=0x1202c8068, __zend_filename=0x11ff8cb8 "\214Õ- \001", __zend_lineno=541022192) at /home/abies/build/php5-cvs/Zend/zend_execute_API.c:359 #6 0x00000001202b7dd0 in _zval_ptr_dtor_wrapper (zval_ptr=0x1203f57f0) at /home/abies/build/php5-cvs/Zend/zend_variables.c:196 #7 0x00000001202c8068 in zend_hash_destroy (ht=0x1202dd58c) at /home/abies/build/php5-cvs/Zend/zend_hash.c:513 #8 0x00000001202dd58c in zend_objects_free_object_storage (object=0x1203f57f0) at /home/abies/build/php5-cvs/Zend/zend_objects.c:77 #9 0x00000001202e1134 in zend_objects_store_free_object_storage (objects=0x1203cccb8) at /home/abies/build/php5-cvs/Zend/zend_objects_API.c:71 #10 0x00000001202a5af0 in shutdown_executor () at /home/abies/build/php5-cvs/Zend/zend_execute_API.c:273 #11 0x00000001202ba5b4 in zend_deactivate () at /home/abies/build/php5-cvs/Zend/zend.c:814 #12 0x000000012024d9fc in php_request_shutdown (dummy=0x0) at /home/abies/build/php5-cvs/main/main.c:1243 #13 0x000000012030975c in main (argc=1614192548, argv=0x11ffbaf8) at /home/abies/build/php5-cvs/sapi/cli/php_cli.c:1044
-- Ard

Ard Biesheuvel

22 years ago
Marcus Boerger wrote:
> Hello Ard, > > on the first sight it looks pretty much as if you havn't updated your build > tree completley. Please check that ext/spl, ext/sqlite and Zend are up to > date. Because for me it works pretty well. However i think this may not be > your problem since looking at the backtrace shows that an uninitialized > sqlite object gets gestroyed (#1: ht=0x5a5a5a5a).
I've narrowed it down to : php -r '$o->foo = new sqlite_db("/tmp/sqlite_db");'
-- Ard

Marcus Börger

22 years ago
Hello Ard, Wednesday, February 25, 2004, 1:53:18 AM, you wrote:
> Marcus Boerger wrote:
>> Hello Ard, >> >> on the first sight it looks pretty much as if you havn't updated your build >> tree completley. Please check that ext/spl, ext/sqlite and Zend are up to >> date. Because for me it works pretty well. However i think this may not be >> your problem since looking at the backtrace shows that an uninitialized >> sqlite object gets gestroyed (#1: ht=0x5a5a5a5a).
> I've narrowed it down to :
> php -r '$o->foo = new sqlite_db("/tmp/sqlite_db");'
Thanks, this why i had a SEGV too. And i found a problem in the way the engine destructs and frees objects during shutdown. Please try again it should be fixed right now. Best regards, Marcus mailto:helly@php.net

Ard Biesheuvel

22 years ago
> Thanks, this why i had a SEGV too. And i found a problem in the way the > engine destructs and frees objects during shutdown. Please try again it > should be fixed right now.
It works now.
-- Ard

Andi Gutmans

22 years ago
Looks like a reference count problem to me. Best if the ppl familiar with sqlite/spl take a look. Andi At 14:49 24/02/2004 +0100, Ard Biesheuvel wrote: