Bug 14552

Summary: Timeout reported as "ERROR: Exit status is 9" which is not very helpful
Product: [Yocto Project Subprojects] Ptest-runner Reporter: Tim Orling <tim.orling>
Component: ptest-runnerAssignee: Aníbal Limón <anibal>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: alex.kanavin, anibal, randy.macleod, richard.purdie, tvgamblin
Version: unspecified   
Target Milestone: 4.0 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Tim Orling 2021-09-16 15:16:29 UTC
When a timeout occurs in a running test, what we see in the logs is:
'ERROR: Exit status is 9'

It would be helpful if ptest-runner2 actually reported the reason for the error status as timeout related (otherwise someone might erroneously think the exit code is coming from the ptest itself and not the ptest-runner).

See https://bugzilla.yoctoproject.org/show_bug.cgi?id=14258#c6
And the log: 
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/1998/steps/12/logs/stdio
         'ERROR: Exit status is 9\n'
         'DURATION: 2904\n',
 'strace': ['kill_child.test']}

The code in question:
http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/tree/utils.c#n529

It seems that there is a different path to timeout that is not being trapped by:
http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/tree/utils.c#n533
Comment 2 Alexander Kanavin 2021-09-16 16:03:02 UTC
I think so. Can you try the patches locally?
Comment 3 Randy MacLeod 2021-09-23 14:35:36 UTC
Anibal, If you can do this great, if not, ping me and I'll take a look.
Comment 4 Randy MacLeod 2021-09-28 22:41:56 UTC
I was tempted to use this library:
  http://libexplain.sourceforge.net/
  https://linux.die.net/man/3/explain_waitpid
but we probably shouldn't add complexity to ptest-runner.
What do you think Anibal?
Comment 5 Alexander Kanavin 2021-09-29 07:12:13 UTC
The library isn't going to help much. We know that error 9 is killing ptest on timeout, what we need is as much information as possible about why ptest got stuck.
Comment 6 Aníbal Limón 2021-09-29 16:02:44 UTC
(In reply to comment #5)
> The library isn't going to help much. We know that error 9 is killing ptest
> on timeout, what we need is as much information as possible about why ptest
> got stuck.

Yes I think the unique way is to see the logs and figure out why got stuck or reproduce the issue locally.
Comment 7 Alexander Kanavin 2022-01-06 16:02:07 UTC
I think this has already been fixed?
https://git.yoctoproject.org/ptest-runner2/log/
Comment 8 Alexander Kanavin 2022-01-21 22:15:25 UTC
Fixed as described above.