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

Bug 705594

Summary: sys-block/blktrace : race condition when compiling btree.o force blkiomon to be recompiled in install phase - blkiomon.o: error adding symbols: File in wrong format
Product: Gentoo Linux Reporter: gwendal grignou <gwendal>
Component: Current packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED OBSOLETE    
Severity: normal CC: arthurzam, robbat2, sam
Priority: Normal Keywords: PATCH, PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/14432
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
Proposed patch
v2 : patch with upstream fix

Description gwendal grignou 2020-01-16 20:04:56 UTC
Created attachment 603542 [details]
build.log

When compiling sys-block/blktrace-1.2.0, it sometimes failed because blkiomon is regenerated in the install phase. Because CC is only overridden in the compile phase, we have a compilation error (see bad_blktrace.txt - some compilation and directories have been shortened for readability)

The issue is rbtree.o is needed by both btt/btt and blkiomon, and they are compiled in parallel, so it is possible when make -C btt is invoked, rbtree.o is not present yet, and that make process will force its recompilation, even if rbtree.o will be compiled in the meantime for blkiomon.

It is possible to address the problem by populating CC variable at install time, but a cleaner approach is to add $(PROGS) as a dependency on $(SUBDIRS).

I will propose a fix in linux-btrace@vger.kernel.org mailing list soon.
Comment 1 gwendal grignou 2020-01-16 20:44:18 UTC
Created attachment 603544 [details, diff]
Proposed patch
Comment 2 gwendal grignou 2020-01-16 21:26:03 UTC
Created attachment 603546 [details, diff]
v2 : patch with upstream fix

Fix with signed off patch.
Comment 3 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 18:58:16 UTC
Fixed in 1.3.0, the only version in tree.