Giter Site home page Giter Site logo

Comments (19)

dgh05t avatar dgh05t commented on August 29, 2024 1

issue solved with " brew upgrade cmake"

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

For the git error: Right, that only works if you have ssh key configured in github. I'll make a note of that in the readme.

First time I see the 2nd error though. Do you have Xcode installed and have you ran it at least once (it installs some tools only on the 1st run)?

from jackalope.

agroce avatar agroce commented on August 29, 2024

Definitely have xcode installed/xcode-select ran long ago, etc.

Tried first on a "clean" setup but with git and command line dev, since I may point students at this in a class this spring, but then on my normal dev machine, which is compiling things all over the place. I'm very interested in getting this running, be really nice to have a mac-friendly fuzzer come with https://github.com/trailofbits/deepstate, especially one that makes custom mutators (so we could add awareness of test structure) easy!

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

Does running
sudo xcode-select --reset
help?

from jackalope.

dgh05t avatar dgh05t commented on August 29, 2024

Hi,
Same problem here when compiling TinyInst.
and "sudo xcode-select --reset" doesn't help.

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

Cool! Glad to hear that updating cmake resolves the issue.

@agroce Does this resolve the issue for you as well?

from jackalope.

agroce avatar agroce commented on August 29, 2024

Will check!

from jackalope.

agroce avatar agroce commented on August 29, 2024

Fixed. And

./fuzzer -in in -out out -t 1000 -delivery shmem -instrument_module test -target_module test -target_method __Z4fuzzPc -nargs 1 -iterations 10000 -persist -loop -cmp_coverage -- ./test -m @@

works. When I tried to use it on a DeepState executable, it didn't work, but I'm guessing this is just me not having grasped all the required arguments' meanings, etc.:

~/Jackalope/build/Release/fuzzer -in corpus -out fuzz -t 1000 -delivery file -instrument_module Runlen -target_module Runlen -target_method __Z4fuzzPc -nargs 1 -iterations 10000 -persist -loop -cmp_coverage -- ./Runlen --input_which_test Runlength_EncodeDecode --input_test_file @@
Fuzzer version 0.01
1 input files read
Running input sample corpus/ffd9de9abb7f26f888c09183b2da0e2b4292f17d.pass
[-] PROGRAM ABORT : Error ((os/kern) failure) calling task_for_pid
         Location : MachTarget(), /Users/adg326/Jackalope/TinyInst/macOs/machtarget.cpp:34

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

ah, right, task_for_pid, that means the fuzzer doesn't have the rights to attach to the target process. This can be resolved in one of two ways:

  • Running the fuzzer with sudo (possibly SIP needs to be disabled as well, but not sure for non-system targets).

  • Depends on how the target is compiled. I noticed that if the target is compiled on the comand line (e.g. with clang, gcc, etc.) it results in this error. However, if the target is compiled from xcode, it just works with normal user permissions. Not sure exactly what xcode does differently.

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

Likely related to the 2nd point about Xcode:

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_debugger

Xcode automatically adds the Get Task Allow entitlement to apps that you build for debugging, while removing the entitlement before App Store submission. This enables Xcode itself to attach to and debug your app during development.

from jackalope.

agroce avatar agroce commented on August 29, 2024

Aha! Permissions. Hmm. sudo should fix it, though for a more ambitious target not entirely thrilled to fuzz under sudo. :)

from jackalope.

agroce avatar agroce commented on August 29, 2024

Will try out when I am around the machine.

from jackalope.

agroce avatar agroce commented on August 29, 2024

sudo worked, but it hit another snag...

sudo ~/Jackalope/build/Release/fuzzer -in corpus -out fuzz -t 1000 -delivery file -instrument_module Runlen -nargs 1 -iterations 10000 -cmp_coverage -- ./Runlen --input_which_test Runlength_EncodeDecode --input_test_file @@
Fuzzer version 0.01
1 input files read
Running input sample corpus/ffd9de9abb7f26f888c09183b2da0e2b4292f17d.pass
Instrumented module Runlen, code size: 49152
TRACE: Initialized test input buffer with data from `fuzz/input_1`
TRACE: Running: Runlength_EncodeDecode from /Users/adg326/deepstate/examples/Runlen.cpp(55)
[-] PROGRAM ABORT : Debugger object could not be found in the map, task port = (3375)
         Location : catch_mach_exception_raise_state_identity(), /Users/adg326/Jackalope/TinyInst/macOS/debugger.cpp:1311

has it mostly been tried on xcode-compiled targets, rather than command line clang-built stuff?

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

Hmm, that's a strange error to get, my test app works normally with sudo, but I can reproduce with your target. Not sure if sudo is to blame here or something else. Will investigate.

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

So, it's not about sudo or build, I verified that the same error still occurs for Runlen even if it's built with Xcode and ran without sudo.

The error in question is raised because the debugger is getting an exception from an unexpected task port and thus doesn't know how to handle it.

It would be helpful if you could point out any potentially related behaviour in your target such as:

  • Does the target create child processes
  • Does the target itself act as a debugger
  • Does the target do something related to exception ports
  • Any other behavior you can think of that might be related.

from jackalope.

ifratric avatar ifratric commented on August 29, 2024

Right, fork() seems to be the problem here. If you add --fork=false to the Runlen command line arguments, it seems to work.

from jackalope.

agroce avatar agroce commented on August 29, 2024

Thanks! Of course. I should have guessed, fork is always the villain.

from jackalope.

agroce avatar agroce commented on August 29, 2024

Non-trivial enough I'll definitely want to set up a front end!

from jackalope.

agroce avatar agroce commented on August 29, 2024

Works! Wonder if I can work around having to sudo...

from jackalope.

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.