You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lazy_static variables present a problem when fuzzing with AFL in persistent mode (the default for afl.rs). This fact was observed by @pedrocr in #152:
Apparently lazy_static is something that needs to be handled carefully for afl. It ends up only being initialized inside the loop instead of only once. It's easy to work around in this codebase but it may be something that needs to be fixed more fully for other codebases to work well.
To address this problem, I wrote a "resettable" version of lazy_static. Intuitively, the resettable version collects all initialized lazy_static variables in a linked list. A call to lazy_static::lazy::reset() walks the linked list and uninitializes each variable.
The lazy_static maintainers did not want to merge this, as it complicates the get operation. (Their position is understandable.)
So, would you be open to a PR that does the following?
Adds a call to lazy_static::lazy::reset() between these two lines, guarded by a reset-lazy-static feature.
Adds a section to the README explaining how one can use cargo's patching mechanism to substitute the resettable version of lazy_static for the standard one.
I regard to the second bullet, I think it would be better if the README referred readers to a rust-fuzz repository. So, I would offer to let rust-fuzz hold the "official" resettable lazy_static. Please let me know if this is something that you would like to do.
The text was updated successfully, but these errors were encountered:
hey @smoelius, i don't have much time nowadays to maintain afl.rs. your proposed change sounds good to me! i just sent you an invite to the rust-fuzz organization if you're interested in making any changes to afl.rs
lazy_static
variables present a problem when fuzzing with AFL in persistent mode (the default for afl.rs). This fact was observed by @pedrocr in #152:To address this problem, I wrote a "resettable" version of
lazy_static
. Intuitively, the resettable version collects all initializedlazy_static
variables in a linked list. A call tolazy_static::lazy::reset()
walks the linked list and uninitializes each variable.An example of its use can be found here.
The
lazy_static
maintainers did not want to merge this, as it complicates theget
operation. (Their position is understandable.)So, would you be open to a PR that does the following?
lazy_static::lazy::reset()
between these two lines, guarded by areset-lazy-static
feature.lazy_static
for the standard one.I regard to the second bullet, I think it would be better if the README referred readers to a rust-fuzz repository. So, I would offer to let rust-fuzz hold the "official" resettable
lazy_static
. Please let me know if this is something that you would like to do.The text was updated successfully, but these errors were encountered: