Bug #13676: Missing FROM-clause Segfault
| From: | bryan at eevolved dot com | Date: | Mon, 15 Oct 2001 20:21:59 +0000 |
| Subject: | Bug #13676: Missing FROM-clause Segfault | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-67978@lists.php.net to get a copy of this message | ||
From: bryan@eevolved.com
Operating system: Linux Mandrake 8.0
PHP version: 4.0.6
PHP Bug Type: PostgreSQL related
Bug description: Missing FROM-clause Segfault
Formulating an SQL query with missing FROM clauses will
generate an apache segfault approximately 30% of the time
it is executed, according to my tests. This *only* occurs
with PostgreSQL > 7.1 in conjunction with php 4.0.6.
Switching to older versions of either eliminates the
bug,as does reformulating the SQL to contain the missing
FROM clauses. When the crash occurs, PostgreSQL logs:
NOTICE: Adding missing FROM-clause entry for table "bios"
pq_recvbuf: unexpected EOF on client connection
SCRIPT:
-------
<?
$link=pg_connect("dbname dbuser dbpass");
$q="SELECT name FROM users WHERE users.bio_id = bios.id
AND bios.id=1;
pg_exec($link,$q);
?>
SAMPLE TABLES:
--------------
CREATE TABLE users(char(20) name,int bio_id);
CREATE TABLE bios(id serial,char(20) name);
BACKTRACE:
----------
Program received signal SIGSEGV, Segmentation fault.
0x401d5f95 in shutdown_memory_manager (silent=1,
clean_cache=0) at zend_alloc.c:449
449
REMOVE_POINTER_FROM_LIST(ptr);
(gdb) bt
#0 0x401d5f95 in shutdown_memory_manager (silent=1,
clean_cache=0) at zend_alloc.c:449
#1 0x40200515 in php_request_shutdown (dummy=0x0) at
main.c:667
#2 0x401fdf93 in php_apache_request_shutdown (dummy=0x0)
at mod_php4.c:292
#3 0x080682a0 in run_cleanups ()
#4 0x08066a81 in ap_clear_pool ()
#5 0x08066b06 in ap_destroy_pool ()
#6 0x08066a6e in ap_clear_pool ()
#7 0x08076ff8 in child_main ()
#8 0x080775e4 in make_child ()
#9 0x08077758 in startup_children ()
#10 0x08077dd7 in standalone_main ()
#11 0x0807860f in main ()
#12 0x4009b1f0 in __libc_start_main () from /lib/libc.so.6
--
Edit bug report at: http://bugs.php.net/?id=13676&edit=1