Skip to contentSkip to conversation

DPDK libraries (rib, lpm, ...) can't safely be used by shared libraries in application that are unloaded

Bug 1081 [email protected] 1 participant 1 message Sep 13, 2022

lore
Share & tools
lore
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=1081

Bug ID: 1081
Summary: DPDK libraries (rib, lpm, ...) can't safely be used by
shared libraries in application that are unloaded
Product: DPDK
Version: 22.03
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: major
Priority: Normal
Component: core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---

Our application has base program and plugins.
The plugins are loaded at run time with dlopen() and can be updated by doing dlclose() to replace the library with a new version.

Libraries that are only used by these plugins will crash when reloaded. The sequences is:
1. Program is started
2. Plugin is loaded with dlopen()
3. dlopen will auto load the dependent shared library (for example rte_rib)
4. Later plugin is unloaded by calling cleanup code and then dlclose()
5. dlcose() will unload the dependent no longer used shared library

6. Reloading with dlopen causes crash because the tailq list has entry for
already freed memory from the previous instance.

The problem is that some DPDK libraries use EAL_REGISTER_TAILQ as a constructor bu have no destructor. This problem applies to all libraries using EAL_REGISTER_TAILQ.

The best fix is to add destructor/unregister logic to the eal tailq. Workaround is to load the dependent library during DPDK startup in main program.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.