[Toybox] GitHub Action Example

Eric Molitor emolitor at molitor.org
Fri Jun 26 06:31:50 PDT 2020


I was able to reproduce both failures locally but only when using CLANG
with ASAN on Ubuntu 20.04.

CC=clang make defconfig
CC=clang ASAN=1 make
VERBOSE=1 make tests

scripts/runtest.sh: line 130: warning: command substitution: ignored null
byte in input
FAIL: grep match after NUL byte
echo -ne 'one\0and two three' | grep -a two
--- expected    2020-06-26 14:29:10.200000000 +0100
+++ actual      2020-06-26 14:29:10.210000000 +0100
@@ -1 +0,0 @@
-oneand two three

FAIL: sed megabyte s/x/y/g (5 sec timeout)
<--- For the sake of sanity I've snipped the many lines of xxxxxx's --->
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n'
| timeout 5 sed 's/x/y/g' | sha1sum
--- expected    2020-06-26 14:29:14.750000000 +0100
+++ actual      2020-06-26 14:29:19.760000000 +0100
@@ -1 +1 @@
-138c1fa7c3f64186203b0192fb4abdb33cb4e98a  -
+da39a3ee5e6b4b0d3255bfef95601890afd80709  -

- Eric


On Mon, Jun 22, 2020 at 3:55 AM Rob Landley <rob at landley.net> wrote:

> On 6/20/20 9:56 AM, Eric Molitor wrote:
> > I disabled builds on pull requests in the example which
> should discourage use.
> > By default only project members are notified but you can add non-project
> members
> > to the notifications. Currently the MacOS and GCC Ubuntu builds
> and tests are
> > completing fine but there are issues with the ASAN Clang Ubuntu and
> Alpine
> > builds. The latter is due to running in an unprivileged container.
> >
> > * ASAN Clang Ubuntu builds have two failures
>
> Unfortunately the ASAN ndk build breaks for me because when I set up the
> toolchain ala (3) in https://landley.net/toybox/faq.html#cross and do:
>
> ASAN=1
>
> CROSS_COMPILE=/home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-
> LDFLAGS=--static make distclean defconfig toybox
>
> The static build breaks with:
>
>
> /home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld:
> error: cannot mix -static with dynamic object
>
> /home/landley/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/lib/linux/
> libclang_rt.asan-x86_64-android.so
> toys/lsb/md5sum.c:416: error: undefined reference to 'sin'
>
> > 2020-06-20T14:46:07.3520007Z PASS: grep -l trumps -C
> > 2020-06-20T14:46:07.3822941Z scripts/runtest.sh: line 130: warning:
> command
> > substitution: ignored null byte in input
> > 2020-06-20T14:46:07.3823566Z FAIL: grep match after NUL byte
>
> This one works for me with the android NDK-21b clang?
>
> It fails with the musl build though, because the first fixup in
> lib/portability.h:
>
> // For musl
> #define _ALL_SOURCE
> #ifndef REG_STARTEND
> #define REG_STARTEND 0
> #endif
>
> never got fixed in musl:
>
> https://www.openwall.com/lists/musl/2013/01/15/26
> https://www.gitmemory.com/issue/nicm/fdm/77/578155457
> https://github.com/yrutschle/sslh/issues/40
> https://savannah.gnu.org/bugs/?50447
> https://github.com/tmux/tmux/issues/1994
>
> But that's a known bug in musl.
>
> Ahem, "design choice Rich made that regularly breaks people's code and has
> to be
> worked around". He dislikes such things being called bugs because bug
> implies
> mistake when he did it intentionally and has defended its preservation for
> years, at length, over multiple objections:
>
> https://marc.info/?l=git&m=147560139529266&w=2
>
> > 2020-06-20T14:46:07.4062489Z PASS: grep implicit BRE |
> > ...
> > 2020-06-20T14:46:18.8829033Z PASS: sed \n too high
> > 2020-06-20T14:46:23.9744710Z FAIL: sed megabyte s/x/y/g (5 sec timeout)
> > 2020-06-20T14:46:23.9993359Z PASS: sed s i and I
>
> Hmmm...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done;
> echo $X
> | toybox time toybox sed s/x/y/g | sha1sum'
> real 0.513341
> user 0.376000
> sys 0.004000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a  -
>
> That's the musl binary...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done;
> echo $X
> | ./toybox time ./toybox sed s/x/y/g | sha1sum'
> real 0.313839
> user 0.184000
> sys 0.000000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a  -
>
> glibc binary...
>
> $ bash -c 'X=x; Y=20; while [ $Y -gt 0 ]; do X=$X$X; Y=$(($Y-1)); done;
> echo $X
> | ./toybox time ./toybox sed s/x/y/g | sha1sum'
> real 0.555019
> user 0.424000
> sys 0.000000
> 138c1fa7c3f64186203b0192fb4abdb33cb4e98a  -
>
> bionic/clang binary.
>
> Even with AOSP building in the background, it took half a second on my
> laptop
> and the timeout is 10x that.
>
> > * Quite a few of the Alpine tests are failing as some of the tests
> depend upon
> > privileges that are not available when running in a container.
>
> In which case what I need to do is set up this environment locally and
> reproduce
> the issues so I can debug and fix them. If container privileges are
> breaking the
> tests... I'd like to know more about that but am not 100% sure that isn't
> pilot
> error? But I definitely want to reproduce it to understand the issue.
>
> I should set up a "run test suite with the 3 toolchains I usually test
> with"
> wrapper script...
>
> And I agree that "macos regression test build" is not an environment I
> otherwise
> have access to, and if github's going to offer that when nothing else
> does, I
> need to figure out how to take advantage of that to at least make
> Elliott's life
> easier. Not happy about it, trying to figure out least ugly way of doing
> it, but
> you're right it needs to be done.
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20200626/e3702a0e/attachment-0001.htm>


More information about the Toybox mailing list