@@ -752,20 +752,34 @@ func sighandler(sig uint32, info *siginfo, ctxt unsafe.Pointer, gp *g) {
752
752
}
753
753
754
754
if docrash {
755
+ isCrashThread := false
756
+ if crashing == 0 {
757
+ isCrashThread = true
758
+ }
755
759
crashing ++
756
760
if crashing < mcount ()- int32 (extraMLength .Load ()) {
757
761
// There are other m's that need to dump their stacks.
758
762
// Relay SIGQUIT to the next m by sending it to the current process.
759
763
// All m's that have already received SIGQUIT have signal masks blocking
760
764
// receipt of any signals, so the SIGQUIT will go to an m that hasn't seen it yet.
761
- // When the last m receives the SIGQUIT, it will fall through to the call to
762
- // crash below. Just in case the relaying gets botched, each m involved in
765
+ // The first m will wait until all ms received the SIGQUIT, then crash/exit.
766
+ // Just in case the relaying gets botched, each m involved in
763
767
// the relay sleeps for 5 seconds and then does the crash/exit itself.
764
- // In expected operation, the last m has received the SIGQUIT and run
765
- // crash/exit and the process is gone, all long before any of the
766
- // 5-second sleeps have finished.
768
+ // In expected operation, the first m will wait until the last m has received the SIGQUIT,
769
+ // and then run crash/exit and the process is gone.
770
+ // However, if it spends more than 5 seconds to send SIGQUIT to all ms,
771
+ // any of ms may crash/exit the process after waiting for 5 seconds.
767
772
print ("\n -----\n \n " )
768
773
raiseproc (_SIGQUIT )
774
+ }
775
+ // fix #63277
776
+ if isCrashThread {
777
+ i := 0
778
+ for (crashing < mcount ()- int32 (extraMLength .Load ()) && i < 10 ) {
779
+ i ++
780
+ usleep (500 * 1000 )
781
+ }
782
+ } else {
769
783
usleep (5 * 1000 * 1000 )
770
784
}
771
785
printDebugLog ()
0 commit comments