Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35168 : pg_copy_to SIGSEGV when 4th arg NULL
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 21st April 09:00
php-bugs
External User
 
Posts: 1
Default #35168 : pg_copy_to SIGSEGV when 4th arg NULL


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
  Reply With Quote


  sponsored links


2 21st April 09:01
External User
 
Posts: 1
Default #35168 : pg_copy_to SIGSEGV when 4th arg NULL


ID: 35168
Updated by: tony2001@php.net
Reported By: mdv at inyourpocket dot com
-Status: Open
+Status: Feedback
Bug Type: PostgreSQL related
Operating System: Debian
PHP Version: 5.0.5
New Comment:

Please try using this CVS snapshot:

http://snaps.php.net/php5-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5-win32-latest.zip


Previous Comments:
------------------------------------------------------------------------

[2005-11-09 11:17:17] mdv at inyourpocket dot com

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 this bug report at http://bugs.php.net/?id=35168&edit=1
  Reply With Quote
3 21st April 09:01
php-bugs
External User
 
Posts: 1
Default #35168 : pg_copy_to SIGSEGV when 4th arg NULL


ID: 35168
User updated by: mdv at inyourpocket dot com
Reported By: mdv at inyourpocket dot com
-Status: Feedback
+Status: Open
Bug Type: PostgreSQL related
Operating System: Debian
PHP Version: 5.0.5
New Comment:

tested and OK

but when suplied optional arguments (3rd - delimiter, 4th - null_as)
there aren't substitued to default values (delimiter = "\t", null_as =
'\N') - is right behavior ?

thank you


Previous Comments:
------------------------------------------------------------------------

[2005-11-09 11:41:31] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5-win32-latest.zip

------------------------------------------------------------------------

[2005-11-09 11:17:17] mdv at inyourpocket dot com

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 this bug report at http://bugs.php.net/?id=35168&edit=1
  Reply With Quote
4 21st April 10:35
External User
 
Posts: 1
Default #35168 : pg_copy_to SIGSEGV when 4th arg NULL


ID: 35168
Updated by: sniper@php.net
Reported By: mdv at inyourpocket dot com
-Status: Open
+Status: Closed
Bug Type: PostgreSQL related
Operating System: Debian
PHP Version: 5.0.5
New Comment:

Yes, is right behaviour.


Previous Comments:
------------------------------------------------------------------------

[2005-11-09 13:18:03] mdv at inyourpocket dot com

tested and OK

but when suplied optional arguments (3rd - delimiter, 4th - null_as)
there aren't substitued to default values (delimiter = "\t", null_as =
'\N') - is right behavior ?

thank you

------------------------------------------------------------------------

[2005-11-09 11:41:31] tony2001@php.net

Please try using this CVS snapshot:

http://snaps.php.net/php5-latest.tar.gz

For Windows:

http://snaps.php.net/win32/php5-win32-latest.zip

------------------------------------------------------------------------

[2005-11-09 11:17:17] mdv at inyourpocket dot com

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 this bug report at http://bugs.php.net/?id=35168&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666