Skip to content

MacOS test failures on some systems #467

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

Closed
andrewrk opened this issue Sep 12, 2017 · 15 comments
Closed

MacOS test failures on some systems #467

andrewrk opened this issue Sep 12, 2017 · 15 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Sep 12, 2017

The first commit that broke it was 9fb4d1f

The next few commits fixed it on my MacBook Air but did not fix it for Travis CI.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Sep 12, 2017
@andrewrk andrewrk added this to the 0.1.0 milestone Sep 12, 2017
@andrewrk
Copy link
Member Author

fixed with 6e5edc7

there is still an issue if we run all the tests at once, but I can't duplicate it on my macbook, and so I'm calling that a separate issue that 0.1.0 does not depend on.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

@snocl I noticed you are using MacOS. Do all tests pass for you when run like this?

./zig build --build-file ../build.zig test

After N child processes execute on Travis, it crashes (which is why I used the above workaround), but I can't reproduce the issue on my mac.

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

No, after a bunch of successes I get:

...
Test 43/45 compare-output @embedFile (Debug)...OK
Test 44/45 compare-output @embedFile (ReleaseSafe)...OK
Test 45/45 compare-output @embedFile (ReleaseFast)...OK
PASS build example/hello_world/hello.zig (Debug)
PASS build example/hello_world/hello.zig (ReleaseSafe)
PASS build example/hello_world/hello.zig (ReleaseFast)
PASS build example/hello_world/hello_libc.zig (Debug)
PASS build example/hello_world/hello_libc.zig (ReleaseSafe)
PASS build example/hello_world/hello_libc.zig (ReleaseFast)
PASS build example/cat/main.zig (Debug)
PASS build example/cat/main.zig (ReleaseSafe)
PASS build example/cat/main.zig (ReleaseFast)
PASS build example/guess_number/main.zig (Debug)
PASS build example/guess_number/main.zig (ReleaseSafe)
PASS build example/guess_number/main.zig (ReleaseFast)
PASS build example/shared_library/build.zig (Debug)

Build failed. Use the following command to reproduce the failure:
/Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/build ./zig /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache test
Process ./zig exited with error code 255

Build failed. Use the following command to reproduce the failure:
./../zig-cache/build ./zig ./.. ./../zig-cache test

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

I don’t know if this is related, but trying to run the /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/build command it suggests, causes a SIGKILL; lldb says Malformed Mach-o file.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

I don't expect you to do this, but if you wanted to help troubleshoot this further:

You can add --verbose to that command and it should print what it was trying to do. I suspect that if you then run that command directly it will pass.

Next we need to figure out how to run that command with lldb or gdb or some other way to get a backtrace and figure out what exactly happened.

I have a mac running (I think - I'll check when I get home) 10.12 but I'm not an expert on how it works, is there any more version number or system information that we can compare to see what's different about your environment and mine?

@andrewrk andrewrk reopened this Oct 3, 2017
@andrewrk andrewrk changed the title MacOS test failures on Travis CI MacOS test failures on some systems Oct 3, 2017
@andrewrk andrewrk modified the milestones: 0.1.0, 0.2.0 Oct 3, 2017
@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

Running it again with --verbose yields:

...
PASS build example/shared_library/build.zig (Debug)
./zig build --build-file /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/build.zig test --verbose 

Build failed. Use the following command to reproduce the failure:
/Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/build ./zig /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache test --verbose
Process ./zig exited with error code 255

Build failed. Use the following command to reproduce the failure:
./../zig-cache/build ./zig ./.. ./../zig-cache --verbose test

Running ./zig build --build-file /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/build.zig test --verbose manually gives:


Build failed. Use the following command to reproduce the failure:
/Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/build ./zig /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache test --verbose

and exits with error code 255.

I can’t think of any other version numbers that might be relevant of the top of my head...

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

Interestingly, running zig build test from the mix_o_files directory succeeds.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

Interesting. I think this may be a separate issue. I think we can run that last command printed with a debugger and see what happened.

That "malformed macho file" message is surprising. I don't know how the binary was able to run at all if it was malformed.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

I suspect this may be an LLD issue. Eventually we're going to have to improve the macho LLD code since the llvm team has been neglecting it

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

Seems like it only fails if the build file is given as an absolute path:

$ zig build --build-file build.zig test --verbose
zig build-obj /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/base64.zig --cache-dir /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache --output /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/base64.o --output-h /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/base64.h --name base64 
cc -c /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/test.c -o /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/test.c.o -std=c99 -I /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache 
cc /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/base64.o /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/test.c.o -o /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/test -Wl,-rpath,/Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache -rdynamic -Wl,-search_paths_first 
cd /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files; zig-cache/test 
$ zig build --build-file "$(pwd)"/build.zig test --verbose

Build failed. Use the following command to reproduce the failure:
/Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache/build zig /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files /Users/snorre/Home/Code/Foreign/zig/example/mix_o_files/zig-cache test --verbose

EDIT: I think the Malformed Mach-o file message is a result of the building of the builder failing.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

That's really strange. The same test passes on travis as well as my mac.

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

I will look into it later, but have to leave right now.

@andrewrk
Copy link
Member Author

andrewrk commented Oct 3, 2017

I appreciate your help. For what it's worth, I think this is a bit of an edge case, and in my mind a relatively lower priority issue. If you wanted to play around with zig I wouldn't worry about this particular issue right now.

@snocl
Copy link
Contributor

snocl commented Oct 3, 2017

Confirmed Heisenbug: launching it from lldb fails, but running it normally succeeds (when the path looks a certain way, apparently).

@andrewrk andrewrk modified the milestone: 0.2.0 Oct 19, 2017
@andrewrk
Copy link
Member Author

andrewrk commented Jan 6, 2018

I believe this is fixed now. Travis CI all tests passing.

@andrewrk andrewrk closed this as completed Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants