From: mdv at inyourpocket dot com
Operating system: Debian
PHP version: 5.0.5
PHP Bug Type: PostgreSQL related
Bug description: pg_copy_to SIGSEGV when 4th arg NULL
Description:
------------
pg_copy_to($db, 'x', "\t", NULL) causes SIGSEGV
NULL should be default values ???
Reproduce code:
---------------
$db = pg_connect('host=localhost dbname=template1 user=postgres');
pg_copy_to($db, 'x', "\t", NULL);
Expected result:
----------------
should be rewrited to pg_copy_to($db, 'x', "\t", '\N');
read data from table
Actual result:
--------------
Starting program: /usr/local/php/bin/php -f x.php
Program received signal SIGSEGV, Segmentation fault.
0x08196665 in _efree (ptr=0x82b6564) at
/root/src/php-5.0.5/Zend/zend_alloc.c:282
282 REMOVE_POINTER_FROM_LIST(p);
(gdb) bt
#0 0x08196665 in _efree (ptr=0x82b6564) at
/root/src/php-5.0.5/Zend/zend_alloc.c:282
#1 0x080f4b42 in zif_pg_copy_to (ht=4, return_value=0x83c8e44,
this_ptr=0x0, return_value_used=0) at
/root/src/php-5.0.5/ext/pgsql/pgsql.c:2674
#2 0x081cad32 in zend_do_fcall_common_helper (execute_data=0xbfffd974,
opline=0x83c325c, op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:2760
#3 0x081d8c57 in zend_do_fcall_handler (execute_data=0xbfffd974,
opline=0x83c325c, op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:2894
#4 0x081c8662 in execute (op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:1437
#5 0x081aab93 in zend_execute_scripts (type=8, retval=Variable "retval"
is not available.
) at /root/src/php-5.0.5/Zend/zend.c:1064
#6 0x08175ecb in php_execute_script (primary_file=0xbffffd10) at
/root/src/php-5.0.5/main/main.c:1643
#7 0x081df4aa in main (argc=3, argv=0xbffffdc4) at
/root/src/php-5.0.5/sapi/cli/php_cli.c:946
--
Edit bug report at http://bugs.php.net/?id=35168&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35168&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35168&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35168&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35168&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35168&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35168&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35168&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35168&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35168&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35168&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35168&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35168&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35168&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35168&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35168&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35168&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35168&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35168&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35168&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35168&r=mysqlcfg