Module: xenomai-jki
Branch: for-upstream
Commit: feac8c921112fe85282d485a38bcb57219cd4896
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=feac8c921112fe85282d485a38bcb57219cd4896

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Mon Jul 18 22:38:57 2011 +0200

nucleus: Process signals ignored during task migration

We failed to process signals arriving after suspending the Linux task
and before migrating it to the Xenomai domain in the gatekeeper thread.
Fix this by checking for pending signals at the end of xnshadow_harden.

This may resolve rare lockups of gdb when stopping applications on SMP
systems.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 ksrc/nucleus/shadow.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index fe1dac9..fe7e504 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1049,6 +1049,19 @@ redo:
        trace_mark(xn_nucleus, shadow_hardened, "thread %p thread_name %s",
                   thread, xnthread_name(thread));
 
+       /*
+        * Recheck pending signals once again. As we block task wakeups during
+        * the migration and do_sigwake_event ignores signals until XNRELAX is
+        * left, any signal between entering TASK_ATOMICSWITCH and starting
+        * the migration in the gatekeeker thread is just silently queued up
+        * to here.
+        */
+       if (signal_pending(this_task)) {
+               xnshadow_relax(!xnthread_test_state(thread, XNDEBUG),
+                              SIGDEBUG_MIGRATE_SIGNAL);
+               return -ERESTARTSYS;
+       }
+
        xnsched_resched_after_unlocked_switch();
 
        return 0;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to