WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Unable to run compiled binary

Open spoiledsport opened this issue 9 years ago • 9 comments

I am having a problem running UML(user mode Linux). I successfully compile the executable but when I try running it, I am getting the following error

./linux: cannot execute binary file: Exec format error

I already verified that the executable is correctly formatted.

file linux linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, not stripped

So the questions are : What is missing to make this happen? If I run strace, but I get the same error. This is very simple to reproduce. 1.- Download latest Linux source code 2.- apt-get install ncurses-devel 3.- Run make ARCH=um menuconfig 4.- Select exit and save configuration 5.- Run make ARCH=um 6.- when compilation completes, run ./Linux

spoiledsport avatar Apr 11 '17 23:04 spoiledsport

@spoiledsport - Can you please confirm what Windows build you are running? Also if you could share one of the compiled binaries that would be great so I don't have to set up the entire dev environment.

benhillis avatar Apr 12 '17 00:04 benhillis

This happens in every version, but I currently running creators edition

Microsoft Windows [Version 10.0.15063]

Included zipped binary

linux.zip

spoiledsport avatar Apr 12 '17 00:04 spoiledsport

Any idea on the issue is? Anything you may need from me?

spoiledsport avatar Jul 14 '17 21:07 spoiledsport

UML does compile and "run" on WSL per some discussion in #1692. Scary quotes because well it doesn't run, but for other reasons. Can't say why you are getting the Exec format error - it does build and execute for myself and others.

@benhillis - it is probably worth taking a look at this binary, because however it was created, it does launch on Real Linux but not WSL as of 17046. Meaning it isn't #330.

therealkenc avatar Nov 27 '17 06:11 therealkenc

I've identified an issue with the way our driver validates ELF headers. I'm working on a fix now.

benhillis avatar Jan 05 '18 18:01 benhillis

Heads up #2736 is floating out there as well, if you are poking around ELF. There is a reasonable enough repro over there if you squint.

therealkenc avatar Jan 07 '18 19:01 therealkenc

Fixed in 17093.

benhillis avatar Feb 08 '18 16:02 benhillis

Running into this issue and corporate likely won't let me upgrade to that build for a while. Is there any way to fix this myself without upgrading everything?

jmbouffa avatar Mar 12 '18 15:03 jmbouffa

@jmbouffa - Unfortunately, no. This fix is in WSL and WSL is built into the Windows OS. Can't think of any workarounds.

sunilmut avatar Mar 12 '18 18:03 sunilmut