Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 666954

Summary: =dev-util/debugedit-4.14.2 FEATURES=installsources breaks gcc: crtbegin.o: invalid string offset 758132274 >= 80 for section `.strtab'
Product: Gentoo Linux Reporter: Sergei Trofimovich (RETIRED) <slyfox>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: RESOLVED FIXED    
Severity: normal CC: gmt, paradox_ptr, rei4dan, sldg.roman
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: crtbeginS-ok-7.3.0.o.back
crtbeginS-ok-7.3.0.o

Description Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-24 07:31:36 UTC
Created attachment 547752 [details]
crtbeginS-ok-7.3.0.o.back

Noticed today when newly installed gcc refused to function:
    $ cat a.c
    int main(){}
    $ LANG=C LANG=C gcc a.c -o a
    /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbeginS.o: invalid string offset 758132274 >= 95 for section `strtab'
    /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/crtbeginS.o: error adding symbols: no error
    collect2: error: ld returned 1 exit status

Easy to reproduce even on files without debugging sections:

$ cp crtbeginS-ok-7.3.0.o.back crtbeginS-ok-7.3.0.o
$ debugedit -i -b $(pwd) -d /usr/src/debug -l ./foo crtbeginS-ok-7.3.0.o
$ export LANG=C
$ readelf -a crtbeginS-ok-7.3.0.o.back >/dev/null && echo ok
readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
ok

$ readelf -a crtbeginS-ok-7.3.0.o >/dev/null && echo ok
readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
readelf: Error:  bad symbol index: 54495f00 in relocreadelf: Error:  bad symbol index: 656c6261 in relocreadelf: Error:  bad symbol index: 62615465 in relocreadelf: Error:  bad symbol index: 69665f61 in relocreadelf: Warning: local symbol 11 found at index >= symtab's sh_info value of 11
readelf: Warning: local symbol 14 found at index >= symtab's sh_info value of 11
readelf: Warning: local symbol 15 found at index >= symtab's sh_info value of 11
ok

Looks like all sections are quite messed up.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-24 07:31:57 UTC
Created attachment 547754 [details]
crtbeginS-ok-7.3.0.o
Comment 2 Larry the Git Cow gentoo-dev 2018-09-24 07:56:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d68d322e3929588678e9447042043120210a08ed

commit d68d322e3929588678e9447042043120210a08ed
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2018-09-24 07:50:55 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-09-24 07:56:46 +0000

    package.mask: Mask new debugedit for breakage
    
    Bug: https://bugs.gentoo.org/666954
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 profiles/package.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-09-24 07:57:50 UTC
Could you report this upstream?  You certainly understand more about it than I do.
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2018-09-24 19:06:10 UTC
I'll follow up on existing
    https://github.com/rpm-software-management/rpm/issues/423
Comment 5 Greg Turner 2018-10-16 15:48:05 UTC
There appears to be a fix for this, now, upstream:

https://github.com/rpm-software-management/rpm/commit/0779d60cb5941610dd1f31632aa1655bf2cc447a.patch

I have not tested it yet, (too much ptsd, I guess, after being an early victim) -- but wanted to point it out, in case someone is feeling braver than me.
Comment 6 Patrice Levesque 2018-11-01 15:55:56 UTC
(In reply to Greg Turner from comment #5)
> There appears to be a fix for this, now, upstream:
> 
> https://github.com/rpm-software-management/rpm/commit/
> 0779d60cb5941610dd1f31632aa1655bf2cc447a.patch
> 
> I have not tested it yet, (too much ptsd, I guess, after being an early
> victim) -- but wanted to point it out, in case someone is feeling braver
> than me.

I had the same issue where gcc was b0rked after recompilation with FEATURES=installsources and that the above patch to app-arch/rpm fixes the problem for me.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-11-02 20:00:44 UTC
I don't think it's a fix *upstream*.  It's just the commit from the pull request.
Comment 8 Greg Turner 2018-11-02 20:45:10 UTC
(In reply to Michał Górny from comment #7)
> I don't think it's a fix *upstream*.  It's just the commit from the pull
> request.

Yes, you're right, my bad.  Official (-ish? there is also a redhat bugzilla) upstream bug is here if I'm not mistaken (twice :P):  

https://github.com/rpm-software-management/rpm/issues/423
Comment 9 Greg Turner 2018-11-02 20:52:11 UTC
(In reply to Greg Turner from comment #8)
> (In reply to Michał Górny from comment #7)
> > I don't think it's a fix *upstream*.  It's just the commit from the pull
> > request.
> 
> Yes, you're right, my bad.  Official (-ish? there is also a redhat bugzilla)
> upstream bug is here if I'm not mistaken (twice :P):  
> 
> https://github.com/rpm-software-management/rpm/issues/423

As already posted below by the bug's creator.  Sorry.

I'll take the plunge and give the patch a try, in a week or three, if it's still unresolved, at which point I may have something other than noise to contribute :)
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2018-11-11 14:45:45 UTC
*** Bug 670814 has been marked as a duplicate of this bug. ***
Comment 11 Larry the Git Cow gentoo-dev 2019-03-14 12:23:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e56e352403a2405a99465e68218e84a057933b4

commit 0e56e352403a2405a99465e68218e84a057933b4
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2019-03-13 18:07:16 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-03-14 12:23:41 +0000

    dev-util/debugedit: Apply GCC breakage workaround
    
    Thanks to slyfox for the patch.
    
    Closes: https://bugs.gentoo.org/666954
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-util/debugedit/debugedit-4.14.2-r1.ebuild      | 92 ++++++++++++++++++++++
 .../files/debugedit-4.14.2-no-reorder.patch        | 57 ++++++++++++++
 2 files changed, 149 insertions(+)
Comment 12 Larry the Git Cow gentoo-dev 2019-05-13 08:25:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1c43493a3eec023b86f3496973071dcfc492c41

commit f1c43493a3eec023b86f3496973071dcfc492c41
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-05-13 08:23:58 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-05-13 08:25:17 +0000

    dev-libs/elfutils: add missing section update on reorder, bug #666954
    
    Fix picked from https://sourceware.org/ml/elfutils-devel/2019-q2/msg00077.html
    by Mark Wielaard.
    
    Bug: https://bugs.gentoo.org/666954
    Bug: https://github.com/rpm-software-management/rpm/issues/423
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-libs/elfutils/elfutils-0.173-r2.ebuild         | 71 ++++++++++++++++++++++
 dev-libs/elfutils/elfutils-0.176-r1.ebuild         | 71 ++++++++++++++++++++++
 .../elfutils/files/elfutils-0.173-reorder.patch    | 37 +++++++++++
 3 files changed, 179 insertions(+)
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2019-06-22 08:11:27 UTC
*** Bug 683822 has been marked as a duplicate of this bug. ***