nanosleep blocks inifinity (internal rtems deathlock?) even CPU is in idle Task

Joel Sherrill joel.sherrill at OARcorp.com
Thu Nov 15 18:22:44 UTC 2012


On 11/15/2012 10:45 AM, Matthias Goldhoorn wrote:
> On 15.11.2012 14:52, Sebastian Huber wrote:
>> On 11/15/2012 01:26 PM, Matthias Goldhoorn wrote:
>>> On 15.11.2012 11:52, Sebastian Huber wrote:
>>>> On 11/15/2012 10:44 AM, Matthias Goldhoorn wrote:
>>>>> Hello Again,
>>>>> new Problem i got the debugger working (will port it later to the
>>>>> wiki, needed
>>>>> adaptations for the compiler and mentioned scripts).
>>>>>
>>>>> It seems there is an bugg inside of rtems. My Code calls nanosleep
>>>>> and never
>>>>> returnes from there.
>>>>> My main-cread is idling, so there is no higher priority process
>>>>> running. I
>>>>> wonder why my thread which has called nanosleep never returns...
>>>>> Any suggestions?
>>>> Do you have a clock driver configured, e.g.
>>>>
>>>> #define CONFIGURE_INIT
>>>>
>>>> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
>>>>
>>>> [...]
>>>>
>>>> #include <rtems/confdefs.h>
>>>>
>>> Yeah it's both defined.
>>> The nanosleep sometimes (mostly) works.
>>> Only if some interrupts during the sleep i got this non-awaking
>>> behavior it
>>> seems strange.
>>> Maybe broke my memory or stack anywhere. Could you tell me where the
>>> scheduler
>>> of rtems is located to that i can define a breakpoint into him and
>>> check why my
>>> thread is not waked up.
>>> I searching the timer interrupt function that really does the thread
>>> management.
>> Which BSP do you use and which RTEMS version?
>>
>> You can set a break point to rtems_clock_tick() to see if the system
>> timer works. It should update the timer of the nanosleep() task and
>> wake it up eventually.
>>
> I use an i386 currently and use quemu
>
> The rtems_clock_tick interrupt works unfortunately i don’t have any
> source code there to debug into it...
>
> Breakpoint 1, 0x0073272b in rtems_clock_tick ()
> (gdb) bt
> #0 0x0073272b in rtems_clock_tick ()
> #1 0x00701912 in Clock_isr ()
> #2 0x0070350b in bsp_interrupt_handler_dispatch ()
> #3 0x00703868 in C_dispatch_isr ()
> #4 0x0070bfd3 in nested ()
> #5 0x00000000 in ?? ()
You can use the "directory" command in gdb to point gdb to the right
directories.

Do you have a simple application we can look at?
> Greetings,
> Matthias
>
>
>
>


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985




More information about the users mailing list