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

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 1030817..9d69af6 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1052,6 +1052,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