#3192 new defect

RTL Memory Leak after module unload with dlclose()

Reported by: Kevin Gordon Owned by:
Priority: normal Milestone: Indefinite
Component: lib/dl Version: 4.11
Severity: major Keywords: RTL dlclose
Cc: Blocked By:
Blocking:

Description

RTL produces a memory leak of varying size, depending upon a loaded module's code size or other unknown factors, after unloading a module using the dlclose() function.

Architecture is sparc-leon3 using both the RTEMS 4.11.1 public release and rtems master @f043b9bd3bf25626fb1a311dd7fa041eacc68adc with rtems-source-builder @55f2d69e9b67cde23d61375fa34ef5b0f04a985d.

This bug can be demonstrated by compiling the rtems/testsuites/samples/paranoia/paranoia.c source file into an ELF .o file, and then continually loading and unloading the paranoia.o file using dlopen() and dlclose(). Calls to malloc_info() after each dlopen() will demonstrate that the heap free bytes is reduced over each call when a dlclose() is made in-between. If enough calls are made to dlopen() and dlclose(), the system will run of of heap entirely as reported by RTL: "no memory for obj global syms"

Using RTEMS 4.11.1, this test case demonstrates a leak of 1512 bytes for each dlclose() and a leak of 1424 bytes using rtems master at the above hash.

In addition, this memory leak is reproducible using the Gaisler custom rtems 4.12 tools and their UT700 BSP with the same results as rtems master at above hash, with a demonstrated leak of 1424 bytes per each module unload of paranoia.o.

Change History (1)

comment:1 Changed on Feb 5, 2018 at 4:42:13 AM by Chris Johns

Milestone: 4.11.3Indefinite

Requires funding.

Note: See TracTickets for help on using tickets.