Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 587296 - sys-libs/glibc: calls prepallstrip
Summary: sys-libs/glibc: calls prepallstrip
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on: 203891
Blocks: 724484 ebuild-prep
  Show dependency tree
 
Reported: 2016-06-27 18:04 UTC by Michał Górny
Modified: 2023-12-28 15:34 UTC (History)
2 users (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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-27 18:04:54 UTC
See tracker bug.
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-10-02 21:25:44 UTC
Well glibc is a bit of a special case since it needs to do "manual" stripping (and the ebuild accordingly declares RESTRICT=strip). 

We will need to copy / adopt the logic somehow.
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2017-11-11 17:23:29 UTC
Let's fix this a while after EAPI=7 can be used in the stable tree. Depends on "dostrip".
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-04-14 07:42:09 UTC
Ping.
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2019-04-15 16:38:49 UTC
(In reply to Michał Górny from comment #3)
> Ping.

Toolchain follows the same rules as Base for EAPIs. 
https://wiki.gentoo.org/wiki/Project:Base#Rules_and_limitations
Comment 5 Tim Harder gentoo-dev 2019-09-24 23:05:55 UTC
Can someone handle this now? It's passed the Jun 2019 date limit.

I'd like to be able to drop more portage-specific hacks from pkgcore/pkgcheck.
Comment 6 Larry the Git Cow gentoo-dev 2019-09-25 08:04:51 UTC
The bug has been closed via the following commit(s):

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

commit e14229b10b513a164f8379ff14cc8c644c071f27
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-09-25 07:27:26 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-09-25 08:04:44 +0000

    sys-libs/glibc: drop prepallstrip, bug #587296
    
    Stop using internal portage's 'prepallstrip' helper.
    This effectively reverts https://bugs.gentoo.org/46186.
    Modern gdb can inspect threads without debugging symbols
    in libpthread/libthread_db.
    
    Reported-by: Michał Górny
    Closes: https://bugs.gentoo.org/587296
    Bug: https://bugs.gentoo.org/46186
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-libs/glibc/glibc-2.19-r2.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.24-r4.ebuild  |  3 +--
 sys-libs/glibc/glibc-2.25-r11.ebuild |  3 +--
 sys-libs/glibc/glibc-2.26-r7.ebuild  |  4 +---
 sys-libs/glibc/glibc-2.27-r6.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.28-r6.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.29-r2.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.29-r4.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.29-r5.ebuild  | 19 -------------------
 sys-libs/glibc/glibc-2.30-r1.ebuild  | 20 --------------------
 sys-libs/glibc/glibc-2.30.ebuild     | 20 --------------------
 sys-libs/glibc/glibc-9999.ebuild     |  5 -----
 12 files changed, 3 insertions(+), 166 deletions(-)

Additionally, it has been referenced in the following commit(s):

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

commit cdb645361e3e3f20bb6f1250ada03e802285ffc3
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-09-25 07:19:16 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-09-25 08:04:44 +0000

    toolchain-glibc.eclass: drop prepallstrip, bug #587296
    
    This effectively reverts https://bugs.gentoo.org/46186.
    Modern gdb can inspect threads without debugging symbols
    in libpthread/libthread_db.
    
    Reported-by: Michał Górny
    Bug: https://bugs.gentoo.org/587296
    Bug: https://bugs.gentoo.org/46186
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/toolchain-glibc.eclass | 18 ------------------
 1 file changed, 18 deletions(-)
Comment 7 Minux 2019-10-17 06:10:03 UTC
This change effectively brings back bug #46186.

To reproduce the problem, make sure you don't have nostrip or splitdebug features enabled, and reinstall glibc.
When using gdb to debug a multithreaded program, it will complain:
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

the issue can be traced back to libpthread.so being stripped.

A little more background on this issue:
The real problem is not that gdb relies on debug info in libpthread.so, on the contrary, gdb doesn't care.
It's *glibc* libthread_db that requires a local symbol (nptl_version) in libpthread.so to verify that
their versions match.
(See https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint
for the official explanation.)

Should we revert this change or reopen bug #46186?

Thanks.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2019-10-17 06:36:53 UTC
(In reply to Minux from comment #7)
> This change effectively brings back bug #46186.
> 
> To reproduce the problem, make sure you don't have nostrip or splitdebug
> features enabled, and reinstall glibc.
> When using gdb to debug a multithreaded program, it will complain:
> warning: Unable to find libthread_db matching inferior's thread library,
> thread debugging will not be available.
> 
> the issue can be traced back to libpthread.so being stripped.
> 
> A little more background on this issue:
> The real problem is not that gdb relies on debug info in libpthread.so, on
> the contrary, gdb doesn't care.
> It's *glibc* libthread_db that requires a local symbol (nptl_version) in
> libpthread.so to verify that
> their versions match.
> (See
> https://sourceware.org/gdb/wiki/
> FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.
> 3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint
> for the official explanation.)
> 
> Should we revert this change or reopen bug #46186?
> 
> Thanks.

Please file a new bug with steps to reproduce and 'emerge --info' details. It was working for me on amd64.
Comment 9 Larry the Git Cow gentoo-dev 2019-10-17 23:22:33 UTC
The bug has been referenced in the following commit(s):

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

commit f3872a506edc7da0d987bcf0a90d4709945328a7
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-10-17 23:19:20 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-10-17 23:22:21 +0000

    sys-libs/glibc: restore strip quirk for 'libpthread.so.0'
    
    This change effectively reverts commit e14229b10b513a
    ("sys-libs/glibc: drop prepallstrip, bug #587296")
    
    gdb still relies on libpthread being unstripped.
    See https://bugs.gentoo.org/697910 for details and reproducer.
    
    Also see ebuild note that explains indirect mechanics
    of how glibc relies on gdb's ability to traverse local symbols.
    
    In EAPI=7 ebuilds (glibc-9999) we do selective stripping.
    
    Reported-by: Minux
    Closes: https://bugs.gentoo.org/697910
    Bug: https://bugs.gentoo.org/587296
    Bug: https://bugs.gentoo.org/46186
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    Package-Manager: Portage-2.3.76, Repoman-2.3.17
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-libs/glibc/glibc-2.19-r2.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.24-r4.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.25-r11.ebuild | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.26-r7.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.27-r6.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.28-r6.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.29-r2.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.29-r4.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.29-r5.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.30-r1.ebuild  | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-2.30.ebuild     | 25 ++++++++++++++++++++++---
 sys-libs/glibc/glibc-9999.ebuild     | 31 ++++++++++++++++++++++++++++---
 12 files changed, 270 insertions(+), 36 deletions(-)