php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47829 Segmentation fault on startup with PDO Firebird compiled in
Submitted: 2009-03-29 16:11 UTC Modified: 2009-12-15 00:52 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: info at programmiernutte dot net Assigned:
Status: Closed Package: PDO related
PHP Version: 5.3.0RC1 OS: Debian Etch x86_64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: info at programmiernutte dot net
New email:
PHP Version: OS:

 

 [2009-03-29 16:11 UTC] info at programmiernutte dot net
Description:
------------
I am getting Segmentation fault on startup, no matter if SAPI apache 2 or CLI. Same Version of PHP and same Firebird Version (2.1.1.) are running flawlessly on my G4 Mac on Mac OS X 10.4.11, so maybe this is 64bit-related? 
I used gdb to track this down to PDO Firebird Initialisation Startup:

(gdb) run
Starting program: /usr/src/php-5.3.0RC1/sapi/cli/php 
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread 47013927445712 (LWP 16824)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47013927445712 (LWP 16824)]
zend_declare_class_constant_long (ce=0x0, name=0xa6a5ef "FB_ATTR_DATE_FORMAT", name_length=19, value=1000)
    at /usr/src/php-5.3.0RC1/Zend/zend_API.c:3210
3210            if (ce->type & ZEND_INTERNAL_CLASS) {
(gdb) where
#0  zend_declare_class_constant_long (ce=0x0, name=0xa6a5ef "FB_ATTR_DATE_FORMAT", name_length=19, value=1000)
    at /usr/src/php-5.3.0RC1/Zend/zend_API.c:3210
#1  0x00000000005190c2 in zm_startup_pdo_firebird (type=<value optimized out>, module_number=<value optimized out>)
    at /usr/src/php-5.3.0RC1/ext/pdo_firebird/pdo_firebird.c:58
#2  0x000000000061cfbe in zend_startup_module_ex (module=0xcafb10) at /usr/src/php-5.3.0RC1/Zend/zend_API.c:1593
#3  0x0000000000625f05 in zend_hash_apply (ht=0xc62e80, apply_func=0x61cec0 <zend_startup_module_ex>)
    at /usr/src/php-5.3.0RC1/Zend/zend_hash.c:673
#4  0x000000000061d89a in zend_startup_modules () at /usr/src/php-5.3.0RC1/Zend/zend_API.c:1642
#5  0x00000000005c827f in php_module_startup (sf=<value optimized out>, additional_modules=0x0, num_additional_modules=0)
    at /usr/src/php-5.3.0RC1/main/main.c:1952
#6  0x00000000006a0e5d in php_cli_startup (sapi_module=0x0) at /usr/src/php-5.3.0RC1/sapi/cli/php_cli.c:370
#7  0x00000000006a155f in main (argc=1, argv=0x7fff63c23928) at /usr/src/php-5.3.0RC1/sapi/cli/php_cli.c:742


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-29 21:51 UTC] info at programmiernutte dot net
I did some more experimenting, and I figured that the Crash does not occur when PDO Firebird is compiled as a shared module and loaded as extension. PDO Extension seems to work.
 [2009-04-30 10:48 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-01 07:29 UTC] info at programmiernutte dot net
Same thing:

localhost:~/php5.2-200905010630/sapi/cli# ./php 
Segmentation fault

gdb trace:
(gdb) run
Starting program: /root/php5.2-200905010630/sapi/cli/php 
warning: no loadable sections found in added symbol-file system-
supplied DSO at 0x7ffff79fe000
[Thread debugging using libthread_db enabled]
[New Thread 47269144047376 (LWP 16865)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47269144047376 (LWP 16865)]
0x000000000062c1aa in _zend_hash_add_or_update (ht=0xa8f740, 
arKey=0x8bbb92 "firebird", nKeyLength=8, pData=0x7ffff7995060, 
    nDataSize=8, pDest=0x0, flag=2) at /root/php5.2-
200905010630/Zend/zend_hash.c:218
218             p = ht->arBuckets[nIndex];
(gdb) where
#0  0x000000000062c1aa in _zend_hash_add_or_update (ht=0xa8f740, 
arKey=0x8bbb92 "firebird", nKeyLength=8, 
    pData=0x7ffff7995060, nDataSize=8, pDest=0x0, flag=2) at 
/root/php5.2-200905010630/Zend/zend_hash.c:218
#1  0x000000000052718f in php_pdo_register_driver (driver=0xa661c0) at 
/root/php5.2-200905010630/ext/pdo/pdo.c:184
#2  0x00000000005311c0 in zm_startup_pdo_firebird (type=<value 
optimized out>, module_number=9157530)
    at /root/php5.2-200905010630/ext/pdo_firebird/pdo_firebird.c:58
#3  0x00000000006257c3 in zend_startup_module_ex (module=0xae52d0) at 
/root/php5.2-200905010630/Zend/zend_API.c:1472
#4  0x000000000062a995 in zend_hash_apply (ht=0xa93bc0, 
apply_func=0x6256c0 <zend_startup_module_ex>)
    at /root/php5.2-200905010630/Zend/zend_hash.c:673
#5  0x0000000000623fea in zend_startup_modules () at /root/php5.2-
200905010630/Zend/zend_API.c:1519
#6  0x00000000005deebd in php_module_startup (sf=<value optimized 
out>, additional_modules=0x0, num_additional_modules=0)
    at /root/php5.2-200905010630/main/main.c:1843
#7  0x00000000006a171d in php_cli_startup (sapi_module=0x0) at 
/root/php5.2-200905010630/sapi/cli/php_cli.c:386
#8  0x00000000006a1e11 in main (argc=1, argv=0x7ffff7995688) at 
/root/php5.2-200905010630/sapi/cli/php_cli.c:745
 [2009-09-03 20:53 UTC] kuzvesov at list dot ru
I have this bug in the following 32-bit configuration, both using ibase_* functions and PDO extension, php CLI.

Configuration:

uname:
FreeBSD dbserv 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

pkg_info:
firebird-client-2.0.3_2 Firebird-2 database client
firebird-server-2.0.3_2 Firebird-2 relational database (server)
php5-5.2.6_2        PHP Scripting Language
php5-interbase-5.2.6_2 The interbase shared extension for php
php5-pdo-5.2.6_2    The pdo shared extension for php
php5-pdo_firebird-5.2.6_2 The pdo_firebird shared extension for php


After moving to FreeBSD 7.2 amd64, php 5.2.9, the bug is still there.
 [2009-11-13 00:41 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-11-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-12-15 00:50 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-12-15 00:52 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Already fixed in bug #48980.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 21:01:34 2025 UTC