Bug 5100

Summary: Use "yocto-kernel patch add" added a patch, then core-image-sato build hangs.
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Ning Zhang <ning.zhang>
Component: meta-yoctoAssignee: Bruce Ashfield <bruce.ashfield>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: alexandrux.palalau, bruce.ashfield, ke.zou, poky.bs.watcher, poky.watcher, sgw, tom.zanussi, yi.zhao
Version: 1.5   
Target Milestone: 1.5 M5   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
patch file none

Description Ning Zhang 2013-09-03 07:07:11 UTC
Created attachment 1453 [details]
patch file

Poky: master: 5745e45b18e5099e94b4d5a73bc97dc6d4cdc91f

Steps:
1. Create a new bsp with cli "yocto-bsp create myqemux86 qemu", keep all options as default.
2. Modify conf/bblayers.conf, added "meta-myqemux86" to BBlayers
3. MOdify conf/local.conf, modify machine to "myqemux86"
4. bitbake core-image-sato. This could build success.
5. Download patch file from: https://wiki.yoctoproject.org/wiki/images/c/c9/Yocto-testmod.patch. Or download from attachment.
6. Install the patch with cli: yocto-kernel patch add myqemux86 ~/Yocto-testmod.patch
7. Add some kernel config with cli: yocto-kernel config add myqemux86 CONFIG_MISC_DEVICES=y CONFIG_YOCTO_TESTMOD=y CONFIG_FTRACE_SYSCALLS=y CONFIG_SCHED_TRACER=y CONFIG_IRQSOFF_TRACER=y CONFIG_PREEMPT_TRACER=y
8. Rebuild image:  bitbake core-image-sato

The build hangs at task "linux-yocto-3.8.13+gitAUTOINC+e7f42a416a_f20047520a-r4.2.3", even more than 17 hours still not complete.

Check log file, tmp/work/myqemux86-poky-linux/linux-yocto/3.8.13+gitAUTOINC+e7f42a416a_f20047520a-r4.2.3/temp/log.do_patch, it has lots of "No author found in" lines. And the line number still increasing.
Comment 1 Tom Zanussi 2013-09-03 17:55:31 UTC
It looks like this might be a regression in the kernel tools.

From linux-yocto log.do_patch, this goes on forever:

No author found in 
No author found in 
No author found in 
No author found in 
No author found in 
No author found in 
.
.
.

Possibly an infinite loop in git-s2q introduced by the following commit?

commit f9e85358bd9d6e583253523c9182268f64bafc27
Author: Paul Gortmaker <paul.gortmaker@windriver.com>
Date:   Thu Aug 22 15:14:57 2013 -0400

    kgit-s2q: continue if git-am returns zero


Let's check with Bruce and see if this could be the problem before digging further..
Comment 2 Bruce Ashfield 2013-09-03 18:04:05 UTC
The tools have changed a lot .. badly formatted patches are always
a challenge. I'll take care of testing this out and coming up with a fix. 

We don't want to regress the rest of the cases, fixing this!
Comment 3 Tom Zanussi 2013-09-03 18:06:38 UTC
I think the patch is good, I'm not sure what could be badly formatted about it, but anyway yeah, it's never caused a blip before..
Comment 4 Paul Gortmaker 2013-09-03 18:38:59 UTC
Some comments:

1) My commit f9e85358bd9d6e was a code relocation block, and not a functional change, so it is irrelevant here.

2) The "No author found in <missing text>" is because there is a left over, unassigned "patch_name" variable that has been in existence since this code originally borrowed the same block of code from git quilt-import.

3) The block of code above is only ever entered when the system is fed a garbage commit that has no date, no author and/or no subject, in an attempt to get that info interactively.

4) We'll want to delete that possibility of an interactive step, since it doesn't bode well with automated builds.

5) Finally, the patch posted here is just that -- a patch and not a commit.  Hence it does not have the required fields of date/author/subject and is destined to fail since it is invalid input.

We'll want to fix (i.e. remove) the possibility of going into an interactive phase, but that does not change the fact the patch in question here is invalid.
Comment 5 Tom Zanussi 2013-09-03 18:52:18 UTC
I didn't blame that commit, just a possibility pointed out by git blame.

I didn't realize that all patches in Yocto needed to have Author, Date and Subject in order to apply.

I'll have to verify, but I'm pretty sure this test case passed before.  QA should be able confirm or not.  If not, they should be using a 'valid patch'.
Comment 6 Bruce Ashfield 2013-09-04 01:50:54 UTC
I have a fix, will send the pull request shortly.
Comment 7 Bruce Ashfield 2013-09-05 01:29:39 UTC
This is fixed, but I'm waiting for the rc build to be done, before submitting the
fix, since it'll just wait.
Comment 8 Alexandru Palalau 2013-10-04 10:58:50 UTC
Verified it on master branch.
Commit ID: e7a20238dc73bb449f15feaf0dead51daf796184
3.10 kernel, though