Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-141058

glibc: Improve diagnostics for relocation failures against dynamic TLS [upstream]

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • 1
    • rhel-pt-c-libs
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • PT C Libraries 2026 S04
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      RHEL-139158 shows a Python error quoting a dlerror message from glibc:

      ImportError: /lib64/libstdc++.so.6: cannot allocate memory in static TLS block

      We assume this message is caused by some other shared object that is loaded via dlopen (likely the MySQL C client library) that has a static TLS relocation against a symbol in libstdc+. However, due to the way libstdc+ was loaded, it uses dynamic TLS, so the relocation fails.

      We should enhance this message to include additional information:

      • The name of the shared object containing the relocation.
      • The symbol being relocated.
      • The name of the shared object that provides the shared object definition (already included: /lib64/libstdc++.so.6).
      • Optionally, the relocation number constant of the relocation that is being processed.

      The error message comes form this code in elf/dl-reloc.c:

      void
      __attribute_noinline__
      _dl_allocate_static_tls (struct link_map *map)
      {
        if (map->l_tls_offset == FORCED_DYNAMIC_TLS_OFFSET
            || _dl_try_allocate_static_tls (map, false))
          {
            _dl_signal_error (0, map->l_name, NULL, N_("\
      cannot allocate memory in static TLS block"));
          }
      }
      

      It is called indirectly from architecture-specific dl-machine.h files via the CHECK_STATIC_TLS macro, which is why this is not necessarily an easy change to make.

              glibc-bugzilla Platform Tools - Libraries Bot
              fweimer@redhat.com Florian Weimer
              Platform Tools - Libraries Bot Platform Tools - Libraries Bot
              Sergey Kolosov Sergey Kolosov
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: