Tcl Source Code

View Ticket
Login
Ticket UUID: 917c4a896afc744d7d5310a68ceccad4afcb2a6e
Title: Glibc detection broken on Linux for platform::identify
Type: Bug Created on: 2023-09-05 12:55:18
Submitter: mbwagner Assigned to: jan.nijtmans
Subsystem: 81. Bundled Packages Severity: Minor
Priority: 5 Medium Last modified: 2026-07-09 10:35:57
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-07-09 10:35:57
Version: 8.6 and trunk
Description:

The bundled platform package fails to find the version of glibc on the ubuntu:22.04 Docker image.

Steps to reproduce:

docker run -it ubuntu:22.04 apt-get update && apt-get install -y tcl tclsh package require platform platform::identify

Output is:

linux-unknown-x86_64

Expected output:

linux-glibc2.35-x86_64

This problem also occurs with the latest trunk, and is probably also present in a non-Docker Ubuntu install (~~but I could not test that~~, edit: confirmed on non-Docker Ubuntu 22.04 as well). I looked at the code and the root cause seems to be missing execute permissions on libc.so.6. Currently the most popular way of finding the libc version seems to be to call ldd --version instead of the .so file directly. This outputs the libc version (among other stuff) on all Linux distros including MUSL-based ones, which would make it very easy to extend the code to detect MUSL versions too.

User Comments:
jan.nijtmans added on 2023-09-05 15:07:53:

@aku. Andreas, you seem to be most knowledgeable on the "platform" package


tomkiti added on 2026-07-08 11:43:30:

platform::identify is also broken on RHEL 9 and 10. ::platform::LibcVersion uses the glob pattern libc*, which on RHEL 9 and 10 returns libc.so first, which is a text file. Changing the pattern to libc.so.* fixes it on my systems.


jan.nijtmans added on 2026-07-08 15:31:59:

Proposed fix [a1a9fbb461cb05be|here], based on the idea of running "ldd --version". Can be simplified further, but it appears to work.

Please report whether this works for you.

Thanks!


jan.nijtmans added on 2026-07-09 10:35:57:

Fixed [b1449b8027baf146|here]

Thanks for the report, and for the fix suggestion.