microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.54k stars 823 forks source link

ionice: ioprio_set failed: Invalid argument #498

Closed MrObvious closed 7 years ago

MrObvious commented 8 years ago

Doing an Android compile, I cannot go much further on the brunch stage. Let me know if this is enough detail, or you need more.

For reference: http://stackoverflow.com/questions/37444998/error-ionice-ioprio-set-failed-invalid-argument-while-trying-to-build-custom

MrObvious commented 8 years ago

Hi any updates?

sunilmut commented 8 years ago

Sorry for the delay. Without an strace it is difficult to say what exactly (what's unimplemented) you are running into. Could you collect one and share it out?

MrObvious commented 8 years ago

Certainly. Do you have instructions?

sunilmut commented 8 years ago

strace -o strace_file_name -ff failing_command

And then share out the strace file.

MrObvious commented 8 years ago

user@PC:~/cm12$ strace -o strace_file_name -ff "schedtool -B -n 1 -e ionice -n 1 make -C $T -j$(cat /proc/c puinfo | grep "^processor" | wc -l) "$@"" strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature. strace: Can't stat 'schedtool -B -n 1 -e ionice -n 1 make -C -j4 ': No such file or directory

benhillis commented 8 years ago

Sorry I believe the "-ff" argument must come before "-o". After you run the below please share strace_file_name.* with us.

strace -ff -o strace_file_name failing_command

MrObvious commented 8 years ago

execve("/usr/bin/schedtool", ["schedtool", "-B", "-n", "1", "-e", "ionice", "-n", "1", "make", "-C", "-j4"], [/* 17 vars _/]) = 0 brk(0) = 0x15fe000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f301ac60000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=57039, ...}) = 0 mmap(NULL, 57039, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f301ac52000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0 mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f301a630000 mprotect(0x7f301a7ea000, 2097152, PROT_NONE) = 0 mmap(0x7f301a9ea000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f301a9ea000 mmap(0x7f301a9f0000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f301a9f0000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f301ac50000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f301ac40000 arch_prctl(ARCH_SET_FS, 0x7f301ac40740) = 0 mprotect(0x7f301a9ea000, 16384, PROT_READ) = 0 mprotect(0x602000, 4096, PROT_READ) = 0 mprotect(0x7f301ac22000, 4096, PROT_READ) = 0 munmap(0x7f301ac52000, 57039) = 0 getpid() = 1113 schedsetscheduler(1113, 0x3 / SCHED??? /, { 0 }) = 0 setpriority(PRIOPROCESS, 1113, 1) = 0 execve("/usr/local/sbin/ionice", ["ionice", "-n", "1", "make", "-C", "-j4"], [/ 17 vars /]) = -1 ENOENT (No such file or directory) execve("/usr/local/bin/ionice", ["ionice", "-n", "1", "make", "-C", "-j4"], [/ 17 vars /]) = -1 ENOENT (No such file or directory) execve("/usr/sbin/ionice", ["ionice", "-n", "1", "make", "-C", "-j4"], [/ 17 vars /]) = -1 ENOENT (No such file or directory) execve("/usr/bin/ionice", ["ionice", "-n", "1", "make", "-C", "-j4"], [/ 17 vars */]) = 0 brk(0) = 0x2539000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faa2a250000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=57039, ...}) = 0 mmap(NULL, 57039, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7faa2a242000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \2\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0 mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7faa29c30000 mprotect(0x7faa29dea000, 2097152, PROT_NONE) = 0 mmap(0x7faa29fea000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7faa29fea000 mmap(0x7faa29ff0000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7faa29ff0000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faa2a240000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faa2a230000 arch_prctl(ARCH_SET_FS, 0x7faa2a230740) = 0 mprotect(0x7faa29fea000, 16384, PROT_READ) = 0 mprotect(0x603000, 4096, PROT_READ) = 0 mprotect(0x7faa2a222000, 4096, PROT_READ) = 0 munmap(0x7faa2a242000, 57039) = 0 brk(0) = 0x2539000 brk(0x255a000) = 0x255a000 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=1607664, ...}) = 0 mmap(NULL, 1607664, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7faa2a099000 close(3) = 0 open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faa2a090000 read(3, "# Locale name alias data base.\n#"..., 512) = 512 read(3, "PURPOSE. See the\n# GNU General "..., 512) = 512 read(3, " entries are case independent.\n\n"..., 512) = 512 read(3, "859-1\nfinnish fi_FI.ISO-"..., 512) = 512 read(3, "R\nko_KR\t\tko_KR.eucKR\nlithuanian "..., 512) = 512 read(3, "SO-8859-9\n", 512) = 10 read(3, "", 512) = 0 close(3) = 0 munmap(0x7faa2a090000, 4096) = 0 open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US.utf8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.UTF-8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en/LC_MESSAGES/util-linux.mo", O_RDONLY) = -1 ENOENT (No such file or directory) ioprio_set(0x1, 0, 0x4001) = -1 EINVAL (Invalid argument) write(2, "ionice: ", 8) = 8 write(2, "ioprio_set failed", 17) = 17 write(2, ": ", 2) = 2 open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, "Invalid argument\n", 17) = 17 exit_group(1) = ? +++ exited with 1 +++

benhillis commented 8 years ago

Thanks, this looks like it's failing due to the ioprio_set system call not being implemented.

MrObvious commented 8 years ago

Hopefully is it an easy fix?

sunilmut commented 8 years ago

@MrObvious - I have opened a bug to track this, but unfortunately it won't make the cut for the Anniversary update. But, as far as Insider ring is considered, it shouldn't matter much because they should (hopefully) start flighting post RS1 bits soon.

thanhphat11 commented 8 years ago

This error is extremely important to fix. If bash on Windows 10 can not build rom android os, this is a very bad thing

MrObvious commented 8 years ago

Any updates on when this will be pushed out to the fast ring?

thanhphat11 commented 8 years ago

I have not noticed any updates to fix this error. @MrObvious

benhillis commented 8 years ago

Unfortunately this syscall isn't going to make the Windows 10 Anniversary Update. However, this is on our backlog and we'll definitely be looking into it.

thanhphat11 commented 8 years ago

I hope to have this fix update coming soon. @benhillis

akhilnarang commented 8 years ago

Use make instead of mka

aseering commented 8 years ago

As a workaround: ionice is almost certainly not actually required to build Android; it just causes the compile process to not slow down the rest of the machine so much while it's running.

Here's a replacement 'ionice' that's a no-op. It'd be interesting if someone could give it a try: https://gist.github.com/aseering/87cbb5e8fd8cbaef2eef2a39f64b3528

thanhphat11 commented 8 years ago

If without ionce is not build rom android @aseering how do you feel ??

aseering commented 8 years ago

@thanhphat11 -- Unfortunately, I don't understand your question... Could you re-phrase it?

thanhphat11 commented 8 years ago

Currently ionce error and I can not make it brunch rom android build tool can not check when I rom android brunch. Does your ionce can solve this problem ?? @aseering

akhilnarang commented 8 years ago

Brunch isn't needed to build an android ROM You can use lunch and make Brunch uses mka which uses schedtool and ionice with make, and ionice dosent seem to want to work

On Aug 11, 2016 5:53 AM, "Tsần Thành Phát" notifications@github.com wrote:

Currently ionce error and I can not make it brunch rom android build tool can not check when I rom android brunch. Does your ionce can solve this problem ?? @aseering https://github.com/aseering

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BashOnWindows/issues/498#issuecomment-239044305, or mute the thread https://github.com/notifications/unsubscribe-auth/AJpnfSmfUppOtoSO0rrd6ohTdagq43kUks5qemucgaJpZM4IyXGn .

aseering commented 8 years ago

Ah, thanks for re-phrasing. I hope my ionice will solve that problem. Could you try it and see if it works?

ionice doesn't work in WSL; I can't fix that. But I think the Android ROM build doesn't really need ionice. I think it just uses ionice for better performance. So my script just hides the error and disables ionice. I think that will work. But the only way to know for sure is to try it.

SGCMarkus commented 8 years ago

Hi, i tried your ionice workaround, and also the lunch/breakfast and then make combo, but either way i just get the output of what it builds (Platform, Target and so on) and afterwards nothing, CPU usage is at ~15% on all cores but no output anymore on the bash, if i cancel, i get loads of python errors:

File "build/tools/findleaves.py", line 100, in

main(sys.argv)

File "build/tools/findleaves.py", line 94, in main results = list(set(perform_find(mindepth, prune, dirlist, filename))) markus@DESKTOP-5E405NL:~/cm13$ File "build/tools/findleaves.py", line 33, in perform_find for root, dirs, files in os.walk(rootdir, followlinks=True): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): . . . File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 294, in walk for x in walk(new_path, topdown, onerror, followlinks): File "/usr/lib/python2.7/os.py", line 284, in walk if isdir(join(top, name)): File "/usr/lib/python2.7/genericpath.py", line 41, in isdir st = os.stat(s)

fmckeogh commented 8 years ago

I have the exact same issue as @SGCMarkus when compiling CyanogenMod 13 for Oneplus 3

MrObvious commented 8 years ago

The issue is still occurring on the latest build 14901.

azam426 commented 8 years ago

Update : This issue is still NOT solved in build 14926

rgatkinson commented 8 years ago

I think this is failing in findleaves.py because of some circular structure of symbolic links. findleaves is called from build/core/main.mk. It just might instead be a MAX_PATH issue.

thanhphat11 commented 8 years ago

I thought no one cared to fix this problem

thanhphat11 commented 8 years ago

This issue has been forgotten @all

benhillis commented 8 years ago

I've opened an internal bug to track this.

ghost commented 7 years ago

it's work for me with make command on cm-12.1 but get same error when run brunch untitled

Vikanen commented 7 years ago

Anyone managed fix to this?

matyasf commented 7 years ago

Any update on this? I've heard that the creators update will include updates to the Linux subsystem, will it have this syscall?

bitcrazed commented 7 years ago

@matyasf Please read thread above: We won't have time to implement the ioprio_set system call for Creators Update, but we have an internal bug tracking this issue and it's on the backlog for a future release.

snickler commented 7 years ago

@bitcrazed - Thanks for the update!

bm0x commented 7 years ago

image ´´´ No matter how hard I try ... I do not know how to fix the ionic error ... I hope the Creators Update has been fixed. ´´´

ghost commented 7 years ago

This issue is still occurring on build # 16184 (latest build in fast ring).

acrilique commented 7 years ago

It seems to work perfectly using $ lunch device And then $ make -j8 (I'm using -j8 cause 8 is the name of threads in my CPU).

But still getting error with brunch.

bm0x commented 7 years ago

image

No matter how much he has done the command, he does not advance at all...

aseering commented 7 years ago

Is your CPU in use when you're in this state? If so, what process is using CPU? If not, could you try running strace -ff make? And, assuming that hangs, post its output.

StoneToken commented 7 years ago

Hi there! Is there any ETA on this issue? It's still up on build 16232.

benhillis commented 7 years ago

Taking a look at this now.

benhillis commented 7 years ago

Some basic support for this system call is making its way to an Insider build.

sunilmut commented 7 years ago

This is fixed in Fall Creators Update and any build > 16273.