Re: About HEAP error

2021-03-05 Thread Richi Dubey
> > breaking at _Terminate and doing a back trace will give > you the exact line the error is raised from. I don't know why I did not focus on this earlier! So I put a breakpoint at the line which detects a fault and now we know

Re: About HEAP error

2021-03-05 Thread Richi Dubey
> > This is just the detection point. The allocate is doing a validity check > and something is wrong from an overwrite. > FWIW this is pretty early in the test I think. Good point, the corruption has already happened earlier, and yes its quite early : ... #13 0x0010860e in rtems_task_create

Re: About HEAP error

2021-03-05 Thread Joel Sherrill
On Thu, Mar 4, 2021, 11:31 PM Richi Dubey wrote: > Hi, > > Thanks to both of you for helping me out with this! > > When I backtrace on _Terminate: I get this: > > Init -> rtems_task_create -> ... -> _Heap_Allocate -> ... > ->_Heap_Protection_check_free_block -> _Heap_Protection_block_error >

Re: About HEAP error

2021-03-04 Thread Richi Dubey
Hi, Thanks to both of you for helping me out with this! When I backtrace on _Terminate: I get this: Init -> rtems_task_create -> ... -> _Heap_Allocate -> ... ->_Heap_Protection_check_free_block -> _Heap_Protection_block_error ->_Heap_Protection_block_error_default -> _Terminate

Re: About HEAP error

2021-03-03 Thread Gedare Bloom
On Wed, Mar 3, 2021 at 9:49 AM Gedare Bloom wrote: > > On Wed, Mar 3, 2021 at 9:28 AM Joel Sherrill wrote: > > > > > > > > On Wed, Mar 3, 2021 at 9:50 AM Gedare Bloom wrote: > >> > >> On Wed, Mar 3, 2021 at 12:08 AM Richi Dubey wrote: > >> > > >> > What's the element written after the free? I

Re: About HEAP error

2021-03-03 Thread Gedare Bloom
On Wed, Mar 3, 2021 at 9:28 AM Joel Sherrill wrote: > > > > On Wed, Mar 3, 2021 at 9:50 AM Gedare Bloom wrote: >> >> On Wed, Mar 3, 2021 at 12:08 AM Richi Dubey wrote: >> > >> > What's the element written after the free? I set a watch at the exact >> > block location, but it doesn't work: >> >

Re: About HEAP error

2021-03-03 Thread Joel Sherrill
On Wed, Mar 3, 2021 at 9:50 AM Gedare Bloom wrote: > On Wed, Mar 3, 2021 at 12:08 AM Richi Dubey wrote: > > > > What's the element written after the free? I set a watch at the exact > block location, but it doesn't work: > > > > Hardware watchpoint 7: *0x202ba8 > > (gdb) watch *0x206fec > >

Re: About HEAP error

2021-03-03 Thread Gedare Bloom
On Wed, Mar 3, 2021 at 12:08 AM Richi Dubey wrote: > > What's the element written after the free? I set a watch at the exact block > location, but it doesn't work: > > Hardware watchpoint 7: *0x202ba8 > (gdb) watch *0x206fec > Hardware watchpoint 8: *0x206fec That's just the first byte in the

Re: About HEAP error

2021-03-02 Thread Richi Dubey
What's the element written after the free? I set a watch at the exact block location, but it doesn't work: Hardware watchpoint 7: *0x202ba8 (gdb) watch *0x206fec Hardware watchpoint 8: *0x206fec (gdb) c Continuing. Thread 1 hit Breakpoint 6, Init (argument=2107944) at

Re: About HEAP error

2021-03-02 Thread Sebastian Huber
On 02/03/2021 05:44, Richi Dubey wrote: (gdb) p *(Heap_Error_context*)(0x00206d7c) $5 = {   heap = 0x202ba8 <_Workspace_Area>,   block = 0x206fec,   reason = HEAP_ERROR_FREE_PATTERN } If it is always the same address, then you can set a watch point to an element which is written after the

Re: About HEAP error

2021-03-02 Thread Richi Dubey
Thank you for the suggestion. I will look into it. On Tue, Mar 2, 2021 at 9:43 PM Joel Sherrill wrote: > > > On Mon, Mar 1, 2021 at 10:44 PM Richi Dubey wrote: > >> Oh, that makes sense. Thank you. >> >> I got this: >> >> (gdb) p *(Heap_Error_context*)(0x00206d7c) >> $5 = { >> heap =

Re: About HEAP error

2021-03-02 Thread Joel Sherrill
On Mon, Mar 1, 2021 at 10:44 PM Richi Dubey wrote: > Oh, that makes sense. Thank you. > > I got this: > > (gdb) p *(Heap_Error_context*)(0x00206d7c) > $5 = { > heap = 0x202ba8 <_Workspace_Area>, > block = 0x206fec, > reason = HEAP_ERROR_FREE_PATTERN > } > > HEAP_ERROR_FREE_PATTERN > There

Re: About HEAP error

2021-03-01 Thread Richi Dubey
Oh, that makes sense. Thank you. I got this: (gdb) p *(Heap_Error_context*)(0x00206d7c) $5 = { heap = 0x202ba8 <_Workspace_Area>, block = 0x206fec, reason = HEAP_ERROR_FREE_PATTERN } HEAP_ERROR_FREE_PATTERN There is an unexpected value in the free pattern of a free heap block. I will try

Re: About HEAP error

2021-03-01 Thread Gedare Bloom
On Sun, Feb 28, 2021 at 10:53 PM Richi Dubey wrote: > > Hi, > > I get this error on sp02: > > *** FATAL *** > fatal source: 13 (RTEMS_FATAL_SOURCE_HEAP) > CPU: 0 > fatal code: 2125180 (0x00206d7c) > RTEMS version: 6.0.0.44ae183090f3bc1a4ee281ff98525209b3fda7a7-modified > RTEMS tools: 10.2.1

About HEAP error

2021-02-28 Thread Richi Dubey
Hi, I get this error on sp02: *** FATAL *** fatal source: 13 (RTEMS_FATAL_SOURCE_HEAP) CPU: 0 fatal code: 2125180 (0x00206d7c) RTEMS version: 6.0.0.44ae183090f3bc1a4ee281ff98525209b3fda7a7-modified RTEMS tools: 10.2.1 20210125 (RTEMS 6, RSB ade089253e70d75105a8311844f82f6d20cc30a8, Newlib