All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Markus Osterried <markus.osterried@domain.hid>
Cc: Xenomai-core@domain.hid
Subject: Re: [Xenomai-core] Error when exiting pSOS-task with return
Date: Wed, 19 Mar 2008 18:56:48 +0100	[thread overview]
Message-ID: <47E153E0.4070204@domain.hid> (raw)
In-Reply-To: <E5E9C6CC7DC8844A8DA7A9EFE7B5350E08F330@domain.hid>

Markus Osterried wrote:
> Hello Philippe,
> 
> sorry for the delay, I was on holiday a few days.
> 
>> PS: you may want to check whether forcing the task to secondary mode before calling t_delete(0) does not cause the issue to trigger again.
> 
> When forcing the task to secondary mode before returning from main function, the issue is triggered.
> When forcing the task to primary mode before returning from main function, there is no error.
> When using t_delete(0) there is no error, regardless of primary or secondary mode.
>

Ok, that makes sense; this must be an issue with a termination process going
through to the standard exit syscall path. I will try to reproduce it. Thanks.

> 
> Markus
> 
> 
> 
> -----Original Message-----
> From: Philippe Gerum [mailto:philippe.gerum@domain.hid] On Behalf Of Philippe Gerum
> Sent: Samstag, 8. März 2008 18:20
> To: Markus Osterried
> Cc: Xenomai-core@domain.hid
> Subject: Re: [Xenomai-core] Error when exiting pSOS-task with return
> 
> Markus Osterried wrote:
>> Hello,
>>  
>> with Xenomai 2.4 on Linux 2.6.18 on PowerPC I have seen the following trace:
>>  
>> Feb 26 19:37:25 (none) user.err kernel: BUG: sleeping function called 
>> from invalid context at kernel/rwsem.c:20 Feb 26 19:37:25 (none) 
>> user.warn kernel: in_atomic():0, irqs_disabled():1 Feb 26 19:37:25 
>> (none) user.warn kernel: Call Trace:
>> Feb 26 19:37:25 (none) user.warn kernel: [C19BFE50] [C000C114]
>> show_stack+0x58/0x188 (unreliable)
>> Feb 26 19:37:25 (none) user.warn kernel: [C19BFEA0] [C00128B0] 
>> __might_sleep+0xdc/0xf0 Feb 26 19:37:25 (none) user.warn kernel: 
>> [C19BFEC0] [C0032304]
>> down_read+0x24/0x58
>> Feb 26 19:37:25 (none) user.warn kernel: [C19BFED0] [C00192C8] 
>> exit_mm+0x34/0xec Feb 26 19:37:25 (none) user.warn kernel: [C19BFEF0] 
>> [C001B000] do_exit+0x21c/0x98c Feb 26 19:37:25 (none) user.warn 
>> kernel: [C19BFF30] [C001B810]
>> complete_and_exit+0x0/0x28
>> Feb 26 19:37:25 (none) user.warn kernel: [C19BFF40] [C00041A0]
>> ret_from_syscall+0x0/0x38
>>  
>>  
>> This happens (sometimes) when a pSOS-task exits by returning from its 
>> main function.
>> I have changed the return statement into t_delete(0) and there was no 
>> error anymore, so this isn't a major issue.
>>  
>> But anyway I would like to know whether this is a xenomai bug or it 
>> isn't allowed to exit a pSOS-task by returning from main function.
>> I have seen at end of psos_task_trampoline that there is a
>> pthread_exit() instead of a t_delete().
>>
> 
> It is allowed to exit the task body directly. Another possibility is a bug in old Adeos/ppc patch for 2.6.18, that would trigger when the nucleus has to relax the exiting thread. Anyway, this issue is queued for investigation here. Thanks.
> 
> PS: you may want to check whether forcing the task to secondary mode before calling t_delete(0) does not cause the issue to trigger again.
> 
>> Thanks
>> Markus
>>  
>>
>>
>> ----------------------------------------------------------------------
>> --
>>
>> _______________________________________________
>> Xenomai-core mailing list
>> Xenomai-core@domain.hid
>> https://mail.gna.org/listinfo/xenomai-core
> 
> 
> --
> Philippe.
> 


-- 
Philippe.


      reply	other threads:[~2008-03-19 17:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 13:52 [Xenomai-core] Error when exiting pSOS-task with return Markus Osterried
2008-03-08 17:20 ` Philippe Gerum
2008-03-19  8:27   ` Markus Osterried
2008-03-19 17:56     ` Philippe Gerum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E153E0.4070204@domain.hid \
    --to=rpm@xenomai.org \
    --cc=Xenomai-core@domain.hid \
    --cc=markus.osterried@domain.hid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.