Skip to content

binary fails to load (_dl_check_map_versions) after patchelf --set-rpath  #192

Closed

Description

@pespin

Original ticket tacking the issue: https://osmocom.org/issues/4389

So, in summary:
I was using patchelf 0.9-1+b1 from debian9 repos, but run into issue #47 with binary "srsue" from srsLTE.git [1]:

$ patchelf --set-rpath /osmo-gsm-tester-srsue/srslte/lib /osmo-gsm-tester-srsue/srslte/bin/srsue
warning: working around a Linux kernel bug by creating a hole of 124461056 bytes in ‘/osmo-gsm-tester-srsue/srslte/bin/srsue’
maximum file size exceeded

so I then went into building/installing a new version of patchelf. I tried with following patchelf versions:

  • 0.9+52 (debian10 patchelf_0.9+52.20180509-1_amd64.deb)
  • 0.10 (last release Download tarball and bult manually)
  • master (from git, 2ba6481)

All of them fix the issue #47 on binary "srsue". However, all those new versions introduce a new bug with another binary generated by srsLTE.git [1] called "srspec". Patching itself seems to be working fine (patchelf doesn't exit with !=0), but afterwards the loader is unable to load the binary:

# ldd /osmo-gsm-tester-srsepc/srslte/bin/srsepc
Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != NULL' failed!

This issue doesn't show up with the original patchelf 0.9-1+b1 from debian9 I was using, so it's a regression added at some point after that and yet not fixed last release nor in currentmaster.

[1] https://github.com/srsLTE/srsLTE

Activity

  1. pespin commented on Feb 11, 2020

    @pespin
    ContributorAuthor

    I attach a diff here of readelf launched against the working binary (patchelf 0.9-1+b1) and the broken binary (master 2ba6481).
    diff.log

  2. pespin commented on Feb 11, 2020

    @pespin
    ContributorAuthor

    According to git bisect, this is the commit introducing the regression: c4deb5e

    $ git bisect start
    $ git bisect bad master
    $ git bisect good 0.9
    $ git bisect run /bin/bash -c "autoreconf -fi && ./configure && make && cp /osmo-gsm-tester-srsepc/srslte/bin/srsepc.orig /osmo-gsm-tester-srsepc/srslte/bin/srsepc &&  src/patchelf --set-rpath /osmo-gsm-tester-srsepc/srslte/lib /osmo-gsm-tester-srsepc/srslte/bin/srsepc && ldd /osmo-gsm-tester-srsepc/srslte/bin/srsepc"
    
  3. ilg-ul commented on May 24, 2020

    @ilg-ul

    I confirm that the current patchelf (0.10) damages ELFs.

    In my use case I need to first remove rpath/runpath and then set if explicitly as rpath. This procedure damaged most of my ELFs, and I had to find workarounds to patchelf, which were tricky and time consuming.

  4. domenkozar commented on Jun 2, 2020

    @domenkozar
    Member

    @pespin thanks for bisecting! I'm going to close this in favor of #170 to keep the duplicates down.

  5. added a commit that references this issue on Apr 21, 2026
    c3912ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions