|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54535 WSA cleanup executes before MSHUTDOWN
Submitted: 2011-04-15 02:00 UTC Modified: 2016-08-06 02:07 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: dylan dot arnold at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2011-04-14 (snap) OS: Windows
Private report: No CVE-ID: None
 [2011-04-15 02:00 UTC] dylan dot arnold at gmail dot com
I have a custom PHP extension and when debugging in windows I found that winsock 
is shutdown by PHP before my extensions MSHUTDOWN is run.

This is a problem because I do my own graceful shutdown of a stream in 

Inside main/main.c in php_module_shutdown

WSACleanup() executes before zend_shutdown(TSRMLS_C)

The cleanup really needs to be done after zend_shutdown.

This is not a major considering I primarily develop in linux but surely this 
could be a problem for others.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-29 23:50 UTC]
-Package: Unknown/Other Function +Package: Scripting Engine problem
 [2016-08-06 02:07 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2016-08-06 02:07 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed for 7.2
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 01 09:03:38 2023 UTC