RTEMS4.10 _Heap_Block_allocate

Kate Feng feng at bnl.gov
Sun Jul 24 20:35:46 UTC 2011


I tested one application under RTEMS4.10, and it got an exception 3 error
at one point of run time  while malloc() is called. What puzzled me is that
the line that called malloc() works fine at other time under RTEMS4.10.
It does not seem to be out of memory issue that I could not identify S/W
bug in my application. The application always ran fine under 4.9.4 and 4.8.

Attached is the assembly code, which shows where the exception 3 occurred.
Any pointer, please ?

Regards,
Kate

00222dec <_Heap_Block_allocate>:
   222dec:    94 21 ff e0     stwu    r1,-32(r1)
   222df0:    7c 08 02 a6     mflr    r0
   222df4:    7c 88 23 78     mr      r8,r4
   222df8:    90 01 00 24     stw     r0,36(r1)
   222dfc:    93 c1 00 18     stw     r30,24(r1)
   222e00:    7c 7e 1b 78     mr      r30,r3
   222e04:    93 e1 00 1c     stw     r31,28(r1)
   222e08:    7c 9f 23 78     mr      r31,r4
   222e0c:    80 04 00 04     lwz     r0,4(r4)
   222e10:    93 a1 00 14     stw     r29,20(r1)
   222e14:    54 00 00 3c     rlwinm  r0,r0,0,0,30
   222e18:    7d 24 02 14     add     r9,r4,r0
   222e1c:    38 05 ff f8     addi    r0,r5,-8
   222e20:    81 29 00 04     lwz     r9,4(r9)
   222e24:    7d 44 00 50     subf    r10,r4,r0
   222e28:    71 27 00 01     andi.   r7,r9,1
   222e2c:    7c 69 1b 78     mr      r9,r3
   222e30:    40 82 00 40     bne-    222e70 <_Heap_Block_allocate+0x84>
   222e34:    81 63 00 38     lwz     r11,56(r3)
   222e38:    81 23 00 40     lwz     r9,64(r3)
   222e3c:    80 83 00 30     lwz     r4,48(r3)
   222e40:    39 6b ff ff     addi    r11,r11,-1
   222e44:    39 29 00 01     addi    r9,r9,1
   222e48:    91 63 00 38     stw     r11,56(r3)
   222e4c:    91 23 00 40     stw     r9,64(r3)
   222e50:    81 7f 00 08     lwz     r11,8(r31)
   222e54:    81 3f 00 0c     lwz     r9,12(r31)
   222e58:    80 ff 00 04     lwz     r7,4(r31)

Exception 3 at :
   222e5c:    91 2b 00 0c     stw     r9,12(r11)


   222e60:    54 e7 00 3c     rlwinm  r7,r7,0,0,30
   222e64:    91 69 00 08     stw     r11,8(r9)
   222e68:    7c e7 20 50     subf    r7,r7,r4
   222e6c:    90 e3 00 30     stw     r7,48(r3)
   222e70:    81 7e 00 10     lwz     r11,16(r30)
   222e74:    7f 8a 58 40     cmplw   cr7,r10,r11
   222e78:    41 9c 00 d4     blt-    cr7,222f4c 
<_Heap_Block_allocate+0x160>
   222e7c:    7f a5 5b 96     divwu   r29,r5,r11
   222e80:    80 fe 00 30     lwz     r7,48(r30)
   222e84:    81 5f 00 04     lwz     r10,4(r31)
   222e88:    7f bd 59 d6     mullw   r29,r29,r11
   222e8c:    7f bd 28 50     subf    r29,r29,r5
   222e90:    7f bd 00 50     subf    r29,r29,r0
   222e94:    7c 1f e8 50     subf    r0,r31,r29
   222e98:    7d 67 02 14     add     r11,r7,r0
   222e9c:    91 7e 00 30     stw     r11,48(r30)
   222ea0:    81 7f 00 04     lwz     r11,4(r31)
   222ea4:    71 67 00 01     andi.   r7,r11,1
   222ea8:    40 82 00 7c     bne-    222f24 <_Heap_Block_allocate+0x138>
   222eac:    81 7f 00 00     lwz     r11,0(r31)
   222eb0:    7d 25 4b 78     mr      r5,r9
   222eb4:    7f eb f8 50     subf    r31,r11,r31
   222eb8:    81 3f 00 04     lwz     r9,4(r31)
   222ebc:    55 29 00 3c     rlwinm  r9,r9,0,0,30
   222ec0:    7c 00 4a 14     add     r0,r0,r9
   222ec4:    55 49 00 3c     rlwinm  r9,r10,0,0,30
   222ec8:    90 1d 00 00     stw     r0,0(r29)
   222ecc:    7f c3 f3 78     mr      r3,r30
   222ed0:    7d 08 4a 14     add     r8,r8,r9
   222ed4:    60 09 00 01     ori     r9,r0,1
   222ed8:    7f a4 eb 78     mr      r4,r29
   222edc:    7d 1d 40 50     subf    r8,r29,r8
   222ee0:    91 3f 00 04     stw     r9,4(r31)
   222ee4:    7f bf eb 78     mr      r31,r29
   222ee8:    91 1d 00 04     stw     r8,4(r29)
   222eec:    4b ff fd ed     bl      222cd8 <_Heap_Block_split>
   222ef0:    80 1e 00 30     lwz     r0,48(r30)
   222ef4:    81 3e 00 34     lwz     r9,52(r30)
   222ef8:    7f 89 00 40     cmplw   cr7,r9,r0
   222efc:    40 9d 00 08     ble-    cr7,222f04 
<_Heap_Block_allocate+0x118>
   222f00:    90 1e 00 34     stw     r0,52(r30)
   222f04:    80 01 00 24     lwz     r0,36(r1)
   222f08:    7f e3 fb 78     mr      r3,r31
   222f0c:    83 a1 00 14     lwz     r29,20(r1)
   222f10:    83 c1 00 18     lwz     r30,24(r1)
   222f14:    7c 08 03 a6     mtlr    r0
   222f18:    83 e1 00 1c     lwz     r31,28(r1)
   222f1c:    38 21 00 20     addi    r1,r1,32
   222f20:    4e 80 00 20     blr
   222f24:    80 fe 00 38     lwz     r7,56(r30)
   222f28:    7f e5 fb 78     mr      r5,r31
   222f2c:    81 69 00 08     lwz     r11,8(r9)
   222f30:    91 3f 00 0c     stw     r9,12(r31)
   222f34:    38 e7 00 01     addi    r7,r7,1
   222f38:    91 7f 00 08     stw     r11,8(r31)
   222f3c:    93 eb 00 0c     stw     r31,12(r11)
   222f40:    90 fe 00 38     stw     r7,56(r30)
   222f44:    93 e9 00 08     stw     r31,8(r9)
   222f48:    4b ff ff 7c     b       222ec4 <_Heap_Block_allocate+0xd8>
   222f4c:    7c ca 32 14     add     r6,r10,r6
   222f50:    7d 25 4b 78     mr      r5,r9
   222f54:    7f c3 f3 78     mr      r3,r30
   222f58:    7f e4 fb 78     mr      r4,r31
   222f5c:    4b ff fd 7d     bl      222cd8 <_Heap_Block_split>
   222f60:    4b ff ff 90     b       222ef0 <_Heap_Block_allocate+0x104>




More information about the users mailing list