Handling $ORIGIN strings within DT_NEEDED entries

Bug #1646822 reported by Oleksandr Pikozh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

What documentation says:
From what documentation says, it looks like $ORIGIN string should be recognized within DT_NEEDED entries.
(Sorry, in initial version of bug-report I misinterpreted one of sentences in documentation, taking it out of context.)
See "System V Application Binary Interface - DRAFT - 10 June 2013" / "Chapter 5 - Program Loading and Dynamic Linking" / "Dynamic Linking" / "Shared Object Dependencies" / "Substitution Sequences" <http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#substitution>.

What in reality happens:
- Having $ORIGIN string within DT_NEEDED entry and shared library that DOES NOT uses versioning, causes '$ORIGIN' to be interpreted as path-to-directory-where-binary-is-located.
- Having $ORIGIN string within DT_NEEDED entry and shared library that USES versioning, causes assertion failure (see below) or segmentation fault (not on my system).

On my system, having $ORIGIN within DT_NEEDED together with versioning causes the following output: "Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != NULL' failed!". Some other people say they observe segmentation fault instead. I used the attached script test-origin-in-needed.sh to test behavior.

I'd better report the bug to libc maintainers (upstream). Because it seems to be not downstream-related. But the libc bug reporting policy says: "Distributions may include their own modifications to glibc in the binaries and sources you get with the operating system. If the glibc you are using comes from a complete operating system distribution, you should report bugs to that distribution project first." So, I report here first.

1) lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

2) apt-cache policy libc6
libc6:
  Installed: 2.23-0ubuntu4
  Candidate: 2.23-0ubuntu4
  Version table:
 *** 2.23-0ubuntu4 500
        500 http://ua.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.23-0ubuntu3 500
        500 http://ua.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

3) I expected $ORIGIN strings within DT_NEEDED entries to be either always recognized or not recognized.

4) Behavior depends on whether shared object is versioned or not. With non-versioned shared object it seems to be ok. With versioned shared object it causes assertion failure (or segmentation fault on some other platforms).

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :
summary: - Handling $ORIGIN strings within DT_NEEDED sections
+ Handling $ORIGIN strings within DT_NEEDED entries
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.