When sending SIGTSTP to a multi-threaded process, it can ends up hanging forever. Here's an example, courtesy of espie@:
$ mpv madalena.mp3 After pressing 'Ctrl+z' here's how the process state looks like: PID TID PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND 8461 521030 28 0 19M 19M stop/3 - 0:00 0.00% mpv 8461 339819 28 0 19M 19M idle suspend 0:00 0.00% mpv 8461 421936 2 0 19M 19M stop/2 - 0:00 0.00% mpv 8461 620909 28 0 19M 19M stop/1 - 0:00 0.00% mpv 8461 411755 28 0 19M 19M stop/2 - 0:00 0.00% mpv In ddb(4), here's what I get for the sleeping thread: tsleep(ffff8000fffee4a8,3,0,ffff800033359108) at tsleep+0xc4 single_thread_set(ffff800033359058,ffff8000fffee4a8,0) at single_thread_set+0x1a8 exit1(ffff8000fffee4a8,12,0) at exit1+0x46 postsig(ffff80003379e4f0) at postsig+0x3a7 userret(ffff8000fffee4a8) at userret+0x87 syscall() at syscall+0x2f0 --- syscall (number 4) --- I'm not sure to understand why postsig() calls sigexit() and if that's the problem. However I couldn't manage to reproduce this problem on a single CPU machine, so I'm believing there's a race somewhere. Any pointer?
