-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
After instrumenting my code with SharpFuzz I get constant System.AccessViolationExceptions even without fuzzing.
I don't know what exactly causes it, but it seems to always happen in constructors.
I have prepared a tiny reproducer app.
Reproduce:
- Download the attached reproduce.tar.gz archive. It contains the source code for two projects: the
FuzzMeis an application under test and theFuzzMe.Fuzzis the fuzzing harness. - Extract the archive:
tar zxvf reproduce.tar.gz - [Review the code]
- Build the
FuzzMe.Fuzzapp. No errors should pop up:
cd reproduce/tests/FuzzMe.Fuzz
dotnet publish -c Release --self-contained -r linux-x64- Make sure the
FuzzMe.Fuzzapp raises no exceptions:
echo test | ./bin/Release/net6.0/linux-x64/FuzzMe.Fuzz- Instrument
FuzzMe*classes within theFuzzMe.dllwith SharpFuzz:
export SHARPFUZZ_PRINT_INSTRUMENTED_TYPES=1
sharpfuzz ./bin/Release/net6.0/linux-x64/FuzzMe.dll FuzzMeIt should print:
FuzzMe.Parser
FuzzMe.Point
FuzzMe.Program- Run the app again and observe the exception:
echo test | ./bin/Release/net6.0/linux-x64/FuzzMe.FuzzThe output looks like this:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at FuzzMe.Point..ctor(Int32, Int32)
at FuzzMe.Fuzz.Program.Main(System.String[])
Aborted (core dumped)The exit code is 134.
The SharpFuzz dependency is 2.0.1 and the SharpFuzz.CommandLine tool is also 2.0.1.
There are private/protected readonly fields in the constructors of Point and Parser classes, but changing them to public (and without readonly) changes nothing.
Is there some limitation in SharpFuzz regarding constructors? The real code I wish to test has lots of them.
SecNotice and suhovv
Metadata
Metadata
Assignees
Labels
No labels