|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-09 04:35 UTC] wez@php.net
[2003-06-09 04:46 UTC] devon at sitetronics dot com
[2003-06-09 08:36 UTC] sniper@php.net
[2003-06-15 23:45 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 09:00:01 2025 UTC |
Goofing around with shell scripting in PHP, I bumped into this problem. I scanned the other segfault bugs, but I didn't find one like this. Additionally, I haven't tried with any nightlies, so sorry, but here we go. When running a script with the CLI binary as so: # php -q < somescript.php I receive a segfault. This should work as PHP should parse stuff from stdin, and this is just a pipe. Copying the script to stdin when calling PHP as #php -q I'm able to run the script successfully. Additionally, I can run the script by doing # php -q somescript.php I'm positive that this is because I have PHP reading its pipe from stdin and then requesting user input from stdin as well. But PHP should die gracefully and not segfault. Oh yeah, here's the really strange backtrace #0 0x081299f8 in zend_parse_arg (arg_num=1, arg=0x402c039c, va=0xbf800834, spec=0xbf800824, quiet=0) at /root/build/php/php-4.3.1/Zend/zend_API.c:436 #1 0x08129df8 in zend_parse_va_args (num_args=2, type_spec=0x81568b6 "ss|br", va=0xbf800834, flags=0) at /root/build/php/php-4.3.1/Zend/zend_API.c:527 #2 0x08129e5b in zend_parse_parameters (num_args=2, type_spec=0x81568b6 "ss|br") at /root/build/php/php-4.3.1/Zend/zend_API.c:554 #3 0x080a9c8e in php_if_fopen (ht=2, return_value=0x81d5884, this_ptr=0x0, return_value_used=1) at /root/build/php/php-4.3.1/ext/standard/file.c:1086 #4 0x4027f922 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #5 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #6 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #7 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #8 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #9 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #10 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #11 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #12 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #13 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #14 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #15 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #16 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #17 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so ........... #11382 0x40285ae9 in _ntime () from /usr/local/ioncube/ioncube_loader_lin_4.3.so #11383 0x08102869 in php_execute_script (primary_file=0xbffffac0) at /root/build/php/php-4.3.1/main/main.c:1573 #11384 0x08143610 in main (argc=2, argv=0xbffffb64) at /root/build/php/php-4.3.1/sapi/cli/php_cli.c:746 #11385 0x401331c4 in __libc_start_main () from /lib/libc.so.6 Aha! But before you say "idiot, go email Nick", here's the backtrace with the loader turned off :P. It just proves that Nick's gotta fix his stuff also. #0 0x081299f8 in zend_parse_arg (arg_num=1, arg=0x824be44, va=0xbf800754, spec=0xbf800744, quiet=0) at /root/build/php/php-4.3.1/Zend/zend_API.c:436 #1 0x08129df8 in zend_parse_va_args (num_args=2, type_spec=0x81568b6 "ss|br", va=0xbf800754, flags=0) at /root/build/php/php-4.3.1/Zend/zend_API.c:527 #2 0x08129e5b in zend_parse_parameters (num_args=2, type_spec=0x81568b6 "ss|br") at /root/build/php/php-4.3.1/Zend/zend_API.c:554 #3 0x080a9c8e in php_if_fopen (ht=2, return_value=0x81d47c4, this_ptr=0x0, return_value_used=1) at /root/build/php/php-4.3.1/ext/standard/file.c:1086 #4 0x0813b09c in execute (op_array=0x81cffd0) at /root/build/php/php-4.3.1/Zend/zend_execute.c:1596 #5 0x0813b25a in execute (op_array=0x81d3e80) at /root/build/php/php-4.3.1/Zend/zend_execute.c:1640 #6 0x0813b25a in execute (op_array=0x81d3e80) at /root/build/php/php-4.3.1/Zend/zend_execute.c:1640 ..................... #3908 0x0813b25a in execute (op_array=0x81d2d98) at /root/build/php/php-4.3.1/Zend/zend_execute.c:1640 #3909 0x0813b25a in execute (op_array=0x81cab7c) at /root/build/php/php-4.3.1/Zend/zend_execute.c:1640 #3910 0x08128cac in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /root/build/php/php-4.3.1/Zend/zend.c:864 #3911 0x08102869 in php_execute_script (primary_file=0xbffffac0) at /root/build/php/php-4.3.1/main/main.c:1573 #3912 0x08143610 in main (argc=2, argv=0xbffffb64) at /root/build/php/php-4.3.1/sapi/cli/php_cli.c:746 #3913 0x401331c4 in __libc_start_main () from /lib/libc.so.6 Ok, that's it. Devon