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

ninja doesn’t work. #1306

Closed
ytrezq opened this issue Nov 1, 2016 · 12 comments
Closed

ninja doesn’t work. #1306

ytrezq opened this issue Nov 1, 2016 · 12 comments

Comments

@ytrezq
Copy link

ytrezq commented Nov 1, 2016

ninja is a build tool similar to make required to build chromium.

However, using it never work :

fatal: posix_spawn: Invalid argument

Windows build : 10.0.14393

@therealkenc
Copy link
Collaborator

Ninja proper has been working for me here since well before the anniversary update (I think?) so that's curious. If you post a link to a gist with the output of strace -ff ninja <whatever> that will help track down what's going on.

@skyem123
Copy link

skyem123 commented Nov 26, 2016

I'm not sure if I should post this here or in alwsl/alwsl#33, as I'm using it to get Arch Linux on WSL, however hopefully this is helpful, as I've found out how to reproduce this.

I have the same issue, whenever ninja tries to run a program, it errors with fatal: posix_spawn: Invalid argument.

Here is an example of trying to build ninja itself:

[skye@SKYE-WINDESK-01 ninja]$ ./configure.py --bootstrap
bootstrapping ninja...
wrote build.ninja.
bootstrap complete.  rebuilding...
[0/27] INLINE build/browse_py.hninja: fatal: posix_spawn: Invalid argument
Traceback (most recent call last):
  File "./configure.py", line 682, in <module>
    subprocess.check_call(rebuild_args)
  File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['./ninja']' returned non-zero exit status 1

Here is an strace log (strace -ff ninja -o log.txt): https://gist.github.com/skyem123/cfb3197a303a69d2f3fabeefb222abad

Hopefully this is useful!

@therealkenc
Copy link
Collaborator

That's clone(child_stack=0x7f341a850ff0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD), aka perennial #1005. You're on Arch though, so you could be looking at a more general problem at a lower level, like is being observed with Ubuntu Yakkety here . Ninja 1.7.1 still runs as advertised here on WSL Xenial anyway.

@skyem123
Copy link

skyem123 commented Nov 26, 2016

I'm not too sure how useful this will be, but I downloaded a copy of ninja from https://github.com/ninja-build/ninja/releases, and tried to run that, and I still got the same issue.

@therealkenc
Copy link
Collaborator

Gave me an excuse to upgrade to 1.7.2. Yeah it works fine on Xenial with 14971.

@skyem123
Copy link

Hm... I just checked my Windows build and it's 14393.447
I guess that means that the it's probably already fixed and I just need to wait until there's an update for it? (I'm hesitant to try the Windows insider stuff, though)

@therealkenc
Copy link
Collaborator

No the EINVAL on CLONE_VM|CLONE_VFORK|SIGCHLD in the trace you posted is still broken in 14971. So you're in luck, you don't need to try Insiders ;).

@skyem123
Copy link

This is interesting, when I run Ninja now on the Creators Update (still on Arch not Ubuntu) it doesn't have this error, it has a different one! In this case it seems to be related to #1878, as it has a very similar error to that.

[skye@Skye-WinDesk-01 ninja]$ ./configure.py
wrote build.ninja.
[skye@Skye-WinDesk-01 ninja]$ ninja
[0/27] INLINE build/browse_py.hninja: ../sysdeps/unix/sysv/linux/spawni.c:360: __spawnix: Assertion `ec'>= 0' failed.
Aborted (core dumped)
[skye@Skye-WinDesk-01 ninja]$

Note that for this, ninja is installed from the package manager. Bootstrapping ninja has the same error, this just shows it clearer.

The output of strace -ff ninja is... (after getting a working version of strace! bleeding edge on non standard systems is fun (my friend built version 4.14 for me on a real linux system)! actually building strace gives me the same error from the m4 command...) https://gist.github.com/skyem123/cdcc08668731e41738ca43fc31e50675.

Hopefully this is helpful!

@aseering
Copy link
Contributor

Hi @skyem123 -- thanks for posting the strace! Unfortunately, it looks like the -ff flag didn't take effect: ninja is trying to get a child process, but we didn't get separate lines for it.

That said, it appears to be failing immediately after the clone() call (to start the child process). I wonder if any clone() experts are lurking and recognize an issue here:

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f617b570000
rt_sigprocmask(SIG_BLOCK, ~[], [HUP INT TERM], 8) = 0
clone(child_stack=0x7f617b570ff0, flags=CLONE_VM|CLONE_VFORK|SIGCHLD) = 29425
write(2, "ninja: ../sysdeps/unix/sysv/linu"..., 87) = 87

Also, for what it's worth, I use ninja from Ubuntu 16.04's default repositories (ninja v1.5.1) and I don't see this issue. As a workaround, maybe downgrading would help?

@therealkenc
Copy link
Collaborator

This is a dupe of #1878 (or vice-verse). Which is why unzipping the locales manually is pointless, because glibc-recent will just hit the path on other stuff like ninja, m4, probably clang, etc.

@therealkenc
Copy link
Collaborator

The OP on this one was:

fatal: posix_spawn: Invalid argument

There was no strace provided so we'll never know; but best evidence this was #1005, because ninja wasn't being run on the supported 16.04 Xenial with glibc 2.23, and later unrelated #1878 (same reason).

@ytrezq
Copy link
Author

ytrezq commented Mar 30, 2018

I am confirming ninja is working… But only in latest development buid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants