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
Public bug reported:
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