|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4008 PHP crashes in module shutdown
Submitted: 2000-04-03 06:39 UTC Modified: 2002-10-01 13:24 UTC
From: dean dot bennett at home dot com Assigned:
Status: Wont fix Package: Reproducible Crash
PHP Version: 3.0.15 OS: Windows 98 & NT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
33 - 24 = ?
Subscribe to this entry?

 [2000-04-03 06:39 UTC] dean dot bennett at home dot com
I have been porting the Sybase module to work on Windows platforms, and had a crash that would occur after php processed the file.  It would occur if the dll was loaded with extension= in the php3.ini file, but NOT if the dll was loaded with the dl() function.

The sybase module allocates some memory in the php3_rinit_sybase() function and releases it in php3_rshutdown_sybase().  The crash occurs in the efree call (which does a memset to the memory when the module is compiled in DEBUG mode).

In main.c, the function php3_module_startup() calls start_memory_manager(), a bunch of init routines, module_startup_modules(), and then shutdown_memory_manager().  The call to  shutdown_memory_manager() nukes the memory on Windows (fills it with 0xdd), which causes it to crash when it tries to free the memory when the module shutdown is called.

Removing the call to shutdown_memory_manager() prevents the crash.  It seems a little odd to shutdown the memory manager in a startup routine.  Perhaps this was meant to be called if the module startups failed?

This only seems to happen on Windows platforms, I haven't seen a problem yet on any Unix platforms.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 13:24 UTC]
We are sorry, but can not support PHP 3 related problems anymore.
Momentum is gathering for PHP 5, and we think supporting PHP 3 will
lead to a waste of resources which we want to put into getting PHP 5
ready. Ofcourse PHP 4 will will continue to be supported for the
forseeable future.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 00:01:28 2024 UTC