#3625 closed defect (fixed)

RTL Allows Unloading a Module other Modules Depend Upon (cloned)

Reported by: Kevin Gordon Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: lib/dl Version: 5
Severity: major Keywords: RTL dlopen dlcose
Cc: Blocked By:


Cloned from #3195:

Consider the following example using ELF .o files from compiled source files module-0.c and module-1.c from ticket #3194:

module-0.o is loaded using dlopen() with no code or data dependencies.
module-1.o is loaded using dlopen() with both code and data dependencies on module-0 which are resolved by RTL.

The RTL function dlcose() returns no error when module-0 is unloaded, when it should return an error and not unload module-0. This becomes quite dangerous because a subsequent call to module1Function1() in the currently-loaded module-1.o, which accesses shared_resource_0[ ] and calls module0Function0(), will result in an unexpected trap on qemu or the call succeeding with the correct return value on hardware when it should not.

The erroneous successful unload() of module-0 aside, it appears as though the resources are not actually deleted and I believe this ticket is related to tickets #3192 and #3194.

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

Execution environments are qemu-system-sparc and LEON3 UT700 hardware.

Change History (1)

comment:1 Changed on Nov 27, 2018 at 6:15:37 AM by Chris Johns

Resolution: fixed
Status: assignedclosed

This has been fixed on master for RTEMS 5.

Note: See TracTickets for help on using tickets.