#23396 [NEW]: Fix for debug mode assertion failure in the Win2000 native libraries of fdopen
| From: | ed000001 at hotmail dot com | Date: | Tue, 29 Apr 2003 04:24:57 +0000 |
| Subject: | #23396 [NEW]: Fix for debug mode assertion failure in the Win2000 native libraries of fdopen | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-38673@lists.php.net to get a copy of this message | ||
From: ed000001 at hotmail dot com
Operating system: Win2000 - Debug Mode
PHP version: 4.3.1
PHP Bug Type: Reproducible crash
Bug description: Fix for debug mode assertion failure in the Win2000 native libraries of fdopen
Problem:
Initialization phase (before script) debug mode assertion failure in the
Win32 native libraries where "fdopen.c" is implemented when compiling
"php4ts_cli" in "Win32 Debug_TS".
Development Environment "Fix":
Do not call dup() for the Win32 platform -- I have not check the
implications as this is not my prod environment.
File php_fopen_wrapper.c:
=========================
#ifdef PHP_WIN32
#define FIX_DUP(a) (a)
#else
#define FIX_DUP(a) (dup((a))
#endif
php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char
*path, char *mode, int options, char **opened_path, php_stream_context
*context STREAMS_DC TSRMLS_DC)
{
FILE * fp = NULL;
php_stream * stream = NULL;
if (!strncasecmp(path, "php://", 6))
path += 6;
if (!strcasecmp(path, "output")) {
return php_stream_alloc(&php_stream_output_ops, NULL, 0, "wb");
}
if (!strcasecmp(path, "input")) {
return php_stream_alloc(&php_stream_input_ops, NULL, 0, "rb");
}
if (!strcasecmp(path, "stdin")) {
fp = fdopen(FIX_DUP(STDIN_FILENO), mode);
} else if (!strcasecmp(path, "stdout")) {
fp = fdopen(FIX_DUP(STDOUT_FILENO), mode);
} else if (!strcasecmp(path, "stderr")) {
fp = fdopen(FIX_DUP(STDERR_FILENO), mode);
}
if (fp) {
stream = php_stream_fopen_from_file(fp, mode);
if (stream == NULL)
fclose(fp);
}
return stream;
}
Thanks for the great tool!
Ed
--
Edit bug report at http://bugs.php.net/?id=23396&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23396&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23396&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23396&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23396&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23396&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23396&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23396&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23396&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23396&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23396&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23396&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23396&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23396&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23396&r=gnused