Comments (4)
This look like a guenine issue, either the compiler should pick up the lifetime issue or it should not crash. Are you able to get a simple test case that reliably reproduce the issue?
Thanks!
from unicorn-rs.
Got it! Need to Box the callback otherwise Rust might allocate them on the stack...
Test case here: isra17@5cb2c4e
The Unicorn interface should be fixed accordingly.
from unicorn-rs.
Disregard last comment, crash come from the Unicorn object pointer being first saved in the callback data. The pointer however is first stored on the init function stack. Returning the object from the function move the value to the parent fram and invalidate the saved pointer. I think this can be fixed by forcing Box<Self>
on self
in add_*_hook
functions.
from unicorn-rs.
Hey, just catching up with this thread now. Glad to hear I stumbled on a worthwhile bug. I'll pull the fix, and see if I get better mileage out of it. Thanks.
from unicorn-rs.
Related Issues (20)
- Protection bitfield is not exported publically
- ARM Mode HOT 2
- unable to install it on osx HOT 13
- Can't build unicorn on Linux HOT 10
- Test fails on ARM HOT 5
- Possible to bind uc_mem_map_ptr? HOT 6
- Benchmarking the bindings HOT 8
- Can't create MIPS Big-Endian Emulator HOT 3
- error: could not find native static library `unicorn`, perhaps an -L flag is missing? HOT 9
- Thinner wrapper for Unicorn HOT 1
- "improper_ctypes" Build warning HOT 1
- consider FnMut for hooks
- Potential unsafe in boxed hooks
- Fork for UnicornAFL / Autogenerate bindings? HOT 2
- I want to find a maintainer HOT 9
- fix vswhere problem
- Typo in unicorn_const::Errro
- Tracing/logging?
- Broken documentation
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 unicorn-rs.