php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50495 PHP crashes with pgsql extension
Submitted: 2009-12-16 14:58 UTC Modified: 2009-12-17 15:45 UTC
From: denis dot bykov at cleancode dot ru Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 5.2.11 OS: FreeBSD 8.0-RELEASE
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: denis dot bykov at cleancode dot ru
New email:
PHP Version: OS:

 

 [2009-12-16 14:58 UTC] denis dot bykov at cleancode dot ru
Description:
------------
PHP (installed from ports) crashes with pgsql extension
php5-5.2.11
php5-pgsql-5.2.11_1
postgresql-server-8.2.13
postgresql-client-8.2.13 

It crashes regardless of code.
For example, it crashes on <?phpinfo();?>

Reproduce code:
---------------
extension=pgsql.so

create file phpinfo.php with this content:
<?phpinfo();?>

run
$php phpinfo.php

Expected result:
----------------
phpinfo() output

Actual result:
--------------
localhost$ php phpinfo.php
[Wed Dec 16 17:55:37 2009]  Script:  '-'
---------------------------------------
/usr/ports/lang/php5/work/php-5.2.11/ext/standard/dl.c(158) : Block 0x2871d224 status:
Invalid pointer: ((thread_id=0x28691128) != (expected=0x287033C0))
---------------------------------------
[Wed Dec 16 17:55:37 2009]  Script:  '-'
---------------------------------------
/usr/ports/lang/php5/work/php-5.2.11/Zend/zend_variables.c(162) : Block 0x2871c120 status:
/usr/ports/lang/php5/work/php-5.2.11/Zend/zend_variables.c(35) : Actual location (location was relayed)
Invalid pointer: ((thread_id=0x28691128) != (expected=0x287033C0))
---------------------------------------
Segmentation fault (core dumped)


backtrace:
(gdb) bt
#0  0x081c726f in _zend_hash_index_update_or_next_insert (ht=0x28711d68, h=0, pData=0xbfbfe714, nDataSize=12, 
    pDest=0x0, flag=1, __zend_filename=0x82ca318 "/usr/ports/lang/php5/work/php-5.2.11/Zend/zend_list.c", 
    __zend_lineno=47) at /usr/ports/lang/php5/work/php-5.2.11/Zend/zend_hash.c:359
#1  0x081ca07e in zend_list_insert (ptr=0x287ba020, type=2) at /usr/ports/lang/php5/work/php-5.2.11/Zend/zend_list.c:47
#2  0x081ca228 in zend_register_resource (rsrc_result=0x0, rsrc_pointer=0x287ba020, rsrc_type=2)
    at /usr/ports/lang/php5/work/php-5.2.11/Zend/zend_list.c:99
#3  0x0816dc0c in _php_stream_alloc (ops=0x82e47a0, abstract=0x287b9f70, persistent_id=0x0, mode=0x82d1f8f "rb", 
    __php_stream_call_depth=2, 
    __zend_filename=0x82b12f8 "/usr/ports/lang/php5/work/php-5.2.11/main/streams/plain_wrapper.c", __zend_lineno=169, 
    __zend_orig_filename=0x82a8aac "/usr/ports/lang/php5/work/php-5.2.11/ext/standard/php_fopen_wrapper.c", 
    __zend_orig_lineno=322, tsrm_ls=0x28702040) at /usr/ports/lang/php5/work/php-5.2.11/main/streams/streams.c:267
#4  0x08177325 in _php_stream_fopen_from_file_int (file=0x2867a560, mode=0x82d1f8f "rb", __php_stream_call_depth=1, 
    __zend_filename=0x82b12f8 "/usr/ports/lang/php5/work/php-5.2.11/main/streams/plain_wrapper.c", __zend_lineno=257, 
    __zend_orig_filename=0x82a8aac "/usr/ports/lang/php5/work/php-5.2.11/ext/standard/php_fopen_wrapper.c", 
    __zend_orig_lineno=322, tsrm_ls=0x28702040) at /usr/ports/lang/php5/work/php-5.2.11/main/streams/plain_wrapper.c:169
#5  0x0817779f in _php_stream_fopen_from_file (file=0x2867a560, mode=0x82d1f8f "rb", __php_stream_call_depth=0, 
    __zend_filename=0x82a8aac "/usr/ports/lang/php5/work/php-5.2.11/ext/standard/php_fopen_wrapper.c", 
    __zend_lineno=322, __zend_orig_filename=0x0, __zend_orig_lineno=0, tsrm_ls=0x28702040)
    at /usr/ports/lang/php5/work/php-5.2.11/main/streams/plain_wrapper.c:257
#6  0x0813832d in php_stream_url_wrap_php (wrapper=0x82e2c08, path=0x82d1f98 "stdin", mode=0x82d1f8f "rb", options=8, 
    opened_path=0x0, context=0x0, __php_stream_call_depth=1, 
    __zend_filename=0x82b09d0 "/usr/ports/lang/php5/work/php-5.2.11/main/streams/streams.c", __zend_lineno=1829, 
    __zend_orig_filename=0x82d17bc "/usr/ports/lang/php5/work/php-5.2.11/sapi/cli/php_cli.c", __zend_orig_lineno=522, 
    tsrm_ls=0x28702040) at /usr/ports/lang/php5/work/php-5.2.11/ext/standard/php_fopen_wrapper.c:322
#7  0x0817203a in _php_stream_open_wrapper_ex (path=0x82d1f92 "php://stdin", mode=0x82d1f8f "rb", options=0, 
    opened_path=0x0, context=0x0, __php_stream_call_depth=0, 
    __zend_filename=0x82d17bc "/usr/ports/lang/php5/work/php-5.2.11/sapi/cli/php_cli.c", __zend_lineno=522, 
    __zend_orig_filename=0x0, __zend_orig_lineno=0, tsrm_ls=0x28702040)
    at /usr/ports/lang/php5/work/php-5.2.11/main/streams/streams.c:1827
#8  0x082464d8 in cli_register_file_handles (tsrm_ls=0x28702040)
    at /usr/ports/lang/php5/work/php-5.2.11/sapi/cli/php_cli.c:522
#9  0x082478a8 in main (argc=2, argv=0xbfbfec6c) at /usr/ports/lang/php5/work/php-5.2.11/sapi/cli/php_cli.c:1081

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-16 15:10 UTC] jani@php.net
Please try using this snapshot:

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

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


 [2009-12-17 11:04 UTC] denis dot bykov at cleancode dot ru
That's work for me, thank you
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 08:01:32 2025 UTC