Skip to content

ninja doesn’t work. #1306

Closed
Closed

Description

@ytrezq

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

Activity

  1. therealkenc commented on Nov 1, 2016

    @therealkenc

    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.

  2. skyem123 commented on Nov 26, 2016

    @skyem123

    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!

  3. therealkenc commented on Nov 26, 2016

    @therealkenc

    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.

  4. skyem123 commented on Nov 26, 2016

    @skyem123

    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.

  5. therealkenc commented on Nov 26, 2016

    @therealkenc

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

  6. skyem123 commented on Nov 27, 2016

    @skyem123

    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)

  7. therealkenc commented on Nov 27, 2016

    @therealkenc

    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 ;).

  8. skyem123 commented on Apr 13, 2017

    @skyem123

    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!

  9. aseering commented on Apr 15, 2017

    @aseering
    Contributor

    Hi Skye (@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?

  10. therealkenc commented on Apr 15, 2017

    @therealkenc

    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.

  11. therealkenc commented on Mar 18, 2018

    @therealkenc

    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).

  12. ytrezq commented on Mar 30, 2018

    @ytrezq
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions