Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Bad file descriptor on buster 27 and 28 armh builds #2

Closed
snowzach opened this issue Aug 14, 2019 · 5 comments
Closed

Bad file descriptor on buster 27 and 28 armh builds #2

snowzach opened this issue Aug 14, 2019 · 5 comments

Comments

@snowzach
Copy link

snowzach commented Aug 14, 2019

[Required] Your device (RaspberryPi3, LaptopPC, or other device name):
qemu on x86_64 docker

[Required] Your device's CPU architecture (armv7l, x86_64, or other architecture name):
arm7l

[Required] Your OS (Raspbian, Ubuntu1604, or other os name):
Debian Buster

[Required] Details of the work you did before the problem occurred:

[Required] Error message:

root@7a626b435c10:/tmp# ./bazel
Opening zip "/proc/self/exe": lseek(): Bad file descriptor
FATAL: Failed to open Bazel as a zip file: (error: 9): Bad file descriptor

[Required] Overview of problems and questions:
Am I missing any packages or is there something wrong with the build maybe?

@snowzach snowzach changed the title Bad file descriptor on buster 27 and 28 builds Bad file descriptor on buster 27 and 28 armh builds Aug 14, 2019
@snowzach
Copy link
Author

Hmmm.. I think this has something to do with running qemu/docker. I just tried this on my raspberry pi and it seemed to work.

@snowzach
Copy link
Author

Okay, I figured it out. I am using Docker and Qemu to build this and for whatever reason the /proc/self/exe auto-symlink thing doesn't work inside of docker.

I was able to fix this by editing the bazel executable with sed and replaced it with a string of equal length that was in the path... it just so happens /usr/bin/bazel is the same length as /proc/self/exe

sed -i 's@/proc/self/exe@/usr/bin/bazel@' bazel

I then installed it to /usr/bin/bazel and it works.

@PINTO0309
Copy link
Owner

@snowzach
Thank you for your feedback. I performed the following steps that you taught me and executed Bazel. A Segmentation Fault occurred. I tried to run the same command against the compiled "bazel" binary.

sed -i 's@/proc/self/exe@/usr/bin/bazel@' bazel

@snowzach
Copy link
Author

snowzach commented Aug 16, 2019

Thanks for looking. This appears to be another qemu issue. I upgraded to qemu 4.1.0 and this issue went away. Another issue popped up.

# ./bazel
Extracting Bazel installation...
Cannot enumerate embedded binaries:  (Value too large for defined data type)

Oh well, I'll keep trying to figure it out.

@PINTO0309
Copy link
Owner

I have also been experiencing errors for two months, just like you.
QEMU 4.0.0 + chroot
Screenshot 2019-08-16 11:42:35

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants