Inconsistency detected by ld.so: ../elf/dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!

Szabolcs Nagy szabolcs.nagy@arm.com
Tue Oct 13 09:22:11 GMT 2020


The 10/09/2020 21:26, Jonny Grant wrote:
> Hello
> I added comment #23 here
> https://sourceware.org/bugzilla/show_bug.cgi?id=19329
> 
> On my computer any C program compiled with assert(0) dumps a core file, but this glibc issue assert does not dump a core file. Is there an issue with this assert macro in glibc? The message output on the terminal is different from the standard macro.
> 
> This is what glibc was showing when I launched Chrome.
> 
> 
> Inconsistency detected by ld.so: ../elf/dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!
> Command exited with non-zero status 127

yes the dynamic linker (ld*.so) has a different
assert implementation than libc.so:

https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/dl-minimal.c;h=b37abfaff919383a1f1217f94798c65a0a70f398;hb=HEAD#l280

it calls _dl_fatal_printf which uses _exit(127)
and that will not dump core.

it might make sense to make ld.so asserts dump
core, please open a bug report about it.


> 
> 
> 
> This is my test program
> 
> $ ./a
> a: a.c:6: main: Assertion `0' failed.
> Aborted (core dumped)
> 
> 
> $ cat a.c
> // gcc -Wall -o a a.c
> #include <assert.h>
> 
> int main()
> {
>     assert(0);
> }

-- 


More information about the Libc-help mailing list