-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use-after-free bugs in object variants #20305
Comments
Fixed in #20300 |
Araq
pushed a commit
that referenced
this issue
Sep 5, 2022
) [backport] prevent use-after-free bugs in cased objects the bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted fields still in memory! If the new item switches branches again, you get a use-after-free bug.
A testcase will be appreciated. |
narimiran
pushed a commit
that referenced
this issue
Sep 6, 2022
) [backport] prevent use-after-free bugs in cased objects the bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted fields still in memory! If the new item switches branches again, you get a use-after-free bug. (cherry picked from commit 8dcf367)
planetis-m
added a commit
to planetis-m/Nim
that referenced
this issue
Sep 8, 2022
ringabout
pushed a commit
that referenced
this issue
Sep 13, 2022
* add testcase for bug #20305 * Update tcaseobj.nim Co-authored-by: Clay Sweetser <[email protected]>
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
(nim-lang#20300) [backport] prevent use-after-free bugs in cased objects the bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted fields still in memory! If the new item switches branches again, you get a use-after-free bug.
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
* add testcase for bug nim-lang#20305 * Update tcaseobj.nim Co-authored-by: Clay Sweetser <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
The bug happens specifically when deleting an item in a seq. The item taking it's place might not have the same case fields. Then =sink(x[i], move x[xl]) might leave the deleted item's fields still in memory! If the new item switches branches, you get a use-after-free bug.
Nim Version
Nim Compiler Version 1.7.1 [Linux: amd64]
Compiled at 2022-09-04
Copyright (c) 2006-2022 by Andreas Rumpf
git hash: b931e74
active boot switches: -d:release --gc:markAndSweep
Current Standard Output Logs
Expected Standard Output Logs
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: