File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,7 @@ frok::parent (volatile char * volatile stack_here)
329329 /* NEVER, EVER, call a function which in turn calls malloc&friends while this
330330 malloc lock is active! */
331331 __malloc_lock ();
332+ cygheap->lock ();
332333 bool locked = true ;
333334
334335 /* Remove impersonation */
@@ -483,6 +484,7 @@ frok::parent (volatile char * volatile stack_here)
483484 impure, impure_beg, impure_end,
484485 NULL );
485486
487+ cygheap->unlock ();
486488 __malloc_unlock ();
487489 locked = false ;
488490 if (!rc)
@@ -568,7 +570,10 @@ frok::parent (volatile char * volatile stack_here)
568570 if (fix_impersonation)
569571 cygheap->user .reimpersonate ();
570572 if (locked)
571- __malloc_unlock ();
573+ {
574+ cygheap->unlock ();
575+ __malloc_unlock ();
576+ }
572577
573578 /* Remember to de-allocate the fd table. */
574579 if (hchild)
Original file line number Diff line number Diff line change 2525
2626- Fix Ctrl-O (FLUSHO) handling.
2727 Addresses: https://cygwin.com/pipermail/cygwin/2025-August/258717.html
28+
29+ - Fix multi-thread safety of fork()/exec() by adding the same locking as was
30+ done for spawn.
31+ Addresses: https://cygwin.com/pipermail/cygwin/2025-September/258801.html
You can’t perform that action at this time.
0 commit comments