Heap usage of ping

Matthew J Fletcher amimjf at gmail.com
Tue Sep 6 13:25:05 UTC 2016


It seems by default a 'ping' from the RTEMS shell requires about 130k, this
is from the malloc() for rtems_shell_globals_t.

That structure is mostly made up of the outpackhdr[] and packet[] arrays
which both allocate to IP_MAXPACKET, which defaults to 65535.

I attempted to reduce the size of rtems_shell_globals_t by reducing
IP_MAXPACKET to 16384 and then rebuilt rtems.

Unfortunately it seems that there is some other routine which presumes the
size of the packet arrays or the shell globals as i get stack corruption in
the shell.

RTEMS Shell on /dev/console. Use 'help' to list commands.
[/] # ping
.6T AyCeK !r!m !921 ( 56BdLtO WyNe
 68t1a.1s1k  ccposnqt0rtoll12 block: 0x20410FE8
task ID: 0x0A010007
task name: 0x53484C4C
task name string: SHLL
task stack area (4096 Bytes): 0x20442298 .. 0x20443298
damaged pattern area (16 Bytes): 0x204422A0 .. 0x204422B0

I presume to debug i could call the stack check routine at various
locations until i narrow down to the problem area, or does anyone know the
code well enough to offer a hint to look into ?


Matthew J Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160906/e15d374e/attachment.html>

More information about the users mailing list