Bug #1177: pg_fetch_array($res,0) crashing Apache when query empty

From: Date: Mon, 22 Feb 1999 12:41:02 +0000
Subject: Bug #1177: pg_fetch_array($res,0) crashing Apache when query empty
Groups: php.dev 
Request: Send a blank email to php-dev+get-4246@lists.php.net to get a copy of this message
From: hendrik@sdn.co.za Operating system: Solaris 2.6 PHP version: 3.0.6 PHP Bug Type: PostgreSQL related Bug description: pg_fetch_array($res,0) crashing Apache when query empty Have a problem getting phplib-6.1 to work under Solaris 2.6 Althought it's working under Linux with the same configuration... The problem is also demonstrated with the following: <? $id=pg_connect("host=localhost port=5432 user=www dbname=poe_sessions"); $res=pg_exec($id,"select * from active_sessions;"); $arr=pg_fetch_array($res,0); ?> Although $arr should be false, the system crashes. Interesting it mostly returns some error, and the next invocation of THAT httpd then crashes the server. Sofar I can't get my finger on the part in phplib that triggers the error, but it's sending and receiving cooking info, and then when it's suppose to display something, it crashes with the following dbx backtrace info: signal SEGV (no mapping at the fault address) in strlen at 0xef524614 0xef524614: strlen+0x0080: ld [%o1], %o2 Current function is ap_invoke_handler 505 result = (*handp->hr.handler) (r); (dbx) frame -v 0xef21c0b8: send_parsed_php3+0x0018: call 0xef28854c [PLT 21: send_php3] (dbx) frame 13 (dbx) where -v [1] strlen(0x0, 0x0, 0xefffbd18, 0x7efefeff, 0x81010100, 0xff0000), at 0xef524614 [2] _doprnt(0xef260cf0, 0x0, 0x0, 0x0, 0x81010100, 0xff0000), at 0xef55a4c4 [3] snprintf(0xefffbd90, 0x400, 0xef260ce0, 0xef2aaa00, 0x325b8, 0x3104), at 0xef563900 [4] debugger_send_string(0xef260d70, 0x0, 0xef260d58, 0xefffc208, 0xb2550, 0x11), at 0xef227858 [5] php3_debugger_frame_location(0x98b98, 0x0, 0x0, 0xb15b0, 0x97b58, 0x3e), at 0xef227b3c [6] php3_debugger_error(0x0, 0xef2cca20, 0x97b58, 0x3e, 0xef2cc990, 0x0), at 0xef227d9c [7] php3_error(0x8, 0xef2654c0, 0xefffd738, 0xef2cc870, 0x97b58, 0x970b8), at 0xef21d530 [8] php3_pgsql_fetch_array(0x9d768, 0xef2bbb00, 0xef2cc600, 0xef2cc9cc, 0xef241330, 0x39), at 0xef241344 [9] phpparse(0xc6, 0xefffea5c, 0x0, 0xefffe9c0, 0xc8, 0xefffdd40), at 0xef252bfc [10] php3_parse(0x1, 0xef28c430, 0xef2cca2c, 0x2, 0x0, 0x0), at 0xef21ee04 [11] apache_php3_module_main(0x54dc8, 0x13, 0x0, 0x0, 0x0, 0xef2cc870), at 0xef21f110 [12] send_php3(0x54dc8, 0x0, 0x0, 0x0, 0x0, 0x559b8), at 0xef21c028 =>[13] send_parsed_php3(0x54dc8, 0xef25f430, 0x0, 0x0, 0x70687033, 0x70687033), at 0xef21c0b8 [14] ap_invoke_handler(r = 0x54dc8), line 505 in "http_config.c" [15] process_request_internal(r = 0x54dc8), line 1201 in "http_request.c" [16] ap_process_request(r = 0x54dc8), line 1217 in "http_request.c" [17] child_main(child_num_arg = 0), line 3852 in "http_main.c" [18] make_child(s = 0x20ca0, slot = 0, now = 919686539), line 3924 in "http_main.c" [19] startup_children(number_to_start = 2), line 4004 in "http_main.c" [20] standalone_main(argc = 2, argv = 0xeffff1f4), line 4291 in "http_main.c" [21] ap_main(argc = 2, argv = 0xeffff1f4), line 4592 in "http_main.c" [22] main(argc = 2, argv = 0xeffff1f4), line 6021 in "http_main.c" -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4246) next »