|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27183 userland stream wrapper segfaults on stream_write
Submitted: 2004-02-08 13:10 UTC Modified: 2004-02-11 12:02 UTC
From: Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4CVS-2004-02-08 (stable) OS: Mac OS X 10.3
Private report: No CVE-ID:
 [2004-02-08 13:10 UTC]


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-08 14:47 UTC]
seems to work with 4.3.3 but not with 4.3.4..
 [2004-02-08 16:20 UTC]
I could track the bug down to be introduced between 4.3.3 and 4.3.4 in 


I'm absolutely no Zend-Engine expert, therefore I can't really help you any further here or even trying to fix it by myself... But if you need more information, just ask ;)
 [2004-02-08 21:30 UTC]
Hmm, I couldn't replicate this on Panther. Nothing 
seemed to go wrong. What extensions are enabled in the 
build? Here's mine.

PHP Version => 4.3.5RC2-dev

System => Darwin hallmark 7.2.0 Darwin Kernel Version 
7.2.0: Thu Dec 11 16:20:23
 PST 2003; root:xnu/xnu-517.3.7.obj~1/RELEASE_PPC  Power 
Build Date => Jan 23 2004 18:48:26
Configure Command =>  './configure' '--prefix=/Users/
moriyoshi/local' '--with-config-file-path=/Users/
moriyoshi/Library/php-4' '--enable-gd' '--with-gd' '--
with-freetype-dir=/Users/moriyoshi/local' '--with-png-
dir=/Users/moriyoshi/local' '--with-jpeg-dir=/Users/
moriyoshi/local' '--with-zlib-dir=/usr' '--with-iconv=/
usr' '--enable-mbstring' '--enable-mbregex' '--enable-
exif' '--enable-shmop' '--enable-calendar' '--enable-
sockets' '--enable-wddx' '--enable-ftp' '--with-xsl=/
Users/moriyoshi/local' '--with-libxml-dir=/Users/
moriyoshi/local' '--with-mime-magic' '--with-apxs2=/
Users/moriyoshi/local/apache-2-dev-prefork/bin/apxs' '--

 [2004-02-08 21:36 UTC]
"--with-libxml-dir=" really wasn't meant to be there 
indeed :)

 [2004-02-09 04:27 UTC]
here's my config line

'./configure' '--with-config-file-path=/usr/local/bxphp/
apache/conf' '--prefix=/usr/local/bxphp/' '--with-apxs=/
usr/local/bxphp/apache/bin/apxs' '--with-dom=/sw/' '--
with-tidy=/usr/local/' '--with-zlib' '--with-mysql=/sw/' 
'--with-png-dir=/sw/' '--with-expat-dir=/sw/' '--with-
iconv=/sw/' '--with-iconv-dir=/sw/' '--with-xml=/sw/' 
'--with-gd' '--with-jpeg-dir=/sw/' '--enable-debug=no' 
'--with-mime-magic=/sw/share/file/magic.mime' '--with-
dom-xslt=/sw/' '--with-dom-exslt=/sw/'

I'll try with a minimal set of extensions and see if the 
problem persists.
 [2004-02-09 05:25 UTC]
it crashes even with the default config:

PHP Version => 4.3.5RC2

System => Darwin chregu.local 7.2.0 Darwin Kernel 
Version 7.2.0: Thu Dec 11 16:20:23 PST 2003; root:xnu/
xnu-517.3.7.obj~1/RELEASE_PPC  Power Macintosh
Build Date => Feb  9 2004 11:18:45
Configure Command =>  './configure' '--with-expat-dir=/
sw/' '--with-zlib'
 [2004-02-09 05:44 UTC]
I get the same crash with PHP 4.3.3..
# uname -a
Darwin foobar 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-344.49.obj~2/RELEASE_PPC  Power Macintosh powerpc

 [2004-02-09 13:33 UTC]
Finally I managed to reproduce the crash. It looks like 
--enable-debug suppresses the bus error. Really 
strange... Another endian issue?
 [2004-02-09 13:50 UTC]
Here's the patch:

The error is obvious: one shouldn't store a transient 
pointer to a transient zval that resides in the stack 
frame :)

 [2004-02-10 16:02 UTC]
moriyoshi's patch works for me.
 [2004-02-11 12:02 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Feb 28 12:01:53 2015 UTC