|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-16 03:12 UTC] bryan at eevolved dot com
[2001-10-16 05:01 UTC] mfischer@php.net
[2001-10-16 21:44 UTC] bryan at eevolved dot com
[2001-10-17 02:39 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 20 09:00:01 2025 UTC |
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