Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std lib tests failing on aarch64 #3288

Open
andrewrk opened this issue Sep 22, 2019 · 4 comments
Open

std lib tests failing on aarch64 #3288

andrewrk opened this issue Sep 22, 2019 · 4 comments
Labels
arch-aarch64 64-bit ARM bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

./zig test ../std/std.zig -target aarch64v8_5a-linux-none --test-cmd qemu-aarch64 --test-cmd-bin --override-std-dir ../std 
208/1221 rb.test "std-aarch64-linux-none-Debug-bare-multirb"...invalid enum value
/home/andy/dev/zig/std/rb.zig:106:16: 0x460343 in rb.Node.getColor (test)
        return @intToEnum(Color, @intCast(u1, node.parent_and_color & 1));
               ^
/home/andy/dev/zig/std/rb.zig:84:29: 0x45ff77 in rb.Node.isBlack (test)
        return node.getColor() == Black;
                            ^
/home/andy/dev/zig/std/rb.zig:183:33: 0x3d84c7 in rb.Tree.insert (test)
            if (parent.*.isBlack())
                                ^
/home/andy/dev/zig/std/rb.zig:533:20: 0x33bc6f in rb.test "std-aarch64-linux-none-Debug-bare-multirb" (test)
    _ = tree.insert(&ns[3].node);
                   ^
/home/andy/dev/zig/std/special/test_runner.zig:13:25: 0x7f423b in std.special.main (test)
        if (test_fn.func()) |_| {
                        ^
/home/andy/dev/zig/std/special/start.zig:189:37: 0x7f3907 in std.special.posixCallMainAndExit (test)
            const result = root.main() catch |err| {
                                    ^
/home/andy/dev/zig/std/special/start.zig:87:5: 0x7f379f in std.special._start (test)
    @noInlineCall(posixCallMainAndExit);
    ^
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library. arch-aarch64 64-bit ARM labels Sep 22, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Sep 22, 2019
@andrewrk andrewrk changed the title std.rb test failing on aarch64 std lib tests failing on aarch64 Sep 22, 2019
@andrewrk
Copy link
Member Author

More:

210/1221 rb.test "std-aarch64-linux-none-Debug-bare-multimultiple inserts, followed by calling first and last"...invalid enum value
/home/andy/dev/zig/std/rb.zig:106:16: 0x595223 in rb.Node.getColor (test)
        return @intToEnum(Color, @intCast(u1, node.parent_and_color & 1));
               ^
/home/andy/dev/zig/std/rb.zig:84:29: 0x45eddb in rb.Node.isBlack (test)
        return node.getColor() == Black;
                            ^
/home/andy/dev/zig/std/rb.zig:183:33: 0x3d80b3 in rb.Tree.insert (test)
            if (parent.*.isBlack())
                                ^
/home/andy/dev/zig/std/rb.zig:591:20: 0x33bdb3 in rb.test "std-aarch64-linux-none-Debug-bare-multimultiple inserts, followed by calling first and last" (test)
    _ = tree.insert(&second.node);
                   ^
/home/andy/dev/zig/std/special/test_runner.zig:13:25: 0x7f301f in std.special.main (test)
        if (test_fn.func()) |_| {
                        ^
/home/andy/dev/zig/std/special/start.zig:189:37: 0x7f26eb in std.special.posixCallMainAndExit (test)
            const result = root.main() catch |err| {
                                    ^
/home/andy/dev/zig/std/special/start.zig:87:5: 0x7f2583 in std.special._start (test)
    @noInlineCall(posixCallMainAndExit);
    ^
243/1221 fs.path.test "std-aarch64-linux-none-Debug-bare-multiresolveWindows"...reached unreachable code
/home/andy/dev/zig/std/fs/path.zig:411:9: 0x470163 in fs.path.resolveWindows (test)
        switch (parsed.kind) {
        ^
/home/andy/dev/zig/std/fs/path.zig:705:26: 0x3e910b in fs.path.testResolveWindows (test)
    return resolveWindows(debug.global_allocator, paths) catch unreachable;
                         ^
/home/andy/dev/zig/std/fs/path.zig:682:50: 0x33f4ff in fs.path.test "std-aarch64-linux-none-Debug-bare-multiresolveWindows" (test)
    testing.expect(mem.eql(u8, testResolveWindows([_][]const u8{ "//server/share", "..", "relative\\" }), "\\\\server\\share\\relative"));
                                                 ^
/home/andy/dev/zig/std/special/test_runner.zig:13:25: 0x7f2d27 in std.special.main (test)
        if (test_fn.func()) |_| {
                        ^
/home/andy/dev/zig/std/special/start.zig:189:37: 0x7f23f3 in std.special.posixCallMainAndExit (test)
            const result = root.main() catch |err| {
                                    ^
/home/andy/dev/zig/std/special/start.zig:87:5: 0x7f228b in std.special._start (test)
    @noInlineCall(posixCallMainAndExit);
    ^
qemu: uncaught target signal 6 (Aborted) - core dumped

Tests failed. Use the following command to reproduce the failure:
/home/andy/dev/zig/zig-cache/o/CmEnwVQ9qGTiedBxe3AyoCzuc6ZWgH_L9pLAl8xPWeK4XRpbvoSCvwscYWtlhRLB/test
248/1221 fs.path.test "std-aarch64-linux-none-Debug-bare-multirelative"...reached unreachable code
/home/andy/dev/zig/std/fs/path.zig:411:9: 0x597e3f in fs.path.resolveWindows (test)
        switch (parsed.kind) {
        ^
/home/andy/dev/zig/std/fs/path.zig:975:45: 0x470d47 in fs.path.relativeWindows (test)
    const resolved_from = try resolveWindows(allocator, [_][]const u8{from});
                                            ^
/home/andy/dev/zig/std/fs/path.zig:1138:35: 0x3e8f4f in fs.path.testRelativeWindows (test)
    const result = relativeWindows(debug.global_allocator, from, to) catch unreachable;
                                  ^
/home/andy/dev/zig/std/fs/path.zig:1107:24: 0x34069f in fs.path.test "std-aarch64-linux-none-Debug-bare-multirelative" (test)
    testRelativeWindows("\\\\foo\\bar", "\\\\foo\\bar\\baz", "baz");
                       ^
/home/andy/dev/zig/std/special/test_runner.zig:13:25: 0x7f28eb in std.special.main (test)
        if (test_fn.func()) |_| {
                        ^
/home/andy/dev/zig/std/special/start.zig:189:37: 0x7f1fb7 in std.special.posixCallMainAndExit (test)
            const result = root.main() catch |err| {
                                    ^
/home/andy/dev/zig/std/special/start.zig:87:5: 0x7f1e4f in std.special._start (test)
    @noInlineCall(posixCallMainAndExit);
    ^
qemu: uncaught target signal 6 (Aborted) - core dumped

Tests failed. Use the following command to reproduce the failure:
/home/andy/dev/zig/zig-cache/o/F6qo1i2P6CoI8FzsY5pkfmJlyjOhJ1zIt0_KYM4e0568HLtEZBkXebzTmXLaTAFD/test

That's it though. With these disabled, the rest of the std lib tests pass.

@andrewrk
Copy link
Member Author

andrewrk commented Sep 22, 2019

With -lc -target aarch64-linux-gnu:

361/1221 io.test.test "std-aarch64-linux-gnu-Debug-c-multi write a file, read it, then delete it"...unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
...this goes on for a long time
910/1221 os.test.test "std-aarch64-linux-gnu-Debug-c-multi AtomicFile"...unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22
unexpected errno: 22

Just those 2 for that target.

@LemonBoy
Copy link
Contributor

The first two failures are due to #3271, sadly

andrewrk added a commit that referenced this issue Sep 22, 2019
 * add zig build option `-Dskip-libc` to skip tests that build libc
   (e.g. if you don't want to wait for musl to build)
 * add `-Denable-wine` option which uses wine to run cross compiled
   windows tests on non-windows hosts
 * add `-Denable-qemu` option which uses qemu to run cross compiled
   foreign architecture tests
 * add `-Denable-foreign-glibc=path` option which combined with
   `-Denable-qemu` enables running cross compiled tests that link
   against glibc. See
   https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to
   produce this directory.
 * the test matrix is done manually. release test builds are only
   enabled by default for the native target. this should save us some CI
   time, while still providing decent coverage of release builds.
   - add test coverage for `x86_64-linux-musl -lc` (building musl libc)
   - add test coverage for `x86_64-linux-gnu -lc` (building glibc)
   - add test coverage for `aarch64v8_5a-linux-none`
   - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc)
   - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc)
   - add test coverage for `arm-linux-none`
   - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is
     disabled due to #3286
   - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled
     due to #3287
   - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is
     disabled due to #3285
 * enable qemu testing on the Linux CI job. There's not really a good
   reason to enable wine, since we have a Windows CI job as well.
 * remove the no longer needed `--build-file ../build.zig` from CI
   scripts
 * fix bug in glibc compilation where it wasn't properly reading the abi
   list txt files, resulting in "key not found" error.
 * std.build.Target gains:
   - isNetBSD
   - isLinux
   - osRequiresLibC
   - getArchPtrBitWidth
   - getExternalExecutor
 * zig build system gains support for enabling wine and enabling qemu.
   `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This
   communicates that the system has these tools installed and the build
   system will use them to run tests.
 * zig build system gains support for overriding the dynamic linker of
   an executable artifact.
 * fix std.c.lseek prototype. makes behavior tests for
   arm-linux-musleabihf pass.
 * disable std lib tests that are failing on ARM. See #3288, #3289
 * provide `std.os.off_t`.
 * disable some of the compiler_rt symbols for arm 32 bit. Fixes
   compiler_rt tests for arm 32 bit
 * add __stack_chk_guard when linking against glibc. Fixes std lib tests
   for aarch64-linux-gnu
 * workaround for "unable to inline function" using `@inlineCall`. Fixes
   compiler_rt tests for arm 32 bit.
andrewrk added a commit that referenced this issue Sep 25, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Oct 23, 2019
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 30, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@zhaozg
Copy link
Contributor

zhaozg commented Nov 14, 2020

I crossbuild luajit with target aarch64-linux-gnu and got luajit,
run with qemu, I got

qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped

@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-aarch64 64-bit ARM bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

3 participants