coroutine: Fix setup of sigaltstack coroutines
PATCH 1/1 coroutine: Fix setup of sigaltstack coroutines
Use pthread_kill instead of process-wide kill to invoke the signal handler used for stack switching. This may fix spurious lock-ups with this backend, easily triggerable by extending the time window between kill and sigsuspend.
--- coroutine-sigaltstack.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
coroutine-sigaltstack.c +1 -1
@@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void)* called. */ coTS->tr_called =0 ; -kill (getpid (),SIGUSR2 ); +pthread_kill (pthread_self (),SIGUSR2 );sigfillset (&sigs);sigdelset (&sigs,SIGUSR2 );while (!coTS->tr_called) {
Signature · 1 line
1.7.3.4
Il 09/05/2012 19:23, Jan Kiszka ha scritto:
Quoted 15 lines
Use
pthread_killinstead of process-wide kill to invoke the signal handler used for stack switching. This may fix spurious lock-ups with this backend, easily triggerable by extending the time window between kill and sigsuspend.Signed-off-by Jan Kiszka <[email protected]>--- coroutine-sigaltstack.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)coroutine-sigaltstack.c +0
-0
coroutine-sigaltstack.c static Coroutine *coroutine_new(void) · line 232
Quoted 8 lines
coroutine-sigaltstack.c +1
-1@@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void)* called. */ coTS->tr_called =0 ; -kill (getpid (),SIGUSR2 ); +pthread_kill (pthread_self (),SIGUSR2 );sigfillset (&sigs);sigdelset (&sigs,SIGUSR2 );while (!coTS->tr_called) {
Kevin Wolf
AppliedAm 10.05.2012 09:29, schrieb Paolo Bonzini:
Quoted 11 lines
Il 09/05/2012 19:23, Jan Kiszka ha scritto:
Quoted 10 lines
Use
pthread_killinstead of process-wide kill to invoke the signal handler used for stack switching. This may fix spurious lock-ups with this backend, easily triggerable by extending the time window between kill and sigsuspend.Signed-off-by Jan Kiszka <[email protected]>--- coroutine-sigaltstack.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines
coroutine-sigaltstack.c static Coroutine *coroutine_new(void) · line 232
Quoted 13 lines
coroutine-sigaltstack.c +1
-1@@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void)* called. */ coTS->tr_called =0 ; -kill (getpid (),SIGUSR2 ); +pthread_kill (pthread_self (),SIGUSR2 );sigfillset (&sigs);sigdelset (&sigs,SIGUSR2 );while (!coTS->tr_called) {Reviewed-by Paolo Bonzini <[email protected]>
Thanks, applied to the block branch for 1.1.
Kevin