[Xenomai-git] Jan Kiszka : sigtest: Fix hard lock-up on disabled auto-shadowing
Module: xenomai-2.5 Branch: master Commit: 539e7ab7ed17029396153bca0de3ff1acbd99d44 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=539e7ab7ed17029396153bca0de3ff1acbd99d44 Author: Jan Kiszka Date: Sat Mar 6 09:45:33 2010 +0100 sigtest: Fix hard lock-up on disabled auto-shadowing Perform manual shadowing of the sigtest main thread and catch the case that this did not happen in the kernel part. Signed-off-by: Jan Kiszka --- ksrc/drivers/testing/sigtest_module.c |3 +++ src/testsuite/sigtest/sigtest.c |4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ksrc/drivers/testing/sigtest_module.c b/ksrc/drivers/testing/sigtest_module.c index e4235f1..f123382 100644 --- a/ksrc/drivers/testing/sigtest_module.c +++ b/ksrc/drivers/testing/sigtest_module.c @@ -28,6 +28,9 @@ static void sigtest_timer_handler(xntimer_t *timer) static int __sigtest_queue(struct pt_regs *regs) { target = xnshadow_thread(current); + if (!target) + return -EPERM; + nr_sigs = (size_t)__xn_reg_arg2(regs); sigs = xnmalloc(sizeof(*sigs) * nr_sigs); next_sig = 0; diff --git a/src/testsuite/sigtest/sigtest.c b/src/testsuite/sigtest/sigtest.c index 93c3e5a..09043ad 100644 --- a/src/testsuite/sigtest/sigtest.c +++ b/src/testsuite/sigtest/sigtest.c @@ -166,8 +166,12 @@ void *dual_signals2(void *cookie) int main(void) { + struct sched_param sparam = { .sched_priority = 1 }; + mlockall(MCL_CURRENT | MCL_FUTURE); + pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam); + int one_restart[] = { -ERESTART, }; mysh = mark_seen; seen = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : sigtest: Fix hard lock-up on disabled auto-shadowing
Module: xenomai-jki Branch: queues/assorted Commit: 80c13398bcce74db69b24adc2aae1a4b661ef434 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=80c13398bcce74db69b24adc2aae1a4b661ef434 Author: Jan Kiszka Date: Sat Mar 6 09:45:33 2010 +0100 sigtest: Fix hard lock-up on disabled auto-shadowing Perform manual shadowing of the sigtest main thread and catch the case that this did not happen in the kernel part. Signed-off-by: Jan Kiszka --- ksrc/drivers/testing/sigtest_module.c |3 +++ src/testsuite/sigtest/sigtest.c |4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ksrc/drivers/testing/sigtest_module.c b/ksrc/drivers/testing/sigtest_module.c index e4235f1..f123382 100644 --- a/ksrc/drivers/testing/sigtest_module.c +++ b/ksrc/drivers/testing/sigtest_module.c @@ -28,6 +28,9 @@ static void sigtest_timer_handler(xntimer_t *timer) static int __sigtest_queue(struct pt_regs *regs) { target = xnshadow_thread(current); + if (!target) + return -EPERM; + nr_sigs = (size_t)__xn_reg_arg2(regs); sigs = xnmalloc(sizeof(*sigs) * nr_sigs); next_sig = 0; diff --git a/src/testsuite/sigtest/sigtest.c b/src/testsuite/sigtest/sigtest.c index 93c3e5a..09043ad 100644 --- a/src/testsuite/sigtest/sigtest.c +++ b/src/testsuite/sigtest/sigtest.c @@ -166,8 +166,12 @@ void *dual_signals2(void *cookie) int main(void) { + struct sched_param sparam = { .sched_priority = 1 }; + mlockall(MCL_CURRENT | MCL_FUTURE); + pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam); + int one_restart[] = { -ERESTART, }; mysh = mark_seen; seen = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : sigtest: Fix hard lock-up on disabled auto-shadowing
Module: xenomai-jki Branch: for-upstream Commit: 80c13398bcce74db69b24adc2aae1a4b661ef434 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=80c13398bcce74db69b24adc2aae1a4b661ef434 Author: Jan Kiszka Date: Sat Mar 6 09:45:33 2010 +0100 sigtest: Fix hard lock-up on disabled auto-shadowing Perform manual shadowing of the sigtest main thread and catch the case that this did not happen in the kernel part. Signed-off-by: Jan Kiszka --- ksrc/drivers/testing/sigtest_module.c |3 +++ src/testsuite/sigtest/sigtest.c |4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ksrc/drivers/testing/sigtest_module.c b/ksrc/drivers/testing/sigtest_module.c index e4235f1..f123382 100644 --- a/ksrc/drivers/testing/sigtest_module.c +++ b/ksrc/drivers/testing/sigtest_module.c @@ -28,6 +28,9 @@ static void sigtest_timer_handler(xntimer_t *timer) static int __sigtest_queue(struct pt_regs *regs) { target = xnshadow_thread(current); + if (!target) + return -EPERM; + nr_sigs = (size_t)__xn_reg_arg2(regs); sigs = xnmalloc(sizeof(*sigs) * nr_sigs); next_sig = 0; diff --git a/src/testsuite/sigtest/sigtest.c b/src/testsuite/sigtest/sigtest.c index 93c3e5a..09043ad 100644 --- a/src/testsuite/sigtest/sigtest.c +++ b/src/testsuite/sigtest/sigtest.c @@ -166,8 +166,12 @@ void *dual_signals2(void *cookie) int main(void) { + struct sched_param sparam = { .sched_priority = 1 }; + mlockall(MCL_CURRENT | MCL_FUTURE); + pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam); + int one_restart[] = { -ERESTART, }; mysh = mark_seen; seen = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git