php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45209 segmentation fault, when exit script (when i open PGSQL conection)
Submitted: 2008-06-08 12:51 UTC Modified: 2009-05-03 01:00 UTC
Votes:11
Avg. Score:3.8 ± 0.6
Reproduced:8 of 8 (100.0%)
Same Version:6 (75.0%)
Same OS:7 (87.5%)
From: p dot elagin at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: p dot elagin at gmail dot com
New email:
PHP Version: OS:

 

 [2008-06-08 12:51 UTC] p dot elagin at gmail dot com
Description:
------------
when script exit i get segmentation fault Error

i create instanse of PDO object (use DNS - PGSQL)

if i use another driver (SQLITE), no segmentation fault when i exit


Reproduce code:
---------------
/* Version PHP */
> php -v

PHP 5.2.6-1 with Suhosin-Patch 0.9.6.2 (cli) (built: May  4 2008 19:41:04)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
    with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans

/* Test Script PHP */
> cat test-do.php

<?
$PGDB = new PDO( 'pgsql:user=html host=localhost dbname=*** password=*****' );
////$PGDB = new PDO( 'pgsql:host=localhost dbname=*******', 'html', '*******' );
//$PGDB = null;
//unset( $PGDB );
die;

?>

/* Run Script PHP */
> php test-pdo.php 
 segmentation fault  php test-pdo.php

Expected result:
----------------
segmentation fault

Actual result:
--------------
no seg fault , when exit

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-08 13:27 UTC] p dot elagin at gmail dot com
i disable eAccelerator and Xdebug 

but seg fault exists
 [2008-08-29 08:21 UTC] p dot elagin at gmail dot com
(gdb) bt
#0  0x00002b6b3e82fae0 in ?? ()
#1  0x00002b6b391f1fdf in ?? () from /usr/lib/libcrypto.so.0.9.8
#2  0x00002b6b3a1f8659 in ?? () from /usr/lib/libcurl.so.4
#3  0x00002b6b3a20a4e2 in ?? () from /usr/lib/libcurl.so.4
#4  0x00002b6b3a200a13 in curl_global_cleanup () from /usr/lib/libcurl.so.4
#5  0x00002b6b39f9f7e9 in zm_shutdown_http_request (type=9, module_number=1) at /tmp/pear/cache/pecl_http-1.6.0/http_request_api.c:194
#6  0x00002b6b39f8712a in zm_shutdown_http (type=1, module_number=41) at /tmp/pear/cache/pecl_http-1.6.0/http.c:339
#7  0x0000000000670d31 in module_destructor (module=0xc02310) at /tmp/buildd/php5-5.2.6/Zend/zend_API.c:1921
#8  0x00000000006772c0 in zend_hash_apply_deleter (ht=0xb74c20, p=0xc022b0) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:805
#9  0x0000000000677578 in zend_hash_graceful_reverse_destroy (ht=0xb74c20) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:840
#10 0x000000000066ccb7 in zend_shutdown () at /tmp/buildd/php5-5.2.6/Zend/zend.c:814
#11 0x0000000000626b75 in php_module_shutdown () at /tmp/buildd/php5-5.2.6/main/main.c:1906
#12 0x00000000006ea306 in main (argc=1952707416, argv=0x2b6b394b3358) at /tmp/buildd/php5-5.2.6/sapi/cli/php_cli.c:1341
 [2008-08-29 08:22 UTC] p dot elagin at gmail dot com
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php test-pdo.php
[Thread debugging using libthread_db enabled]
[New Thread 0x2b77d3849080 (LWP 13945)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2b77d3849080 (LWP 13945)]
0x00002b77d859cae0 in ?? ()
 [2008-08-31 13:07 UTC] pajoye@php.net
Disable (remove it from your php.ini) the pecl http extension and try again.
 [2008-08-31 15:02 UTC] p dot elagin at gmail dot com
in php ini (cli mode)
#extension=http.so

php  test-pdo.php 
zsh: segmentation fault  php test-pdo.php

(
 [2008-08-31 15:09 UTC] p dot elagin at gmail dot com
>php test-pdo.php
>gdb php
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) set arg /var/www/script/test-pdo.php
(gdb) run
Starting program: /usr/bin/php /var/www/script/test-pdo.php
[Thread debugging using libthread_db enabled]
[New Thread 0x2b427e11d080 (LWP 3526)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2b427e11d080 (LWP 3526)]
0x00002b4282e72ae0 in ?? ()
(gdb) bt
#0  0x00002b4282e72ae0 in ?? ()
#1  0x00002b427d832fdf in ?? () from /usr/lib/libcrypto.so.0.9.8
#2  0x00002b427e83b659 in ?? () from /usr/lib/libcurl.so.4
#3  0x00002b427e84d4e2 in ?? () from /usr/lib/libcurl.so.4
#4  0x00002b427e843a13 in curl_global_cleanup () from /usr/lib/libcurl.so.4
#5  0x00002b427e5e0d79 in zm_shutdown_http_request (type=9, module_number=1) at /tmp/pear/temp/pecl_http/http_request_api.c:194
#6  0x00002b427e5c812a in zm_shutdown_http (type=1, module_number=41) at /tmp/pear/temp/pecl_http/http.c:339
#7  0x0000000000670d31 in module_destructor (module=0xc02310) at /tmp/buildd/php5-5.2.6/Zend/zend_API.c:1921
#8  0x00000000006772c0 in zend_hash_apply_deleter (ht=0xb74c20, p=0xc022b0) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:805
#9  0x0000000000677578 in zend_hash_graceful_reverse_destroy (ht=0xb74c20) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:840
#10 0x000000000066ccb7 in zend_shutdown () at /tmp/buildd/php5-5.2.6/Zend/zend.c:814
#11 0x0000000000626b75 in php_module_shutdown () at /tmp/buildd/php5-5.2.6/main/main.c:1906
#12 0x00000000006ea306 in main (argc=805293352, argv=0x2b427daf4358) at /tmp/buildd/php5-5.2.6/sapi/cli/php_cli.c:1341
 [2008-08-31 15:13 UTC] p dot elagin at gmail dot com
http - turn off 


GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb)  set arg /var/www/script/test-pdo.php
(gdb) run
Starting program: /usr/bin/php /var/www/script/test-pdo.php
[Thread debugging using libthread_db enabled]
[New Thread 0x2ba9c0b35080 (LWP 3698)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2ba9c0b35080 (LWP 3698)]
0x00002ba9c562bae0 in ?? ()
(gdb) bt
#0  0x00002ba9c562bae0 in ?? ()
#1  0x00002ba9c024afdf in ?? () from /usr/lib/libcrypto.so.0.9.8
#2  0x00002ba9c184b659 in ?? () from /usr/lib/libcurl.so.4
#3  0x00002ba9c185d4e2 in ?? () from /usr/lib/libcurl.so.4
#4  0x00002ba9c1853a13 in curl_global_cleanup () from /usr/lib/libcurl.so.4
#5  0x00002ba9c1615e89 in zm_shutdown_curl (type=9, module_number=1) at /tmp/buildd/php5-5.2.6/ext/curl/interface.c:687
#6  0x0000000000670d31 in module_destructor (module=0xc02300) at /tmp/buildd/php5-5.2.6/Zend/zend_API.c:1921
#7  0x00000000006772c0 in zend_hash_apply_deleter (ht=0xb74c20, p=0xc022a0) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:805
#8  0x0000000000677578 in zend_hash_graceful_reverse_destroy (ht=0xb74c20) at /tmp/buildd/php5-5.2.6/Zend/zend_hash.c:840
#9  0x000000000066ccb7 in zend_shutdown () at /tmp/buildd/php5-5.2.6/Zend/zend.c:814
#10 0x0000000000626b75 in php_module_shutdown () at /tmp/buildd/php5-5.2.6/main/main.c:1906
#11 0x00000000006ea306 in main (argc=-312573176, argv=0x2ba9c050c358) at /tmp/buildd/php5-5.2.6/sapi/cli/php_cli.c:1341
 [2009-04-25 15:05 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/

And do NOT apply any 3rd party patches (like Suhosin..)
 [2009-05-03 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".
 [2010-12-02 18:32 UTC] liam at morland dot ca
I had this problem with PHP 5.3.3. I solved it by loading pgsql.so before curl.so on advice of this page:

http://linux.m2osw.com/php_cli_segmentation_fault_with_pgsql
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 12:01:33 2024 UTC