Giter Club home page Giter Club logo

Comments (3)

chrisruk avatar chrisruk commented on July 17, 2024 1

Thanks for your help I read through the native extension doc and re-read the readme, and tried compiling llvm to see if that fixed my issue.

In case anyone else wants to install atheris on ARM/Raspberry Pi, I did -

git clone https://github.com/llvm/llvm-project.git
cd llvm-project
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='clang;compiler-rt' -G "Unix Makefiles" ../llvm
make -j 4 # This step is very slow
sudo make install
git clone https://github.com/google/atheris.git
cd atheris
CLANG_BIN="/usr/local/bin/clang" LIBFUZZER_LIB="/usr/local/lib/clang/16.0.0/lib/linux/libclang_rt.fuzzer_no_main-armhf.a" pip3 install .

When doing a simple test, I got -

ImportError: /home/pi/.local/lib/python3.9/site-packages/atheris/core_with_libfuzzer.cpython-39-arm-linux-gnueabihf.so: undefined symbol: __atomic_load_8

This could be fixed by doing -

LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1 python3.9 ex.py 

Look forward to playing with atheris now!

from atheris.

TheShiftedBit avatar TheShiftedBit commented on July 17, 2024

It looks like those errors are being caused by libFuzzer being linked as a shared library in Atheris, as opposed to being statically linked into the executable.

I'm not very familiar with ARM, so I don't know what would be needed to allow libFuzzer to be linked dynamically.

However, it's possible you can avoid this problem by linking libFuzzer directly into Python. Follow these instructions:
https://github.com/google/atheris/blob/master/native_extension_fuzzing.md#option-2-linking-libfuzzer-into-python
Then, modify Atheris' setup.py to remove the atheris.core_with_libfuzzer extension (you want the atheris.core_without_libfuzzer one) and remove everything in build_extensions() after # Deploy versions of ASan and UBSan that have been merged with libFuzzer.

from atheris.

stulle123 avatar stulle123 commented on July 17, 2024

Hey @chrisruk after following your instructions I'm running into an Illegal Instruction error:

$ LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libatomic.so.1 python3.9 fuzz.py
INFO: Using built-in libfuzzer
Illegal instruction

Any idea on what is going wrong?

I'm using a Pi Zero armv6 with clang 13.0.1.

from atheris.

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.