Inconsistency detected by ld.so: dl-deps.c when dlopen .so, built with --filter option

Bug #1952814 reported by Andrei Podoplelov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Having libFilter.so built with --filter=libFiltee.so.
Running prog-bug, which contains dlopen("libFilter.so"), you'll get "Inconsistency detected by ld.so: dl-deps.c: 553: _dl_map_object_deps: Assertion `map->l_searchlist.r_list[0] == map' failed!"

The issue is reproducible on Ubuntu 16.04, 18.04, 20.04, although the dl-deps.c line number may be different.

The attached file contains full C source code, the binaries, and the build script.

To reproduce:
1) Unzip and cd to the folder.
2) Define LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=.
3) Run correct executable prog-ok, not having dlopen call, behaves as expected.
$ prog-ok
4) Run prog-bug, which demonstrates the issue, having dlopen, and produces the above error.
$ prog-bug
Optionally you may rebuild the binaries, using _build.sh script.

The same error appears running:
$ ldd libFilter.so

I am using Ubuntu 18.04.6 LTS with libc6 v2.27-3ubuntu1.4.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libc6 2.27-3ubuntu1.4
ProcVersionSignature: Ubuntu 4.15.0-162.170-generic 4.15.18
Uname: Linux 4.15.0-162-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.9-0ubuntu7.27
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Nov 30 17:52:07 2021
Dependencies:
 gcc-11-base 11.1.0-1ubuntu1~18.04.1 [origin: LP-PPA-ubuntu-toolchain-r-test]
 libc6 2.27-3ubuntu1.4
 libgcc-s1 11.1.0-1ubuntu1~18.04.1 [origin: LP-PPA-ubuntu-toolchain-r-test]
 libgcc1 1:11.1.0-1ubuntu1~18.04.1 [origin: LP-PPA-ubuntu-toolchain-r-test]
InstallationDate: Installed on 2020-05-03 (576 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
SourcePackage: glibc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Andrei Podoplelov (xpv) wrote :
Revision history for this message
Andrei Podoplelov (xpv) wrote :

This bug has easy fix: remove line 549 (v2.27) in dl-deps.c, saying
assert(map->l_searchlist.r_list[0] == map);

I checked all the glibc sources after v2.27, which runs on my Ubuntu 18.04. I see that this bug is fixes in v2.32.
It would be nice to fix it for Ubuntu 18.04 and 20.04 - easy one line fix.

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.