I'm trying to install java 8 SDK in a qemu emulated chrooted environment and I'm running up against the following error

readelf: Error: /proc/self/exe: Failed to read file's magic number

Readelf works when the path is not absolute. The following outputs the correct header.

cd / && readelf -h proc/self/exe

But the following does not

readelf -h /proc/self/exe

Any suggestions or continuing debugging tips? Thanks in advance!



ls -l proc/self/exe /proc/self/exe

and see if there is a difference.

Why would you even want to show the header of readelf inside the chroot?

  • The /proc/self/exe is linked to /bin/ls, why does readelf not follow this symlink, why does using the absolute path matter? As to that second question, it's called in the pre-configuring packages process when installing oracle-java8-installer. I'm guessing it's for getting system information? – J.Hartmann Sep 6 '18 at 18:38
  • It must be an issue with qemu emulated chrooted environment, in a normal chroot both work. Also the message doesn't say No such file. It seems open is successful, but read isn't. Try strace readelf -h /proc/self/exe – RalfFriedl Sep 6 '18 at 18:56
  • The output of strace says it all! qemu: Unsupported syscall: 26. Thank-you so much for your help! – J.Hartmann Sep 6 '18 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.