angr / phuzzer

The new phuzzing framework!
BSD 2-Clause "Simplified" License
154 stars 24 forks source link

Qemu build issues on Ubuntu 19 #4

Closed monik3r closed 1 year ago

monik3r commented 4 years ago

Hi,

There seems to be a problem with building QEMU while running Ubuntu 19 when setting up phuzzer.

   static int memfd_create(const char *name, unsigned int flags)
              ^~~~~~~~~~~~
  In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:111:0,
                   from /usr/include/x86_64-linux-gnu/bits/mman.h:34,
                   from /usr/include/x86_64-linux-gnu/sys/mman.h:41,
                   from /tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/include/sysemu/os-posix.h:29,
                   from /tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/include/qemu/osdep.h:104,
                   from util/memfd.c:28:
  /usr/include/x86_64-linux-gnu/bits/mman-shared.h:50:5: note: previous declaration of ‘memfd_create’ was here
   int memfd_create (const char *__name, unsigned int __flags) __THROW;
       ^~~~~~~~~~~~
  make: *** [/tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/rules.mak:66: util/memfd.o] Error 1

I've tried downgrading gcc and etc to 6.0 (was using 8.4 before), and same issue. It might be related to a similar issue in Avatar2: https://github.com/avatartwo/avatar2/issues/14.

To maybe help diagnose this would it be possible to know what distro and kernel verion phuzzer is being developed with? Thanks!

zardus commented 4 years ago

We target all development to the latest LTS release of Ubuntu (18.04, currently).

On Fri, Jan 3, 2020 at 6:47 PM Andrew Hughes notifications@github.com wrote:

Hi,

There seems to be a problem with building QEMU while running Ubuntu 19 when setting up phuzzer.

static int memfd_create(const char *name, unsigned int flags)

          ^~~~~~~~~~~~

In file included from /usr/include/x86_64-linux-gnu/bits/mman-linux.h:111:0,

               from /usr/include/x86_64-linux-gnu/bits/mman.h:34,

               from /usr/include/x86_64-linux-gnu/sys/mman.h:41,

               from /tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/include/sysemu/os-posix.h:29,

               from /tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/include/qemu/osdep.h:104,

               from util/memfd.c:28:

/usr/include/x86_64-linux-gnu/bits/mman-shared.h:50:5: note: previous declaration of ‘memfd_create’ was here

int memfd_create (const char *name, unsigned int flags) __THROW;

   ^~~~~~~~~~~~

make: *** [/tmp/pip-req-build-r26yq_bw/bin/afl-unix/qemu_mode/qemu-2.10.0/rules.mak:66: util/memfd.o] Error 1

I've tried downgrading gcc and etc to 6.0 (was using 8.4 before), and same issue. It might be related to a similar issue in Avatar2: avatartwo/avatar2#14 https://github.com/avatartwo/avatar2/issues/14.

To maybe help diagnose this would it be possible to know what distro and kernel verion phuzzer is being developed with? Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/angr/phuzzer/issues/4?email_source=notifications&email_token=AA2LHF7MCIMSAMVTDNCLWJTQ37TERA5CNFSM4KCTXH32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ID7P3IQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2LHFY7XLLV67JMINFLUZTQ37TERANCNFSM4KCTXH3Q .

monik3r commented 4 years ago

Can confirm that Ubuntu 18.04 works, thanks

mahaloz commented 4 years ago

Hey this is still an issue in 20.04 LTS. Looking into a fix now.

twizmwazin commented 4 years ago

This issue seems to have to do with building the binaries for shellphish-afl and shellphish-qemu rather than the phuzzer package itself. This should be able to be bypassed by installing our wheels from the angr/wheels repo. I was able to get phuzzer installed in a 20.04 docker container like this:

FROM ubuntu:focal

RUN apt-get update && apt-get install -y git

RUN git clone https://github.com/angr/angr-dev.git /root/angr-dev
WORKDIR /root/angr-dev

RUN DEBIAN_FRONTEND="noninteractive" ./setup.sh -i -u

RUN pip3 install https://github.com/angr/wheels/blob/master/shellphish_afl-1.2.1-py2.py3-none-manylinux1_x86_64.whl?raw=true
RUN pip3 install https://github.com/angr/wheels/blob/master/shellphish_qemu-0.10.0-py3-none-manylinux1_x86_64.whl?raw=true

RUN ./setup.sh -u phuzzer

RUN python3 -c "import phuzzer; print('it works')"
github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

twizmwazin commented 1 year ago

This issue is related to shellphish-qemu and we have a workaround, so I'm going to consider this complete.