[RTEMS Project] #3755: leak in realloc

RTEMS trac trac at rtems.org
Thu Jun 6 12:47:22 UTC 2019


#3755: leak in realloc
--------------------------+---------------------
 Reporter:  Jeffrey Hill  |       Owner:  (none)
     Type:  defect        |      Status:  new
 Priority:  normal        |   Milestone:
Component:  score         |     Version:  4.11
 Severity:  normal        |  Resolution:
 Keywords:  realloc leak  |  Blocked By:
 Blocking:                |
--------------------------+---------------------

Comment (by Joel Sherrill):

 I am teaching an RTEMS class this week and strangely someone mentioned
 this problem. They have a low memory target so we suspect that compounds
 the issue.  We had a few ideas. First was to set a breakpoint at all exit
 paths from realloc() that return NULL and ensure Lua handles that
 correctly. Returning NULL means the memory was not resized but still
 exists at the same size. This could be incorrectly handled by Lua and a
 leak.

 Another idea was to use the resource_snapshot or just the workspace
 command/method to check that all memory from Lua is actually being freed
 after each command invocation.

 https://git.rtems.org/rtems/tree/cpukit/libcsupport/src/realloc.c

 If turning on Lua's own memory pool management addresses the issue, then
 it is either increased fragmentation in RTEMS or they may just be holding
 on to previous allocations more efficiently and not losing memory.

--
Ticket URL: <http://devel.rtems.org/ticket/3755#comment:3>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list