#3982 closed defect (fixed)

Test failures on BSPs with sbrk() support

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: test Version: 5
Severity: normal Keywords:
Cc: Blocked By:


There are some test failures on BSPs with sbrk() support such as psim, for example psxpipe01:

#0  rtems_heap_extend_via_sbrk (heap=0x30468 <_Malloc_Heap>, alloc_size=5) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libcsupport/src/rtems_heap_extend_via_sbrk.c:41
#1  0x00005b48 in rtems_heap_allocate_aligned_with_boundary (size=size@entry=5, alignment=alignment@entry=0, boundary=boundary@entry=0) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libcsupport/src/malloc_deferred.c:116
#2  0x00005930 in malloc (size=size@entry=5) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libcsupport/src/malloc.c:39
#3  0x0001b720 in _malloc_r (ignored=ignored@entry=0x2fa68 <_RTEMS_tasks_Objects+736>, size=size@entry=5) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libcsupport/src/_malloc_r.c:26
#4  0x00015ff4 in _strdup_r (reent_ptr=0x2fa68 <_RTEMS_tasks_Objects+736>, str=str@entry=0x1ce94 "/tmp") at ../../../../../../gcc-7.5.0/newlib/libc/string/strdup_r.c:10
#5  0x00015fbc in strdup (str=str@entry=0x1ce94 "/tmp") at ../../../../../../gcc-7.5.0/newlib/libc/string/strdup.c:10
#6  0x00011470 in rtems_mkdir (path=path@entry=0x1ce94 "/tmp", mode=mode@entry=511) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libcsupport/src/rtems_mkdir.c:133
#7  0x0000a7c8 in pipe (filsdes=filsdes@entry=0x36ce8) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/libfs/src/pipe/pipe.c:42
#8  0x000004a0 in Init (ignored=<optimized out>) at /home/EB/sebastian_h/src/rtems/c/src/../../testsuites/psxtests/psxpipe01/init.c:65
#9  0x0000c828 in _Thread_Handler () at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/score/src/threadhandler.c:139
#10 0x0000c77c in _Thread_Get (id=<optimized out>, lock_context=<optimized out>) at /home/EB/sebastian_h/src/rtems/c/src/../../cpukit/score/src/threadget.c:43

The problem is that an rtems_heap_greedy_allocate() is ineffective due to the automatic heap extension.

Change History (3)

comment:1 Changed on 02/08/21 at 06:47:43 by Chris Johns <chrisj@…>

Resolution: fixed
Status: assignedclosed

In 7ca3b28/rtems:

libcsupport: Have greedy allocations use consume extended memory

  • Call the heap extend handler until all memory has been requested.

Closes #3982

comment:2 Changed on 02/08/21 at 22:33:47 by Chris Johns

Resolution: fixed
Status: closedreopened

This ticket is being reopened and extended to cover other greedy implementation. There is also rtems_workspace_greedy_allocate() and friends.

comment:3 Changed on 02/10/21 at 06:30:29 by Chris Johns <chrisj@…>

Resolution: fixed
Status: reopenedclosed

In 03dff201/rtems:

libcsupport: Add sbrk greedy support to consume all sbrk memory

  • Move the heap sbrk code into a separate routnine.
  • Update heap and workspace greedy allocators to use the common sbrk greedy support.

Closes #3982

Note: See TracTickets for help on using tickets.