Heap allocation for libbsd overwrites IMFS

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Wed Jun 23 08:32:35 UTC 2021


Hello,

One of our applications for the Zedboard fails with fatal error after the setup of the network stack in libbsd.
So far I traced it down to the point that the memory allocation for libbsd overwrites parts of the IMFS of rtems.
When opening device files later this will lead to the crash.
The backtrace looks like this for the bad allocation looks like this:
_Heap_Block_split	../../../../../c/src/../../cpukit/score/src/heap.c:313	0x10dd58	
_Heap_Block_allocate_from_begin	../../../../../c/src/../../cpukit/score/src/heap.c:378	0x10dfd6	
_Heap_Block_allocate	../../../../../c/src/../../cpukit/score/src/heap.c:465	0x10dfd6	
_Heap_Allocate_aligned_with_boundary	../../../../../c/src/../../cpukit/score/src/heapallocate.c:265	0x10e19c	
rtems_heap_allocate_aligned_with_boundary	../../../../../c/src/../../cpukit/libcsupport/src/malloc_deferred.c:92	0x10962e	
malloc	../../../../../c/src/../../cpukit/libcsupport/src/malloc.c:39	0x10950e	
_bsd_malloc	../../rtemsbsd/rtems/rtems-kernel-malloc.c:80	0x170048	
[more libbsd]
ifconfig	../../freebsd/sbin/ifconfig/ifconfig.c:1024	0x1724fa

With 1 GiB of RAM, available memory shouldn't be a problem.
At the moment we have configured the system with CONFIGURE_UNLIMITED_OBJECTS and CONFIGURE_UNIFIED_WORK_AREAS.
Maybe that is not right in this case. Are there any suggestions how to better configure the system?
I found CONFIGURE_MEMORY_OVERHEAD in the docs, but I am not so sure how to use it or if it would help.

Best regards,

    Jan

Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
German Aerospace Center
Institute for Software Technology | Software for Space Systems and Interactive Visualization | Lilienthalplatz 7 | 38108 Braunschweig | Germany



More information about the users mailing list