php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42695 workaround: export PHP_FCGI_MAX_REQUESTS = 1
Submitted: 2007-09-18 07:10 UTC Modified: 2007-10-13 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mamatkazin at ivc dot orw dot ru Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5.2.4 OS: Linux (Slackware 11.0)
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-09-18 07:10 UTC] mamatkazin at ivc dot orw dot ru
Description:
------------
I got this error on some BIG script and can't reproduce it on small example. This error happens nearly 1 from 5-10 request to this script.

This GDB was configured as "i486-slackware-linux"...Using host libthread_db libr
ary "/lib/tls/libthread_db.so.1".

(gdb) r  -b 127.0.0.1:1026
Starting program: /usr/local/php5-fcgi/bin/php-cgi -b 127.0.0.1:1026
[Thread debugging using libthread_db enabled]
[New Thread -1217173824 (LWP 25841)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1217173824 (LWP 25841)]
0x082f9949 in _zend_mm_free_int ()
(gdb) bt
#0  0x082f9949 in _zend_mm_free_int ()
#1  0x08307062 in _zval_ptr_dtor ()
#2  0x083213b8 in zend_hash_destroy ()
#3  0x0831510c in _zval_dtor_func ()
#4  0x0830708d in _zval_ptr_dtor ()
#5  0x083213b8 in zend_hash_destroy ()
#6  0x0831510c in _zval_dtor_func ()
#7  0x0830708d in _zval_ptr_dtor ()
#8  0x08321598 in zend_hash_apply_deleter ()
#9  0x08321647 in zend_hash_graceful_reverse_destroy ()
#10 0x083077f1 in shutdown_executor ()
#11 0x08315f4c in zend_deactivate ()
#12 0x082d03e8 in php_request_shutdown ()
#13 0x083b944e in main ()
(gdb) 

My configure line is:
./configure 
--prefix=/usr/local/php5-fcgi
--host=i686-pc-linux-gnu
--sysconfdir=/etc
--with-config-file-path=/etc/lighttpd
--enable-safe-mode
--with-openssl
--with-mhash
--enable-bcmath
--with-bz2
--with-pic
--enable-calendar
--enable-ctype
--with-gdbm
--with-db4
--with-ldap
--with-imap-ssl=/usr/local/lib/c-client
--with-imap=/usr/local/lib/c-client
--enable-dbase
--enable-ftp
--with-iconv
--with-exif
--enable-exif
--with-gd
--enable-gd-native-ttf
--with-jpeg-dir=/usr
--with-png
--with-pdflib
--with-ttf
--with-freetype-dir=/usr
--with-gmp
--enable-mbstring
--with-curl=/usr
--with-pcre-regex=/usr
--enable-pdo=shared
--with-pgsql




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-20 12:41 UTC] mamatkazin at ivc dot orw dot ru
Sorry for my English.

program is a big and uses several external pear classes. This generates a monthly report of our company. there are several large sql queries to DB2 on zSeries. my colleagues programmers could not seriously  reduce it. I can put it as is.

after several attempts run problem script, php hangs. I press Ctrl-C and saw:

Starting program: /usr/local/php5-fcgi/bin/php-cgi -b 127.0.0.1:1026
[Thread debugging using libthread_db enabled]
[New Thread -1217100096 (LWP 13395)]

Program received signal SIGINT, Interrupt.
[Switching to Thread -1217100096 (LWP 13395)]
0xb780cd28 in ___newselect_nocancel () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb780cd28 in ___newselect_nocancel () from /lib/tls/libc.so.6
#1  0xb69beaf9 in sqloSpinLockConflict () from /opt/IBM/db2/V8.1/lib/libdb2.so.1
#2  0xb672282d in SQLAllocHandle () from /opt/IBM/db2/V8.1/lib/libdb2.so.1
#3  0xb79e77c7 in SQLColumnsA () from /usr/local/lib/libodbc.so.1
#4  0x087df69c in ?? ()
#5  0x087e026c in ?? ()
#6  0x00000040 in ?? ()
#7  0xb7a35c40 in ?? () from /usr/local/lib/libodbc.so.1
#8  0x00000000 in ?? ()
(gdb) q

I'm googling and solution found - DB2 fixpak 14

But after fixpak I saw next error:
Starting program: /usr/local/php5-fcgi/bin/php-cgi -b 127.0.0.1:1026
[Thread debugging using libthread_db enabled]
[New Thread -1216907584 (LWP 21672)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1216907584 (LWP 21672)]
0x082fb357 in _zend_mm_alloc_int ()
(gdb) bt
#0  0x082fb357 in _zend_mm_alloc_int ()
#1  0x082fce50 in _estrndup ()
#2  0x082f761c in lex_scan ()
#3  0x083072dd in zendlex ()
#4  0x082f0f5c in zendparse ()
#5  0x082f864b in compile_file ()
#6  0x0833fc49 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER ()
#7  0x08337a32 in execute ()
#8  0x0833fcc8 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER ()
#9  0x08337a32 in execute ()
#10 0x083185f3 in zend_execute_scripts ()
#11 0x082d290c in php_execute_script ()
#12 0x00000000 in ?? ()
(gdb)
 [2007-09-21 09:09 UTC] jani@php.net
Try configure with --enable-debug in your configure line.
 [2007-10-03 07:33 UTC] mamatkazin at ivc dot orw dot ru
Yes, a --enable-debug already been included in previous reports. Here's another result.

This GDB was configured as "i486-slackware-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) r -b 127.0.0.1:1026
Starting program: /usr/local/php5-fcgi/bin/php-cgi -b 127.0.0.1:1026
[Thread debugging using libthread_db enabled]
[New Thread -1217616192 (LWP 6444)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1217616192 (LWP 6444)]
0x08327f50 in _zend_mm_free_int ()
(gdb) bt
#0  0x08327f50 in _zend_mm_free_int ()
#1  0x081c6903 in _free_odbc_result ()
#2  0x083514d9 in list_entry_destructor ()
#3  0x0834ea56 in zend_hash_del_key_or_index ()
#4  0x083511ab in _zend_list_delete ()
#5  0x081cbc6c in zif_odbc_close ()
#6  0x08367746 in zend_do_fcall_common_helper_SPEC ()
#7  0x08366be4 in execute ()
#8  0x08345912 in zend_execute_scripts ()
#9  0x082fde88 in php_execute_script ()
#10 0x00000000 in ?? ()
(gdb) 

For further work, I am forced to use the road workaround:

export PHP_FCGI_MAX_REQUESTS = 1

In such a mistake will never arise.
 [2007-10-06 00:38 UTC] jani@php.net
Please don't change the summary like this. Now we have no idea what the _problem_ is, just that you managed to find some workaround (bad one in this case too). Obviously this is related to odbc. I guess you're using odbc_pconnect() somewhere (persistant connections with ODBC have never worked properly..) so try to come up with short reproduce script.
If you can't give us a script to test with we can't do much about this.
 [2007-10-13 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".
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 28 13:01:23 2020 UTC