Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831927 - sys-apps/portage - fails to create build-id symlinks when non-hardlinked files have the same build id
Summary: sys-apps/portage - fails to create build-id symlinks when non-hardlinked file...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 837899
Blocks:
  Show dependency tree
 
Reported: 2022-01-23 22:12 UTC by Jonathan Callen
Modified: 2022-07-10 16:31 UTC (History)
1 user (show)

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


Attachments
fake-example-1.0.ebuild (file_831927.txt,403 bytes, text/plain)
2022-01-23 22:12 UTC, Jonathan Callen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Callen 2022-01-23 22:12:20 UTC
Created attachment 763417 [details]
fake-example-1.0.ebuild

When using FEATURES=splitdebug, if the same ELF is installed multiple times without using hard links or symlinks, Portage sometimes fails to create the build-id symlink to the file due to a TOCTTOU failure.

Attached is a sample ebuild that reliably causes this issue for me (make sure that MAKEOPTS is set to allow parallel builds).
Comment 2 Larry the Git Cow gentoo-dev 2022-02-04 17:32:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=d610d14325fbe65f9a011d643be74c95098c3241

commit d610d14325fbe65f9a011d643be74c95098c3241
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-02-02 18:07:19 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-02-02 18:11:29 +0000

    estrip: fix race when creating build-id debug symlinks
    
    Bug: https://bugs.gentoo.org/831927
    Closes: https://github.com/gentoo/portage/pull/786
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 bin/estrip | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)