From:             [EMAIL PROTECTED]
Operating system: Linux and NetBSD
PHP version:      4.2.3
PHP Bug Type:     Reproducible crash
Bug description:  $a = "boo"; printf("%580.58s\n", $a); Segfaults

The oops:
8<-------------
jeroen@noc:~$ ulimit -c unlimited
jeroen@noc:~$ php4
<?php $a = "boo"; printf("%580.58s\n", $a); ?>
Segmentation fault (core dumped)
------------->8

The system:
8<-------------
jeroen@noc:~$ uname -a
Linux noc 2.4.18 #1 Wed May 29 22:19:46 CEST 2002 i686 Intel(R)
Celeron(TM) CPU
               1200MHz GenuineIntel GNU/Linux
------------->8
It's Debian unstable, current as of 26-Oct-2002

Relevant Debian packages:
ii  libc6          2.3.1-3
ii  php4-cgi       4.2.3-3

Backtrace:
8<--------------
(gdb) bt
#0  0x402711af in mallopt () from /lib/libc.so.6
#1  0x4027001f in realloc () from /lib/libc.so.6
#2  0x080dd7a3 in _erealloc ()
#3  0x080a6b6a in php_if_stat ()
#4  0x080a8804 in zif_user_printf ()
#5  0x0810c060 in execute ()
#6  0x080ea428 in zend_execute_scripts ()
#7  0x080664cd in php_execute_script ()
#8  0x08064363 in main ()
#9  0x4021b9d3 in __libc_start_main () from /lib/libc.so.6
(gdb) q
-------------->8

I've also tested it on NetBSD, which also segfaulted apache and gave back
a whole lot of wrong things (buffer from previous sessions).

OpenBSD 3.1 + FreeBSD 4.6-RELEASE didn't have this problem
so this could quite well be glibc related, see the traceback above.


-- 
Edit bug report at http://bugs.php.net/?id=20108&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20108&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20108&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20108&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20108&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20108&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20108&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20108&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20108&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20108&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20108&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20108&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20108&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20108&r=isapi

Reply via email to