You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Build 16278, processes occasionally 'disappear'. This type of error has occured several times during compilation of GCC 7.2.0 as a cross-compiler. The common elements are fork: Invalid argument, and wait_for: No record of process nnnnn.
gcc-7.2.0/libcpp/configure: fork: Invalid argument
checking for build system preprocessor...
gcc-7.2.0/libcpp/configure: line 1: wait_for: No record of process 16132
gcc-7.2.0/libcpp/configure: fork: Invalid argument
checking for build system preprocessor...
The problem doesn't seem to be so much "processes disappearing" as the process didn't happen, screwing up the job accounting in bashhere. A fork failed. If you can catch the EINVAL in an strace we might be able to make a guess, but compiling gcc 7 under strace is a bear of a repro. And, given Murphy, it might not even fail under strace. Tough one.
Could be just running out of resources (memory) and the error message is less than ideal, like this example. Maybe try upping your Windows page file to something ridiculously large. Compile with make -j 1.
Or it could be a bug. You'll see more "same here" posts roll in if it's a general problem with 16278 versus previous releases.
I'm running a pytest browser test suite that launches gunicorn webserver through Python's subprocess module. Before upgrading to build 16278 it launched properly but now my code seems to lose the process and time out.
I haven't located the root of this issue as all I get from Python is OSError: [Errno 9] Bad file descriptor. I'll keep looking into it!
The webserver is able to run and accept connections when not started through Python but directly from bash.
I get this "somewhat reproducibly" doing some cross compiling, ex:
opencore-amr-0.1.5 as $ make -j 4
...
../libtool: fork: Invalid argument
or sometimes (I assume related) ... x86_64-w64-mingw32-g++: error: : No such file or directory
that's with like 8GB of RAM free according to Task Manager FWIW. If I restart the same "make" command then it may (or may not) continue smoothly to completion. lxfs. Make -j 1 seems to work OK. Disabling windows defender had no effect.
I got this while cross-compiling fftw in two bash windows, one for win32 and the other for win64 (and both doing "make -j 4") . I think it is just WSL being a bit flaky when spawning new processes too quickly.
Microsoft Windows [Version 10.0.16299.248]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\Hin-Tak>ver
Microsoft Windows [Version 10.0.16299.248]
C:\Users\Hin-Tak>
I got a /bin/bash: fork: Invalid argument while compiling AOSP 9.0 (Android Pie) under Ubuntu 18.04 in WSL (make -j6). Repeating make with the same job count produced no error.
Doubt it's a RAM thing as I have 32GB total and total usage never went above 20GB. This did happen after an hour or so of sustained heavy-load, like some others have encountered - but the possibly-interesting part was that this was at the end of AOSP compiling, where most of the work is compiling lots of Java.
I am also using ccache, as is pretty standard in AOSP compiling.
My Win10 build is 17763.379.
Dunno what else I can say, just a "me too" and "still happens for me", I guess.
I was creating bash script for some ocr stuff. It would run multiple instances imagemagick and tesseract-ocr. It was doing somewhat heavy IO, processing around 600-700 images, totaling about 500MB. It would also cap my CPU most of the time.
I realized that when letting the script create more than 4-5 subprocessess, I would start getting the ": fork: Invalid argument" -error. Checking the task manager revealed Microsoft Antimalware taking up most of the CPU time.
Sure enough, disabling the real time protection at the Windows Defender settings seems to have solved the problem.
I had defender already disabled in my WSL setup because of the performance issues - I still had the problem, so that's a red herring.
You mention 4-5 subprocesses, so 6 at most; but how many logical cores does your host have?
On 31 Mar. 2019, piiroim1 ***@***.***> wrote:
I was creating bash script for some ocr stuff. It would run multiple
instances imagemagick and tesseract-ocr. It was doing somewhat heavy
IO, processing around 600-700 images, totaling about 500MB. It would
also cap my CPU most of the time.
I realized that when letting the script create more than 4-5
subprocessess, I would start getting the "<scriptname>: fork: Invalid
argument" -error. Checking the task manager revealed Microsoft
Antimalware taking up most of the CPU time.
Disabling the real time protection at the Windows Defender settings
seems to have solved the problem.
I have 8 logical cores. However I don't seem to be able to reproduce the problem anymore. Before it would consistently happen when I set the number of subprocessess to 12. But now it seems to run just fine. The antivirus CPU usage does still ramp up though.
Not sure what to make of this. Seems quite random.
I had defender already disabled in my WSL setup because of the performance issues - I still had the problem, so that's a red herring. You mention 4-5 subprocesses, so 6 at most; but how many logical cores does your host have? …
On 31 Mar. 2019, piiroim1 @.***> wrote: I was creating bash script for some ocr stuff. It would run multiple instances imagemagick and tesseract-ocr. It was doing somewhat heavy IO, processing around 600-700 images, totaling about 500MB. It would also cap my CPU most of the time. I realized that when letting the script create more than 4-5 subprocessess, I would start getting the ": fork: Invalid argument" -error. Checking the task manager revealed Microsoft Antimalware taking up most of the CPU time. Disabling the real time protection at the Windows Defender settings seems to have solved the problem.
-- Sent with K-@](https://play.google.com/store/apps/details?id=com.onegravity.k10.pro2%22>K-@) Mail - the evolution of emailing.
Had this problem when building Servo and Anton Andreev (@toncho11)'s suggestion helped. Astonishing solution 😲
Didn't happen on WSL2, only on WSL1. Using AMD Ryzen 5 2600X on Windows Insider build 18922 if you ask.
--- stderr
No module named mako
Package libtizcore was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtizcore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtizcore' found
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
../../../../libtool: fork: Invalid argument
make[4]: *** [sp_state_so.lo] Error 254
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
thread 'main' panicked at 'failed with: exit code: 2', /home/saschanaz/.cargo/git/checkouts/osmesa-src-bf84ce2b80210dd7/97f4613/build.rs:61:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[Warning] Could not generate notification! Optional Python module 'dbus' is not installed.
Build FAILED in 0:03:31
Had this problem when building Servo and Anton Andreev (@toncho11)'s suggestion helped. Astonishing solution 😲
Didn't happen on WSL2, only on WSL1. Using AMD Ryzen 5 2600X on Windows Insider build 18922 if you ask.
--- stderr
No module named mako
Package libtizcore was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtizcore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libtizcore' found
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
../../../../libtool: fork: Invalid argument
make[4]: *** [sp_state_so.lo] Error 254
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
thread 'main' panicked at 'failed with: exit code: 2', /home/saschanaz/.cargo/git/checkouts/osmesa-src-bf84ce2b80210dd7/97f4613/build.rs:61:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[Warning] Could not generate notification! Optional Python module 'dbus' is not installed.
Build FAILED in 0:03:31
libtool: fork: Invalid argument
similar problems here during make, but I found if I reduce the number of threads, it doesn't fail.
I still get this in WSL1 sporadically under heavy load with at least 20.04 and 22.04 (it does seem better in WSL2...). I guess fix is to not do heavy process forking in WSL1 or to use WSL2? :|
Activity
Warblefly commentedon Sep 2, 2017
Yes, the host Ubuntu GCC. Version 5.4.0.
therealkenc commentedon Sep 3, 2017
The problem doesn't seem to be so much "processes disappearing" as the process didn't happen, screwing up the job accounting in
bashhere. A fork failed. If you can catch theEINVALin anstracewe might be able to make a guess, but compiling gcc 7 understraceis a bear of a repro. And, given Murphy, it might not even fail understrace. Tough one.Warblefly commentedon Sep 3, 2017
It's happened in other giant compiles I do, beside GCC. Reproduction is difficult because it is a rare failure, but potent when it happens.
therealkenc commentedon Sep 3, 2017
Could be just running out of resources (memory) and the error message is less than ideal, like this example. Maybe try upping your Windows page file to something ridiculously large. Compile with
make -j 1.Or it could be a bug. You'll see more "same here" posts roll in if it's a general problem with 16278 versus previous releases.
Majsvaffla commentedon Sep 8, 2017
I have a similar issue that could be related.
I'm running a pytest browser test suite that launches gunicorn webserver through Python's subprocess module. Before upgrading to build 16278 it launched properly but now my code seems to lose the process and time out.
I haven't located the root of this issue as all I get from Python is
OSError: [Errno 9] Bad file descriptor. I'll keep looking into it!The webserver is able to run and accept connections when not started through Python but directly from bash.
bitcrazed commentedon Nov 21, 2017
Sunil Muthuswamy (@sunilmut) Sarah Cooley (@scooley) Could you take a look if we're recording any errors that would result in a
fork: Invalid argumenterrors being returned?Ben Hillis (@benhillis) is OOF for a while, but copying too in case he's bored and looking for something to do ;)
rdp commentedon Dec 15, 2017
I get this "somewhat reproducibly" doing some cross compiling, ex:
or sometimes (I assume related)
... x86_64-w64-mingw32-g++: error: : No such file or directorythat's with like 8GB of RAM free according to Task Manager FWIW. If I restart the same "make" command then it may (or may not) continue smoothly to completion. lxfs. Make -j 1 seems to work OK. Disabling windows defender had no effect.
HinTak commentedon Feb 26, 2018
I got this while cross-compiling fftw in two bash windows, one for win32 and the other for win64 (and both doing "make -j 4") . I think it is just WSL being a bit flaky when spawning new processes too quickly.
rdp commentedon Feb 26, 2018
I don't get this "this morning" maybe try with this patch applied? #2697
HinTak commentedon Mar 2, 2018
I get that quite often with cross tools.
cosmicdan commentedon Mar 21, 2019
I got a
/bin/bash: fork: Invalid argumentwhile compiling AOSP 9.0 (Android Pie) under Ubuntu 18.04 in WSL (make -j6). Repeating make with the same job count produced no error.Doubt it's a RAM thing as I have 32GB total and total usage never went above 20GB. This did happen after an hour or so of sustained heavy-load, like some others have encountered - but the possibly-interesting part was that this was at the end of AOSP compiling, where most of the work is compiling lots of Java.
I am also using ccache, as is pretty standard in AOSP compiling.
My Win10 build is 17763.379.
Dunno what else I can say, just a "me too" and "still happens for me", I guess.
piiroim1 commentedon Mar 31, 2019
I was creating bash script for some ocr stuff. It would run multiple instances imagemagick and tesseract-ocr. It was doing somewhat heavy IO, processing around 600-700 images, totaling about 500MB. It would also cap my CPU most of the time.
I realized that when letting the script create more than 4-5 subprocessess, I would start getting the ": fork: Invalid argument" -error. Checking the task manager revealed Microsoft Antimalware taking up most of the CPU time.
Sure enough, disabling the real time protection at the Windows Defender settings seems to have solved the problem.
cosmicdan commentedon Mar 31, 2019
piiroim1 commentedon Mar 31, 2019
I have 8 logical cores. However I don't seem to be able to reproduce the problem anymore. Before it would consistently happen when I set the number of subprocessess to 12. But now it seems to run just fine. The antivirus CPU usage does still ramp up though.
Not sure what to make of this. Seems quite random.
toncho11 commentedon Apr 6, 2019
I have the same problem: compiling gcc, random messages from the same type ...
Disabling Windows Defender real time protection seems to help.
saschanaz commentedon Jun 24, 2019
Had this problem when building Servo and Anton Andreev (@toncho11)'s suggestion helped. Astonishing solution 😲
Didn't happen on WSL2, only on WSL1. Using AMD Ryzen 5 2600X on Windows Insider build 18922 if you ask.
fdcds commentedon Oct 29, 2019
Could this be an instance of the following bug in bash 4.3 (e.g. Ubuntu 16.04) which is fixed in bash 4.4 (e.g. Ubuntu 18.04)?
https://lists.gnu.org/archive/html/bug-bash/2016-06/msg00052.html
cslycord commentedon Jun 25, 2020
I get hit by the bug with bash 5 from a debian WSL instance.
GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2019 Free Software Foundation, Inc.Although, debian lists it as version 5.0-6.
therealkenc commentedon May 5, 2021
An
EINVALonfork(2)is "just wrong" even if the cause was OOM. Better in WSL2.GrayXu commentedon Mar 22, 2022
libtool: fork: Invalid argumentsimilar problems here during
make, but I found if I reduce the number of threads, it doesn't fail.adrian-gierakowski commentedon May 4, 2022
why is this issue closed? has a root cause been identified and fixed?
rdp commentedon Apr 24, 2025
I still get this in WSL1 sporadically under heavy load with at least 20.04 and 22.04 (it does seem better in WSL2...). I guess fix is to not do heavy process forking in WSL1 or to use WSL2? :|