Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558630 - sys-libs/glibc-2.20-r2: debug symbol CRC mismatch with FEATURE=compressdebug
Summary: sys-libs/glibc-2.20-r2: debug symbol CRC mismatch with FEATURE=compressdebug
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-24 19:43 UTC by Oliver Freyermuth
Modified: 2017-08-12 20:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Freyermuth 2015-08-24 19:43:54 UTC
Using: 
CFLAGS="${CFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug compressdebug installsources"
in package.env break glibc debug symbols, gdb reports trying to debug a program linked against libm:
warning: the debug information found in "/usr/lib64/debug//lib64/libm-2.20.so.debug" does not match "/lib64/libm.so.6" (CRC mismatch).

This can be worked around by removing the "FEATURE=installsources". 

Another "fix" is to execute on a x86_64 system:
for x in /usr/lib64/debug/lib64/*.debug ; do
   y=${x#/usr/lib64/debug}
   y=${y%.debug}
   objcopy -R .gnu_debuglink --add-gnu-debuglink="${x}" "${y}"
done

This problem is also described here: 
https://forums.gentoo.org/viewtopic-t-961866-view-next.html?sid=a4f8b6667b34d30dc1d6689a9917582f
so I am pretty sure it's there since long. 

Reproducible: Always

Steps to Reproduce:
1. Compile glibc with 
CFLAGS="${CFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug compressdebug installsources"
2. Write test program:
$ cat test.c 
#include <stdio.h>
#include <math.h>

int main() {
        volatile double foo = 7;
        printf("%lf", sin(foo));
        return 0;
}
3. Compile with
gcc test.c -ggdb -lm
4. Debug with:
gdb ./a.out
(gdb) break sin
(gdb) r
Actual Results:  
warning: the debug information found in "/usr/lib64/debug//lib64/libm-2.20.so.debug" does not match "/lib64/libm.so.6" (CRC mismatch).
Comment 1 David Kredba 2015-08-25 07:19:48 UTC
Is there any difference when FEATURES=compressdebug is not used?
Comment 2 Oliver Freyermuth 2015-08-25 08:57:30 UTC
(In reply to David Kredba from comment #1)
> Is there any difference when FEATURES=compressdebug is not used?

Indeed, also with: 
CFLAGS="${CFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug installsources"
the problem vanishes, 
i.e. even with "installsources", but without "compressdebug", it works.
Comment 3 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-08-28 17:21:22 UTC
This is probably some generic problem with portage's compressdebug FEATURE. But cc-ing glibc maintainers just in case.
Comment 4 SpanKY gentoo-dev 2015-08-29 03:11:06 UTC
how exactly did you build gdb ?  if you built it w/USE=-zlib, it doesn't support compressed sections.
Comment 5 Oliver Freyermuth 2015-08-29 15:37:16 UTC
(In reply to SpanKY from comment #4)
> how exactly did you build gdb ?  if you built it w/USE=-zlib, it doesn't
> support compressed sections.
It's build with: 
client expat lzma nls python server zlib
So zlib for sure is there. 

Furthermore, I am also building other packages, e.g. dev-db/sqlite with:
CFLAGS="${CFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug compressdebug installsources"
On these, gdb works fine. 

Up to now, I only got the problem described here with sys-libs/glibc.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2017-08-12 20:47:37 UTC
Please reopen if this is still the case with non-masked glibc.