Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705594 - 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
Summary: sys-block/blktrace : race condition when compiling btree.o force blkiomon to ...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2020-01-16 20:04 UTC by gwendal grignou
Modified: 2021-03-17 04:45 UTC (History)
2 users (show)

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


Attachments
build.log (bad_blktrace.txt,15.94 KB, text/plain)
2020-01-16 20:04 UTC, gwendal grignou
Details
Proposed patch (0001-sys-block-blktrace-Be-sure-rbtree-is-not-compiled-tw.patch,2.79 KB, patch)
2020-01-16 20:44 UTC, gwendal grignou
Details | Diff
v2 : patch with upstream fix (v2-0001-sys-block-blktrace-Be-sure-rbtree-is-not-compiled.patch,3.03 KB, patch)
2020-01-16 21:26 UTC, gwendal grignou
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.