Skip to content

Read the J-Link version from the library's real file name - #277

Open
TheArkadiuszGrzelka wants to merge 1 commit into
square:masterfrom
TheArkadiuszGrzelka:dll-version-soname
Open

TheArkadiuszGrzelka wants to merge 1 commit into
square:masterfrom
TheArkadiuszGrzelka:dll-version-soname

Conversation

@TheArkadiuszGrzelka

Copy link
Copy Markdown

SEGGER's Linux package symlinks /opt/SEGGER/JLink to JLink_V950/. Loaded through that link (LD_LIBRARY_PATH or dllpath), the path has no JLink_V<n> part, so dll_version() returns None and load() copies the 29 MB library into /tmp on every Library(). unload() never calls dlclose on the copy, so a process that creates a JLink per probe scan (pyOCD does) fills /tmp.

dll_version() now falls back to the resolved file, libjlinkarm.so.9.50.0, and reads the version from its name.

Tested on Linux with the real V9.50 .deb library: 467 unit tests OK. The two new tests fail on master with None != 9.5.

SEGGER's Linux package links /opt/SEGGER/JLink to JLink_V950/. When
the library is loaded through the link (LD_LIBRARY_PATH=/opt/SEGGER/JLink
or an explicit dllpath), its path has no JLink_V<n> part, so
dll_version() returns None and load() copies the 29 MB library into
/tmp on every Library().

On Linux, unload() never dlcloses the copy, so deleted copies stay
mapped and a process creating a JLink per probe scan fills /tmp.

dll_version() now falls back to the file the path resolves to,
libjlinkarm.so.9.50.0, and reads the version from its name.

Signed-off-by: Arkadiusz Grzelka <arkadiusz.grzelka@arivemb.com>
@TheArkadiuszGrzelka
TheArkadiuszGrzelka marked this pull request as ready for review October 23, 2026 07:35
@CLAassistant

CLAassistant commented Oct 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants