#32685 [Fbk->Opn]: Segfault when using assignment by reference within function

From: Date: Wed, 11 May 2005 13:17:47 +0000
Subject: #32685 [Fbk->Opn]: Segfault when using assignment by reference within function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78896@lists.php.net to get a copy of this message
ID: 32685 User updated by: david at davidheath dot org Reported By: david at davidheath dot org -Status: Feedback +Status: Open Bug Type: Reproducible crash Operating System: mandrake linux 10.1 PHP Version: 4CVS-2005-04-14 New Comment: Hi thanks for following this up. I tried with the snapshot you gave and still got the crash. I tried running it in gdb as well ('fraid I don't really know whether this helps or not). See below. Dave [heathd@dh dh]$ gdb GNU gdb 6.2-2mdk (Mandrakelinux) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-mandrake-linux-gnu". (gdb) file /usr/local/src/php4-STABLE-200505110647/sapi/cli/php Reading symbols from /usr/local/src/php4-STABLE-200505110647/sapi/cli/php...done. Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) run crash2.php Starting program: /usr/local/src/php4-STABLE-200505110647/sapi/cli/php crash2.php Program received signal SIGSEGV, Segmentation fault. 0x08111a41 in shutdown_memory_manager (silent=0, clean_cache=0) at /usr/local/src/php4-STABLE-200505110647/Zend/zend_alloc.c:530 530 REMOVE_POINTER_FROM_LIST(t); (gdb) quit Previous Comments: ------------------------------------------------------------------------ [2005-05-11 10:05:56] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ [2005-04-19 13:53:19] ericvanblokland at gmail dot com This maybe related to an issue I encountered. My guess is this code will work fine with php5 http://bugs.php.net/bug.php?id=31624 ------------------------------------------------------------------------ [2005-04-13 10:51:34] david at davidheath dot org > 1) Does it also crash when you replace file reading by > assignment from string? yes it does, see http://www.davidheath.org/php_bug/crash2.php.txt I've also noticed that I had a mistake in the original repro script (crash.php.txt), which I've now corrected (the filename on line 4 was wrong). This may explain why you couldn't repro. However, having changed that I now get: [heathd@localhost repro]$ /usr/local/php-4.3-CVS-13apr05/bin/php crash.php Content-type: text/html X-Powered-By: PHP/4.3.12-dev free(): invalid pointer 0x81b14a8! ALSO, another important observation. The crash sometimes seems to not happen if I execute the script in a different directory. For example: [heathd@localhost repro]$ pwd /tmp/repro [heathd@localhost repro]$ ls crash2.php [heathd@localhost repro]$ /usr/local/php-4.3-CVS-13apr05/bin/php crash2.php Content-type: text/html X-Powered-By: PHP/4.3.12-dev [heathd@localhost repro]$ mkdir -p foo/bar [heathd@localhost repro]$ cd foo/bar [heathd@localhost bar]$ cp ../../crash2.php . [heathd@localhost bar]$ /usr/local/php-4.3-CVS-13apr05/bin/php crash2.php Content-type: text/html X-Powered-By: PHP/4.3.12-dev Segmentation fault (core dumped) ------------------------------------------------------------------------ [2005-04-13 10:32:48] david at davidheath dot org Hi, I tried again with CVS HEAD (from PHP_4_3 branch). Still crashes. [heathd@localhost dh]$ /usr/local/php-4.3-CVS-13apr05/bin/php crash.php Content-type: text/html X-Powered-By: PHP/4.3.12-dev Segmentation fault (core dumped) [heathd@localhost dh]$ ------------------------------------------------------------------------ [2005-04-12 20:37:20] helly@php.net Two questions: 1) Does it also crash when you replace file reading by assignment from string? 2) Did you try 5.0 or HEAD? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/32685 -- Edit this bug report at http://bugs.php.net/?id=32685&edit=1

« previous php.bugs (#78896) next »