php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51659 received signal SIGSEGV php_cli.c:1373
Submitted: 2010-04-25 11:35 UTC Modified: 2013-02-18 00:34 UTC
From: uni_advisor at mail dot ru Assigned:
Status: No Feedback Package: InterBase related
PHP Version: Irrelevant OS: FreeBSD 7.3
Private report: No CVE-ID: None
 [2010-04-25 11:35 UTC] uni_advisor at mail dot ru
Description:
------------
I am build Firebird-2.1.3.18185-0, install to /usr/local/firebird. Create link /usr/interbase.

<?php
$host = 'localhost:employee';
$username = 'SYSDBA';
$password = 'masterkey';
$dbh = ibase_connect($host, $username, $password) or die("a1");
$stmt = 'SELECT first 3 * FROM customer';
$sth = ibase_query($dbh, $stmt) or die("a2");

while ($row = ibase_fetch_row($sth)) {
    echo $row[0], "\n";
}
ibase_free_result($sth);
ibase_close($dbh);
?>

Output:
1001
1002
1003

IBase functions works, but Segmentation fault at the end.

gdb php core
bt

#0  0x0000000801649590 in ?? ()
#1  0x000000080120e594 in __cxa_finalize () from /lib/libc.so.7
#2  0x00000008011beac7 in exit () from /lib/libc.so.7
#3  0x0000000000607cdc in main (argc=3, argv=0x7fffffffeb10)
    at /usr/ports/lang/php5/work/php-5.2.12/sapi/cli/php_cli.c:1373



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-26 23:21 UTC] uni_advisor at mail dot ru
Try compile latest snapshot php5.3-201004261830
cd php5.3-201004261830
./configure --prefix=/usr/local/php-test --disable-all --enable-debug
make
make install
cd ext/interbase
./configure --with-phpconfig=/usr/local/php-test/bin/php-config  --with-interbase=/usr/local/firebird
make
make install

Fiebird info:
Firebird/InterBase Support => dynamic
Compile-time Client Library Version => Firebird API version 21
Run-time Client Library Version => FB-V6.3.3.18185 Firebird 2.1

gdb /usr/local/php-test/bin/php
set args -q test1.php
(gdb) run
Starting program: /usr/local/php-test/bin/php -q test1.php
1001----
1002----
1003----

Program received signal SIGSEGV, Segmentation fault.
0x000000080114c590 in ?? ()
(gdb) where
#0  0x000000080114c590 in ?? ()
#1  0x0000000800cc6594 in __cxa_finalize () from /lib/libc.so.7
#2  0x0000000800c76ac7 in exit () from /lib/libc.so.7
#3  0x00000000006c64f6 in main (argc=3, argv=0x7fffffffeb08)
    at /usr/home/serg/src/php5.3-201004261830/sapi/cli/php_cli.c:1394

All manipulation before and after portsnap port update.
 [2010-04-27 01:22 UTC] johannes@php.net
-Status: Open +Status: Feedback
 [2010-04-27 01:22 UTC] johannes@php.net
#3  0x0000000000607cdc in main (argc=3, argv=0x7fffffffeb10)
    at /usr/ports/lang/php5/work/php-5.2.12/sapi/cli/php_cli.c:1373


This position doesn't make much sense. I don't have interbase at hand to test but maybe valgrind helps. Could you please install valgrind and run

USE_ZEND_ALLOC=0 valgrind /path/to/bin/php /path/to/script.php

And paste the result?
 [2010-04-27 07:28 UTC] uni_advisor at mail dot ru
-Status: Feedback +Status: Open
 [2010-04-27 07:28 UTC] uni_advisor at mail dot ru
>set USE_ZEND_ALLOC=0
> valgrind --leak-check=full --show-reachable=yes /usr/local/php-test/bin/php ./test1.php
==73138== Memcheck, a memory error detector
==73138== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==73138== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info
==73138== Command: /usr/local/php-test/bin/php ./test1.php
==73138==
1001----
1002----
1003----
Happy end
==73138== Jump to the invalid address stated on the next line
==73138==    at 0x1A89590: ???
==73138==    by 0x13D7593: __cxa_finalize (in /lib/libc.so.7)
==73138==    by 0x1387AC6: exit (in /lib/libc.so.7)
==73138==    by 0x6C64F5: main (php_cli.c:1394)
==73138==  Address 0x1a89590 is not stack'd, malloc'd or (recently) free'd
==73138==
==73138==
==73138== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==73138==  Access not within mapped region at address 0x1A89590
==73138==    at 0x1A89590: ???
==73138==    by 0x13D7593: __cxa_finalize (in /lib/libc.so.7)
==73138==    by 0x1387AC6: exit (in /lib/libc.so.7)
==73138==    by 0x6C64F5: main (php_cli.c:1394)
==73138==  If you believe this happened as a result of a stack
==73138==  overflow in your program's main thread (unlikely but
==73138==  possible), you can try to increase the size of the
==73138==  main thread stack using the --main-stacksize= flag.
==73138==  The main thread stack size used in this run was 16777216.
==73138==
==73138== HEAP SUMMARY:
==73138==     in use at exit: 7,042 bytes in 8 blocks
==73138==   total heap usage: 8,338 allocs, 8,330 frees, 2,622,338 bytes allocated
==73138==
==73138== 56 bytes in 1 blocks are still reachable in loss record 1 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13CD771: ??? (in /lib/libc.so.7)
==73138==    by 0x13CDD81: _nsyylex (in /lib/libc.so.7)
==73138==    by 0x13CD01F: _nsyyparse (in /lib/libc.so.7)
==73138==    by 0x13D2B76: nsdispatch (in /lib/libc.so.7)
==73138==    by 0x139D8D3: getpwuid_r (in /lib/libc.so.7)
==73138==    by 0x139D5C0: ??? (in /lib/libc.so.7)
==73138==    by 0x1A8CD85: ???
==73138==    by 0x1C69541: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==
==73138== 400 bytes in 1 blocks are still reachable in loss record 2 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13CCC67: ??? (in /lib/libc.so.7)
==73138==    by 0x13CD28A: _nsyyparse (in /lib/libc.so.7)
==73138==    by 0x13D2B76: nsdispatch (in /lib/libc.so.7)
==73138==    by 0x139D8D3: getpwuid_r (in /lib/libc.so.7)
==73138==    by 0x139D5C0: ??? (in /lib/libc.so.7)
==73138==    by 0x1A8CD85: ???
==73138==    by 0x1C69541: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==    by 0x1945220: ???
==73138==
==73138== 872 bytes in 1 blocks are still reachable in loss record 3 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13BE873: __res_vinit (in /lib/libc.so.7)
==73138==    by 0x13D208D: gethostbyname_r (in /lib/libc.so.7)
==73138==    by 0x13D20EB: gethostbyname (in /lib/libc.so.7)
==73138==    by 0x1C68CB3: ???
==73138==    by 0x1C69401: ???
==73138==    by 0x1C6966B: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==    by 0x1945220: ???
==73138==    by 0x1945897: ???
==73138==
==73138== 1,024 bytes in 1 blocks are still reachable in loss record 4 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x139D673: ??? (in /lib/libc.so.7)
==73138==    by 0x1A8CD85: ???
==73138==    by 0x1C69541: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==    by 0x1945220: ???
==73138==    by 0x1945897: ???
==73138==    by 0x1945B9A: ???
==73138==    by 0x609A98: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:313)
==73138==    by 0x60F6EE: ZEND_DO_FCALL_SPEC_CONST_HANDLER (zend_vm_execute.h:1603)
==73138==
==73138== 1,024 bytes in 1 blocks are still reachable in loss record 5 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13C3A7C: ??? (in /lib/libc.so.7)
==73138==    by 0x1C68DBA: ???
==73138==    by 0x1C69401: ???
==73138==    by 0x1C6966B: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==    by 0x1945220: ???
==73138==    by 0x1945897: ???
==73138==    by 0x1945B9A: ???
==73138==    by 0x609A98: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:313)
==73138==
==73138== 1,026 bytes in 1 blocks are still reachable in loss record 6 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13CD784: ??? (in /lib/libc.so.7)
==73138==    by 0x13CDD81: _nsyylex (in /lib/libc.so.7)
==73138==    by 0x13CD01F: _nsyyparse (in /lib/libc.so.7)
==73138==    by 0x13D2B76: nsdispatch (in /lib/libc.so.7)
==73138==    by 0x139D8D3: getpwuid_r (in /lib/libc.so.7)
==73138==    by 0x139D5C0: ??? (in /lib/libc.so.7)
==73138==    by 0x1A8CD85: ???
==73138==    by 0x1C69541: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==
==73138== 1,040 bytes in 1 blocks are still reachable in loss record 7 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13D7622: ??? (in /lib/libc.so.7)
==73138==    by 0x13D77B1: __cxa_atexit (in /lib/libc.so.7)
==73138==    by 0x1A91968: ???
==73138==    by 0x1A91992: ???
==73138==    by 0x1CA1A46: ???
==73138==    by 0x1FFFFFFFF: ???
==73138==    by 0xFF00070FFFFFFFFF: ???
==73138==    by 0xFF000C1000000006: ???
==73138==    by 0xFF000BF800000006: ???
==73138==    by 0x6: ???
==73138==
==73138== 1,600 bytes in 1 blocks are still reachable in loss record 8 of 8
==73138==    at 0x24A67B: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==73138==    by 0x13CCCEF: ??? (in /lib/libc.so.7)
==73138==    by 0x13CD28A: _nsyyparse (in /lib/libc.so.7)
==73138==    by 0x13D2B76: nsdispatch (in /lib/libc.so.7)
==73138==    by 0x139D8D3: getpwuid_r (in /lib/libc.so.7)
==73138==    by 0x139D5C0: ??? (in /lib/libc.so.7)
==73138==    by 0x1A8CD85: ???
==73138==    by 0x1C69541: ???
==73138==    by 0x1C6AF7E: ???
==73138==    by 0x1C73B46: ???
==73138==    by 0x1A9A389: ???
==73138==    by 0x1945220: ???
==73138==
==73138== LEAK SUMMARY:
==73138==    definitely lost: 0 bytes in 0 blocks
==73138==    indirectly lost: 0 bytes in 0 blocks
==73138==      possibly lost: 0 bytes in 0 blocks
==73138==    still reachable: 7,042 bytes in 8 blocks
==73138==         suppressed: 0 bytes in 0 blocks
==73138==
==73138== For counts of detected and suppressed errors, rerun with: -v
==73138== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 30 from 3)
Segmentation fault
 [2011-04-01 12:46 UTC] hempalex at gmail dot com
Firebird-2.1.3.18185-0 on FreeBSD 8.2 AMD64

Test code
<?php
    $ib = ibase_connect('localhost:/db/test.fdb', 'USER', 'PASSWORD', 'WIN1251', 
0, 3 );
    print_r($ib);
?>

running:
# php test.php
Resource id #4
Segmentation fault (core dumped)

GDB backtrace from php.core

#0  0x0000000801f6a5b0 in ?? ()
#1  0x00000008013c2e74 in __cxa_finalize () from /lib/libc.so.7
#2  0x000000080136d097 in exit () from /lib/libc.so.7
#3  0x00000000006fc506 in main (argc=2, argv=0x7fffffffead8)
    at /usr/ports/lang/php5/work/php-5.3.6/sapi/cli/php_cli.c:1395
 [2011-11-16 13:59 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2011-11-16 13:59 UTC] felipe@php.net
Any change here?
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC