STM32F4 failure on semaphore release in termios.

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Sep 2 11:20:39 UTC 2013


On 2013-08-31 23:07, Karel Gardas wrote:
> On 08/30/13 08:58 AM, Sebastian Huber wrote:
>> On 2013-08-28 23:30, Karel Gardas wrote:
>>> _Internal_error_Occurred (the_source=RTEMS_FATAL_SOURCE_EXCEPTION,
>>> is_internal=false, the_error=536875260)
>>
>> If you get an exception like this, then you can use in GDB to figure out
>> the context (the actual program counter of the exception is not the
>> direct value of register_pc):
>>
>> Breakpoint 6, _Internal_error_Occurred
>> (the_source=RTEMS_FATAL_SOURCE_EXCEPTION, is_internal=false,
>> the_error=1049524) at
>> ../../../../../../rtems/c/src/../../cpukit/score/src/interr.c:35
>> 35 _User_extensions_Fatal( the_source, is_internal, the_error );
>> (gdb) p/x *(CPU_Exception_frame *)the_error
>> $1 = {
>
> Thanks for this nice trick!
>
> (gdb) p/x *(CPU_Exception_frame *)the_error
> $2 = {register_r0 = 0x20006acc, register_r1 = 0x1a010004, register_r2 = 0x0,
> register_r3 = 0x1a010003, register_r4 = 0x20006ab8, register_r5 = 0x20001794,
> register_r6 = 0x20006d80, register_r7 = 0x20003c70, register_r8 = 0x20003e7c,
> register_r9 = 0x20001440, register_r10 = 0x0, register_r11 = 0x18fc0,
> register_r12 = 0x0, register_sp = 0x0, register_lr = 0xe57b, register_pc =
> 0xe584, register_xpsr = 0x21000000, vector = 0x3, vfp_context = 0x1}
> (gdb) dis 0xe584
> warning: bad breakpoint number at or near '0xe584'
> (gdb) disas 0xe584
> Dump of assembler code for function _Chain_Get_first_unprotected:
>     0x0000e56c <+0>:     push    {r7, lr}
>     0x0000e56e <+2>:     sub    sp, #24
>     0x0000e570 <+4>:     add    r7, sp, #0
>     0x0000e572 <+6>:     str    r0, [r7, #4]
>     0x0000e574 <+8>:     ldr    r0, [r7, #4]
>     0x0000e576 <+10>:    bl    0xe4d8 <_Chain_Head>
>     0x0000e57a <+14>:    str    r0, [r7, #20]
>     0x0000e57c <+16>:    ldr    r3, [r7, #20]
>     0x0000e57e <+18>:    ldr    r3, [r3, #0]

Above you read head->next.

>     0x0000e580 <+20>:    str    r3, [r7, #16]
>     0x0000e582 <+22>:    ldr    r3, [r7, #16]
>     0x0000e584 <+24>:    ldr    r3, [r3, #0]

Above you read head->next->next;

I think its the instruction above which fails since r3 has a bogus value of 
0x1a010003.  It looks like that the chain is corrupt.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list