Bug 12544 - kernel-module-xxx contain non-deterministic srcversion
Summary: kernel-module-xxx contain non-deterministic srcversion
Status: RESOLVED FIXED
Alias: None
Product: Kernel
Classification: Yocto Project Subprojects
Component: linux-yocto (show other bugs)
Version: 2.5
Hardware: PC Multiple
: Medium+ normal
Target Milestone: 2.5 M4
Assignee: Juro Bystricky
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-02-13 00:03 UTC by Juro Bystricky
Modified: 2018-04-19 08:27 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
diffoscope output comparing two builds. (27.84 KB, text/html)
2018-02-13 00:03 UTC, Juro Bystricky
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juro Bystricky 2018-02-13 00:03:47 UTC
Created attachment 4206 [details]
diffoscope output comparing two builds.

Building the same modules in two different folders at two different times results in about 15 different kernel-module-lttng packages having different srcversions (please see the attached file). This makes no sense, as the source code for the modules should be identical, hence the srcversion as well.
This was only observed with meta-intel, without meta-intel the srcversion seems to be always the same.
Comment 1 Juro Bystricky 2018-03-29 14:58:58 UTC
This potentially affects all kernel modules, (problem is not to meta-intel specific, not lttng modules specific). If the build directory name is rather long, some files are basically skipped from checksum calculation. If the folder names are kept short, no problems are observed. Now that I can reproduce this, finding the culprit should be straightforward.
Comment 2 Juro Bystricky 2018-03-30 12:22:10 UTC
So I found the root cause (scripts/modpost.c - get_next_line): if a file line is longer than 4096 bytes, it is silently ignored. This is later on interpreted as EOF. The consequence being some source files are skipped and do not contribute to srcversion checksum.
Sent a patch to kernel build mailing list:
https://patchwork.kernel.org/patch/10318141/
Comment 3 Juro Bystricky 2018-04-04 15:58:29 UTC
Patch sent to ML:
https://patchwork.openembedded.org/patch/149757/