Giter VIP home page Giter VIP logo

Comments (5)

luke-croak avatar luke-croak commented on July 18, 2024 1

I had a similar issue. The cause wasn't the memory limit but my build/version of qemu. Running inside the docker container, produced by the below Dockerfile, solved the issue for me (since it was able to use the precompiled binary for qemu). The Dockerfile includes an example of setting up a run for the Console example firmware. All that's left to do is run ./exec.sh inside the Docker container. I.e., after building the image, enter into the container docker run -ti <CONTAINER> and then run ./exec.sh.

FROM ubuntu:16.04
RUN mkdir -p /home/project
WORKDIR /home/project

# Setting up necessary packages
RUN apt-get update && \
    apt-get install -y git build-essential gcc-arm-none-eabi zip python3 wget

# Setting up p2im
RUN git clone https://github.com/RiS3-Lab/p2im.git && \
    cd p2im/  && \
    git submodule update --init && \
    git submodule update --remote && \
    make -C afl/

# As an example, setting up the Console firmware
RUN WORKING_DIR=/home/project/p2im/fuzzing/Console/0 && \
    mkdir -p ${WORKING_DIR} && \
    cd ${WORKING_DIR} && \
    cp /home/project/p2im/externals/p2im-real_firmware/binary/Console .

WORKDIR /home/project/p2im/fuzzing/Console/0

RUN cp -r /home/project/p2im/fuzzing/templates/seeds inputs && \
    cp /home/project/p2im/fuzzing/templates/fuzz.cfg.template fuzz.cfg

# Setting up the seed so doesn't crash immediately
RUN echo "asdf" > inputs/random

# Manually setting up fuzz.cfg too for Console example
RUN sed -i '19s/.*/base        = \/home\/project\/p2im/' fuzz.cfg && \
    sed -i '21s/.*/program     = Console/' fuzz.cfg && \
    sed -i '23s/.*/run         = 0/' fuzz.cfg && \
    sed -i '47s/.*/board       = FRDM-K64F/' fuzz.cfg && \
    sed -i '48s/.*/mcu         = MK64FN1M0VLL12/' fuzz.cfg && \
    sed -i '61s/.*/img         = %(working_dir)s\/Console/' fuzz.cfg && \
    sed -i '68s/.*/objdump     = \/usr\/bin\/arm-none-eabi-objdump/' fuzz.cfg

# Creating simple executable script
RUN echo "#!/bin/bash" > exec.sh && \
    echo "/home/project/p2im/model_instantiation/fuzz.py -c fuzz.cfg" >> exec.sh && \
    chmod +x exec.sh

from p2im.

zunlongzhou avatar zunlongzhou commented on July 18, 2024

This problem occurred in several binary tests in the testcase of ubuntu1604 and ubuntu1804. Have you solved it?

from p2im.

soemthlng avatar soemthlng commented on July 18, 2024

@zunlongzhou No, I can not solve this problem.
Same as luke-croak, I think it is not a memory limit problem.
I think this problem is caused by some binaries.

In my case, re-compiling some binaries worked.

from p2im.

bofeng17 avatar bofeng17 commented on July 18, 2024

It's most likely not a memory limit issue. I guess it's caused by "test cases crash", which causes QEMU crash or exit with a non-zero value (treated as a crash), you can figure out the "crash" reason by ./run_fw.py following the instructions in https://github.com/RiS3-Lab/p2im#analyzing-crashinghanging-input

from p2im.

jackniu1234 avatar jackniu1234 commented on July 18, 2024

I run ./run_fw.py mentioned by @bofeng17 and I figured out that the "crash" is caused by the symbol link in the precompiled qemu provided by the p2im corrupted!

I guess the reason is that I copied the git repository from windows to ubuntu virtual machine.

One solution I found is listed in
https://askubuntu.com/questions/24266/error-while-loading-shared-libraries-file-too-short

from p2im.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.