Comments (5)
Oh, thanks for the heads-up, we'll look into it.
from atheris.
Looks like this is specific to the 3.10 upgrade
from atheris.
I believe I've identified the issue. After instrumenting code, Atheris needs to fix-up instruction offsets. In one code path in adjust()
, the offsets are adjusted like this:
self.reference += size # type: ignore[operator]
self.arg += size
Calling self.arg += size
in 3.10 is incorrect, because the argument to jump instructions changed from a byte offset to an instruction offset.
The correct code is:
self.reference += size # type: ignore[operator]
self.arg = add_bytes_to_jump_arg(self.arg, size)
This wasn't detected during testing because this particular code path is only triggered in the unlikely event that (1) the argument is an offset for an absolute jump instruction, and (2) the argument was previously <256 but is now >=256.
Here's a minimum reproducer of this issue:
import atheris
@atheris.instrument_func
def _ord2ymd(n):
n -= 1
n400, n = divmod(n, 1)
year = n400 * 400 + 1
n100, n = divmod(n, 1)
n4, n = divmod(n, 1)
n1, n = divmod(n, 1)
leapyear = n1 == 3 and (n4 != 24 or n100 == 3)
assert leapyear == baz(year)
month = (n + 50) >> 5
preceding = baz[month] + (month > 2 and leapyear)
if preceding > n:
month -= 1
preceding -= bar[month] + (month == 2 and leapyear)
n -= preceding
assert 0 <= n < foo()
from atheris.
We'll validate that this fix is indeed correct, and if so cut a release, most likely tomorrow.
from atheris.
Issue fixed and released as 2.0.11.
from atheris.
Related Issues (20)
- Potential file conflict with other Python packages HOT 3
- Instrumenting time long HOT 3
- Aggregate all string literals during instrumentation HOT 1
- Unable to cast Python instance to C++ HOT 8
- Unable to execute target in fork mode HOT 2
- Generate wheels for all platforms via cibuildwheel HOT 3
- "Permission denied" when using -merge=1
- Preloaded libFuzzer doesn't allow to use custom mutator.
- Wrong crash line in new python version
- Atheris 2.2.2 fails to instrument a while loop in Python 3.11.0 HOT 1
- Support RegisterPostProcessor in lib protofuf mutator
- Make use of Github Actions
- How could I save crash log? HOT 5
- User exit callback feature? HOT 2
- Integrate Slipcover to Atheris HOT 2
- Cannot Install Atheris using PIP on Ubuntu, Alpine, ArchLinux and Windows HOT 5
- Issue in installing package atheris-libprotobuf-mutator on python base image
- Determinism HOT 1
- Atheris in unittests?
- Why are Instance methods not instrumented
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atheris.