Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using run.sh or build.sh gives me an error. #150

Open
anzosasuke opened this issue Jul 2, 2023 · 8 comments
Open

using run.sh or build.sh gives me an error. #150

anzosasuke opened this issue Jul 2, 2023 · 8 comments

Comments

@anzosasuke
Copy link

I tried AFL_NO_X86=1 too. couldn't proceed further. Please help.

#1 transferring dockerfile: 2.45kB done
#1 DONE 0.1s

#2 [internal] load .dockerignore
#2 transferring context: 47B done
#2 DONE 0.1s

#3 [internal] load metadata for docker.io/library/ubuntu:18.04
#3 DONE 0.6s

#4 [ 1/20] FROM docker.io/library/ubuntu:18.04@sha256:152dc042452c496007f07ca9127571cb9c29697f42acbfad72324b2bb2e43c98
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 2.33kB done
#5 DONE 0.1s

#6 [ 3/20] RUN mkdir -p /home && 	groupadd -g 1000 magma && 	useradd -l -u 1000 -K UMASK=0000 -d /home -g magma magma && 	chown magma:magma /home
#6 CACHED

#7 [ 6/20] RUN mkdir -p /magma/magma && chown magma:magma /magma/magma
#7 CACHED

#8 [10/20] RUN mkdir -p /magma/fuzzers/afl && chown magma:magma /magma/fuzzers/afl
#8 CACHED

#9 [11/20] COPY --chown=magma:magma .//fuzzers/afl /magma/fuzzers/afl/
#9 CACHED

#10 [ 5/20] RUN mkdir -p /magma_shared /magma_out && 	chown magma:magma /magma_shared /magma_out && 	chmod 744 /magma_shared /magma_out
#10 CACHED

#11 [ 9/20] RUN /magma/magma/prebuild.sh
#11 CACHED

#12 [12/20] RUN /magma/fuzzers/afl/preinstall.sh
#12 CACHED

#13 [ 4/20] RUN	ECHO "magma:amgam" | chpasswd && usermod -a -G sudo magma
#13 CACHED

#14 [ 8/20] RUN /magma/magma/preinstall.sh
#14 CACHED

#15 [ 2/20] RUN apt-get update && apt-get install -y sudo
#15 CACHED

#16 [ 7/20] COPY --chown=magma:magma .//magma /magma/magma/
#16 CACHED

#17 [13/20] RUN /magma/fuzzers/afl/fetch.sh
#17 CACHED

#18 [14/20] RUN /magma/fuzzers/afl/build.sh
#18 0.309 [*] Checking for the ability to compile x86 code...
#18 0.319 clang: error: unable to make temporary file: Permission denied
#18 0.321 
#18 0.321 Oops, looks like your compiler can't generate x86 code.
#18 0.321 
#18 0.321 Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first.
#18 0.321 (To ignore this error, set AFL_NO_X86=1 and try again.)
#18 0.321 
#18 0.321 Makefile:52: recipe for target 'test_x86' failed
#18 0.321 make: *** [test_x86] Error 1
#18 ERROR: process "/bin/sh -c ${FUZZER}/build.sh" did not complete successfully: exit code: 2
------
 > [14/20] RUN /magma/fuzzers/afl/build.sh:
#18 0.309 [*] Checking for the ability to compile x86 code...
#18 0.319 clang: error: unable to make temporary file: Permission denied
#18 0.321 
#18 0.321 Oops, looks like your compiler can't generate x86 code.
#18 0.321 
#18 0.321 Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first.
#18 0.321 (To ignore this error, set AFL_NO_X86=1 and try again.)
#18 0.321 
#18 0.321 Makefile:52: recipe for target 'test_x86' failed
#18 0.321 make: *** [test_x86] Error 1
------
Dockerfile:56
--------------------
  54 |     USER magma:magma
  55 |     RUN ${FUZZER}/fetch.sh
  56 | >>> RUN ${FUZZER}/build.sh
  57 |     
  58 |     ARG target_name
--------------------
ERROR: failed to solve: process "/bin/sh -c ${FUZZER}/build.sh" did not complete successfully: exit code: 2```
@adrianherrera
Copy link
Member

adrianherrera commented Jul 2, 2023 via email

@anzosasuke
Copy link
Author

anzosasuke commented Jul 2, 2023

I can't seem to create a temporary file. I think my docker permission is correct. to fix docker permission went through all of this https://phoenixnap.com/kb/docker-permission-denied

#10 [ 7/20] COPY --chown=magma:magma .//magma /magma/magma/
#10 CACHED

#11 [ 3/20] RUN mkdir -p /home && 	groupadd -g 1000 magma && 	useradd -l -u 1000 -K UMASK=0000 -d /home -g magma magma && 	chown magma:magma /home
#11 CACHED

#12 [ 8/20] RUN /magma/magma/preinstall.sh
#12 CACHED

#13 [ 9/20] RUN /magma/magma/prebuild.sh
#13 0.323 Cannot create temporary file in ./: Permission denied
#13 0.430 /magma/magma/prebuild.sh: line 14:     8 Aborted                 (core dumped) $CC $CFLAGS -D"MAGMA_STORAGE=\"$MAGMA_STORAGE\"" -c "$MAGMA/src/storage.c" -fPIC -I "$MAGMA/src/" -o "$OUT/pre_storage.o" $LDFLAGS
#13 ERROR: process "/bin/sh -c ${MAGMA}/prebuild.sh" did not complete successfully: exit code: 134

@adrianherrera
Copy link
Member

If you run groups, are you a member of the docker group? What command are you running here?

@anzosasuke
Copy link
Author

I do have my name in groups.
When running ./run.sh, I am getting this error.

@adrianherrera
Copy link
Member

adrianherrera commented Jul 3, 2023 via email

@anzosasuke
Copy link
Author

groups: "anzo adm cdrom sudo dip plugdev lpadmin lxd sambashare docker"
docker is also in the group.

@adrianherrera
Copy link
Member

Can you create files in the current directory you're running ./run.sh from? I'm not sure how much more I can help.

@anzosasuke
Copy link
Author

Yeah i can create files or folders in that directory. I wanted the binary files. I would be grateful if you could provide me with the binaries if it isn't too much trouble for you.

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

No branches or pull requests

2 participants