|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10263 Use of istdiostream w/o HAVE_CLASS_ISTDIOSTREAM protection
Submitted: 2001-04-10 12:00 UTC Modified: 2001-08-18 12:05 UTC
From: spc at sgi dot com Assigned: zeev (profile)
Status: Closed Package: iPlanet related
PHP Version: 4.0.4pl1 OS: SGI IRIX 6.5.x
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: spc at sgi dot com
New email:
PHP Version: OS:


 [2001-04-10 12:00 UTC] spc at sgi dot com
I am trying to build the NSAPI module for use on SGI MIPS/IRIX hardware, using
SGI's MIPSpro compilers (we provide binaries in SGI's "inst" format on our
Freeware web site at <URL:>).  Since NSAPI is built
using the Zend Thread Safety enabled, some stdiostream code is included.

Configure is correctly determining that HAVE_STDIOSTREAM_H should be
defined (include file <stdiostream.h> is found), and that HAVE_CLASS_ISTDIOSTREAM should be undefined (no class istdiostream exists in the compiler version I am using).   This is correctly being done in the main/php_config.h file.  In the source file, there is a section which reads

#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM)
class istdiostream : public istream
        stdiobuf _file;
        istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
        stdiobuf* rdbuf()/* const */ { return &_file; }

so that later code in that file will correctly build and work when class istdiostream is used.

In the source file, though, the class istdiostream is
used in/around line 511, without the protection of HAVE_CLASS_ISTDIOSTREAM.
Since this class doesn't exist, the build fails.

I have been able to work around this by adding a section to the #ifdef ZTS
region starting in/around line 408:

#ifdef ZTS
#  include <stdiostr.h>
# endif
#  include <stdiostream.h>
# endif
# ifdef ZEND_WIN32
#  include <strstrea.h>
# else
#  include <strstream.h>
# endif
/* new stuff starts here.... */
class istdiostream : public istream
        stdiobuf _file;
        istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
        stdiobuf* rdbuf()/* const */ { return &_file; }
# endif
/* ... and ends here */

After this change, the NSAPI module successfully builds---I haven't had
the chance to test it yet.

  Steve Crockett

P.S.  Is there a way to get information on the IRIX build of PHP into your manual?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-23 06:13 UTC]
Assigning this to Zeev. He knows the Zend stuff best.


 [2001-08-18 12:05 UTC]
We no longer use C++ for the thread safe scanner, as of 4.0.7 (due out soon), so this problem should be gone.
 [2022-12-15 06:42 UTC] allhddcomny at gmail dot com
You can fix this bug using this link
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 22:01:28 2024 UTC