php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dean dot bennett at home dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-01 13:24 UTC] hholzgra@php.net
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: Sat Dec 21 16:01:28 2024 UTC