From 3521d504804b8c43c93ade54c67716308c0c7d03 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 4 May 2011 16:02:45 +0000 Subject: * dll_init.cc (dll_global_dtors): Avoid calling destructors during failing fork(). --- winsup/cygwin/dll_init.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/cygwin/dll_init.cc') diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc index 85f3bae3f..99974944b 100644 --- a/winsup/cygwin/dll_init.cc +++ b/winsup/cygwin/dll_init.cc @@ -37,6 +37,11 @@ static bool dll_global_dtors_recorded; void dll_global_dtors () { + /* Don't attempt to call destructors if we're still in fork processing + since that likely means fork is failing and everything will not have been + set up. */ + if (in_forkee) + return; int recorded = dll_global_dtors_recorded; dll_global_dtors_recorded = false; if (recorded && dlls.start.next) -- cgit v1.2.3