Bug 13391 - acl ptest timeout due to perl update
Summary: acl ptest timeout due to perl update
Status: RESOLVED FIXED
Alias: None
Product: Package Testing (ptest)
Classification: QA/Testing
Component: ptest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: High normal
Target Milestone: 2.8 M2
Assignee: Alexander Kanavin
QA Contact:
URL:
Whiteboard:
: 13395 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-11 12:52 UTC by Richard Purdie
Modified: 2019-06-19 10:54 UTC (History)
3 users (show)

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


Attachments
Sledghammer which fixes the problem (3.72 KB, patch)
2019-06-13 13:32 UTC, Richard Purdie
no flags Details | Diff
Simpler patch to fix the problem (801 bytes, patch)
2019-06-13 22:04 UTC, Richard Purdie
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2019-06-11 12:52:29 UTC
acl ptest timeout for both qemux86-64 and qemuarm64:

https://autobuilder.yocto.io/pub/releases/yocto-2.8_M1.rc2/testresults/testresult-report.txt

This didn't used to happen, was triggered around the time of the gcc upgrade from 8 -> 9.
Comment 1 Richard Purdie 2019-06-13 11:34:31 UTC
I tracked this down to being caused by the perl upgrade from 5.28 to 5.30.

In 5.30, the $) = "2 2" assignment in ptest/test/run (a perl script) doesn't work and isn't able to change egid.

Not sure why at this point but reverting to 5.28 does allow the tests to complete (and not hang).
Comment 2 Richard Purdie 2019-06-13 12:50:05 UTC
Test script to reproduce the problem:

#!/usr/bin/env perl
$) = "2 2";
print $!;

Result from perl 5.28

setgroups(1, [2])                       = 0
setresgid(-1, 2, -1)                    = 0

Result from perl 5.30

setgroups(1, [-1])                      = -1 EINVAL (Invalid argument)
setresgid(-1, 2, -1)                    = 0
Comment 3 Richard Purdie 2019-06-13 13:23:39 UTC
Looking like it may be caused by this change: https://perl5.git.perl.org/perl.git/commitdiff/5d4a52b5c68a11bfc97c2e24806993b84a61eade
Comment 4 Richard Purdie 2019-06-13 13:32:36 UTC
Created attachment 4526 [details]
Sledghammer which fixes the problem
Comment 5 Richard Purdie 2019-06-13 13:33:18 UTC
Confirmed its that change upstream and that reverting to the previous function does fix the issue (sledgehammer approach). Now we need a correct fix.
Comment 6 Randy MacLeod 2019-06-13 14:48:49 UTC
*** Bug 13395 has been marked as a duplicate of this bug. ***
Comment 7 Alexander Kanavin 2019-06-13 16:35:31 UTC
This is unbelievably bad, if I am reading the code correctly. 

They have an argument to the string-to-number conversion function that
a) in the old version was used to simply return the position where the lookup ended;
b) in the new version is used to both provide a point where lookup should stop, and return the actual stopping point.

When the string is a space separated list of numbers, the argument gets rewritten to point to the end of the first number, then provided as "point where to stop", so the second number is never read.

Did I get this right?
Comment 8 Richard Purdie 2019-06-13 22:04:38 UTC
Created attachment 4527 [details]
Simpler patch to fix the problem
Comment 9 Richard Purdie 2019-06-13 22:06:06 UTC
(In reply to comment #7)
> This is unbelievably bad, if I am reading the code correctly. 
> 
> They have an argument to the string-to-number conversion function that
> a) in the old version was used to simply return the position where the
> lookup ended;
> b) in the new version is used to both provide a point where lookup should
> stop, and return the actual stopping point.
> 
> When the string is a space separated list of numbers, the argument gets
> rewritten to point to the end of the first number, then provided as "point
> where to stop", so the second number is never read.
> 
> Did I get this right?

I think so. I have a patch which appears to fix it yet I'm still not quite sure I understand/believe it.

As I understand it this is a genuine bug in perl but we have to submit it with perlbug. I wonder if we've ever tried that before...
Comment 10 Richard Purdie 2019-06-14 12:37:17 UTC
Submitted upstream: https://rt.perl.org/Public/Bug/Display.html?id=134195
Comment 11 Alexander Kanavin 2019-06-18 10:57:22 UTC
Patch landed in master:
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=5d8c4e3f47acd1b181760274a39d6707abd976b8

Thanks for taking care of this!
Comment 12 Richard Purdie 2019-06-19 10:54:23 UTC
*** Bug 13395 has been marked as a duplicate of this bug. ***