Bug 9854

Summary: Kernel hangs on LTP cgroup tests
Product: [Yocto Project Subprojects] Kernel Reporter: Edgar Cherkasov <echerkasov>
Component: linux-yoctoAssignee: Edgar Cherkasov <echerkasov>
Status: RESOLVED WORKSFORME QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: normal    
Priority: Medium CC: francisco.j.pedraza.gonzalez, jose.perez.carranza, rebecca.swee.fun.chang, sgw
Version: 2.0   
Target Milestone: 2.4   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
logs (dmesg, ltp) none

Description Edgar Cherkasov 2016-06-29 17:12:36 UTC
Created attachment 3262 [details]
logs (dmesg, ltp)

When running cgroup from LTP project, kernel generates various call traces and system becomes
unusable:
 - system does not respond to keyboard, mouse, ssh, etc.;
 - serial console works only as output and repeating call traces can be observed on console
   (see dmesg log for details).

How to reproduce:
 0. integrate LTP into your image;
 1. create "cgroup_test" file in /opt/ltp/runtest with following content: "cgroup cgroup_regression_test.sh";
 2. run ltp test: /opt/ltp/runltp -p -f cgroup_test;
 3. second test case will be killed, call traces will appear in dmesg and serial console and system will become unusable.

After investigation it was found:
 - the problem can be reproduced with latest yocto 4.6.1 kernel;
 - cannot be reproduced on ubuntu 16.04 with 4.6.0, 4.6.3 kernels;
 - cannot be reproduced if main loop is removed from test_3_2.sh (i.e. only one iteration is performed);
 - this test successfully passed earlier with Yocto1.7 and 3.17 kernel.

So, we believe that the problem is related to some specific of modern Yocto kernel/distribution, but we struggle to bisect the root cause.  The problem is not critical for us, but it's very odd when userspace application crashes the kernel. If possible could you please advice in which direction it's better to investigate the problem further?

System information:

Kernel: Linux kontron-come-csl6 4.6.1-yocto-standard #1 SMP PREEMPT Wed Jun 29 16:31:18 MSK 2016 x86_64 GNU/Linux
Yocto: 2.0.1
meta-intel version: 4.0 with fixes from git
LTP: 20150420
local.conf: MACHINE = "intel-corei7-64" + all other options have default values.

Please tell if additional information/experiments are needed.
Comment 1 Saul Wold 2016-06-30 15:47:56 UTC
Have you tested with the linux-yocto-4.4 kernel?

Currently 4.4 is the PREFERRED_VERSION for linux-yocto and what the team tests with.  Our QA team does some testing of cgroups, I am working to find out the full details.
Comment 2 Francisco Pedraza 2016-06-30 15:59:05 UTC
(In reply to comment #1)
> Have you tested with the linux-yocto-4.4 kernel?
> 
> Currently 4.4 is the PREFERRED_VERSION for linux-yocto and what the team
> tests with.  Our QA team does some testing of cgroups, I am working to find
> out the full details.

Hi Saul,
This is the script that performs LTP testing:

def run_ltp(milestone="M4", date="20160114"):
      print "Starting LTP tests..."
      default="syscalls\nfs\nfsx\ndio\nio\nmm\nipc\nsched\nmath\nnptl\npty\nadmin_tools\ntimers\ncommands"
      print "Writing configuration..."
      os.system("echo \""+default+"\" > /opt/ltp/scenario_groups/default")
      os.system("sed -e '/hackbench/ s/^#*/#/' -i /opt/ltp/runtest/sched")
      os.system("sed -e '/oom0/ s/^#*/#/' -i /opt/ltp/runtest/mm")
      print "Running test script..."
      os.system("cd /opt/ltp; ./runltp -p -l result-"+milestone+"-"+date+".log -C result-"+milestone+"-"+date+".fail -d /opt/ltp/tmp &> result-"+milestone+"-"+date+".fulllog")

And this is the portion of log that got the failure:
Tests which require a big block device are disabled.
   You can specify it with option -z
   COMMAND:    /opt/ltp/bin/ltp-pan  -e -S   -a 1044     -n 1044  -p  -f /opt/ltp/tmp/ltp-rQMWlIyVBz/alltests -l /opt/ltp/results/result-M2-20160621.log  -C /opt/ltp/output/result-M2-20160621.fail -T /opt/ltp      /output/LTP_RUN_ON-result-M2-20160621.log.tconf
   LOG File: /opt/ltp/results/result-M2-20160621.log
   FAILED COMMAND File: /opt/ltp/output/result-M2-20160621.fail
   TCONF COMMAND File: /opt/ltp/output/LTP_RUN_ON-result-M2-20160621.log.tconf
Comment 3 Edgar Cherkasov 2016-07-01 17:35:05 UTC
Hi Saul,

We have tested yocto 4.4 kernel with LTP 20160126 (cgroup test is same with 20150420 version) and the problem cannot be reproduced.
Comment 4 Saul Wold 2016-07-13 16:11:43 UTC
Bruce, can you look into this, seems to be 4.6 related
Comment 5 Bruce Ashfield 2016-10-17 16:59:28 UTC
Can someone confirm that this does (or doesn't) happen with 4.8 ?
Comment 6 Edgar Cherkasov 2016-10-19 09:14:05 UTC
(In reply to comment #5)
> Can someone confirm that this does (or doesn't) happen with 4.8 ?

We have tested yocto 2.0.1 with 4.8 kernel and problem can be reproduced.
Comment 7 Stephen K Jolley 2016-11-08 00:36:25 UTC
Bruce,

It appears the problem still exists.  I am moving this to accepted.
Comment 8 Bruce Ashfield 2017-01-10 20:33:07 UTC
Putting this in M3, but I'll have my hands full with the 4.9 and potentially a 4.10 kernel, so if someone else can take this .. all the better.
Comment 9 Choong Yin Thong 2017-05-11 03:16:36 UTC
I cannot reproduce the issue as per the combination in comment 5 and even with latest LTS kernel 4.9. Tested with intel SoC board. 
Are this LTP issue can be reproduce in kernel 4.9? 
Could you also verify with poky and meta-intel with kernel 4.9 only and tested in your SoC? 
Please provide more information.
Comment 10 Saul Wold 2017-06-29 15:16:19 UTC
This appears to work for various people trying to reproduce this, if this is still truly an issue, please re-open this bug and provide the additional information requested.

Thanks!