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
ureeves opened this issue
Dec 16, 2022
· 0 comments
· Fixed by #121
Assignees
Labels
fix:bugSomething isn't workingmark:nextStrategic issues related to next versions of Testnet and mid/long term plansteam:CoreLow Level Core Development Team (Rust)
Describe the bug
Transact raw sometimes leads to stack corruption when a module calls itself recursively. This is visible in the raw-calls-layout branch in this repository. The self_snapshot test will produce an out of bounds access to the heap, which happens due to the pointer to the raw transaction buffer being corrupted.
To Reproduce
Take a look at the raw-calls-layout branch. An MRE exists there.
Expected behaviour
Quite simply this should not happen. A recursive call should not touch the caller's stack.
Additional context
This was found in a larger effort to migrate the genesis contracts to use this library. transact_raw is used there dusk-network/rusk#757.
The text was updated successfully, but these errors were encountered:
ureeves
changed the title
transact_raw sometimes corrupts the stack when called recursivelytransact_raw sometimes corrupts the stack on recursive calls
Dec 16, 2022
Ensures a module is only ever instantiated once per session, by using a
map in the call stack. If an instance already exists in an instance map,
then an element is appended without creating a new instance. If an instance
does not exist in the map, a new one is created and then a new element
appended to the stack.
Resolves#122
Ensures a module is only ever instantiated once per session, by using a
map in the call stack. If an instance already exists in an instance map,
then an element is appended without creating a new instance. If an instance
does not exist in the map, a new one is created and then a new element
appended to the stack.
Resolves#122
Ensures a module is only ever instantiated once per session, by using a
map in the call stack. If an instance already exists in an instance map,
then an element is appended without creating a new instance. If an instance
does not exist in the map, a new one is created and then a new element
appended to the stack.
Resolves#122
fix:bugSomething isn't workingmark:nextStrategic issues related to next versions of Testnet and mid/long term plansteam:CoreLow Level Core Development Team (Rust)
Describe the bug
Transact raw sometimes leads to stack corruption when a module calls itself recursively. This is visible in the
raw-calls-layout
branch in this repository. Theself_snapshot
test will produce an out of bounds access to the heap, which happens due to the pointer to the raw transaction buffer being corrupted.To Reproduce
Take a look at the
raw-calls-layout
branch. An MRE exists there.Expected behaviour
Quite simply this should not happen. A recursive call should not touch the caller's stack.
Additional context
This was found in a larger effort to migrate the genesis contracts to use this library.
transact_raw
is used there dusk-network/rusk#757.The text was updated successfully, but these errors were encountered: