-
-
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
memory corruption in tmarshall.nim #9754
Comments
marking high priority as it affects PR's like #10355 and subsequent PR's that aim at making CI run faster by joining more tests in megatest |
EDIT: removed |
No wonder it's crashing, the Notabug @Araq ? |
Seems like a valid bug to me, marshal is supposed to work with |
I don't get how it's supposed to work safely. Here you marshal the |
The marshalling is supposed to produce (ID, value) pairs for the first occurence of the data and then only ID for backrefs and this whole mechanism will produce a copy of the linked list, the GC can collect the old list. Marshal is supposed to be memory safe and the test doesn't use |
Alright, I had a deeper look at this. If you turn on template testit(x) =
let x1 = to[type(x)]($$(x))
discard $$x1 It seems that the node we end up freeing twice is somehow stuck in the ZCT but I'm not 100% this is the case since I'm not a GC expert. |
Note: it works with |
This is not a compiler crash. |
(cherry picked from commit a968e7d)
comment either and it'll work;
nim c -r bug/run_all.nim
{"age": 12, "bio": "Я Cletus", "blob": [65, 66, 67, 128], "name": "Cletus"}
true
true
alpha 100
omega 200
Traceback (most recent call last)
/Users/timothee/git_clone/nim/Nim/tests/stdlib/tparsesql.nim(196) tparsesql
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(1514) parseSQL
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(1506) parseSQL
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(1181) parse
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(1170) parseStmt
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(1082) parseSelect
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(950) parseWhere
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(786) parseExpr
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(778) lowestExprAux
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(771) lowestExprAux
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(737) primary
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(697) identOrLiteral
/Users/timothee/git_clone/nim/Nim/lib/pure/parsesql.nim(576) newNode
/Users/timothee/git_clone/nim/Nim/lib/system/gc.nim(496) newObjRC1
/Users/timothee/git_clone/nim/Nim/lib/system/alloc.nim(781) rawAlloc
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/Users/timothee/git_clone/nim/Nim/bug/run_all '
note
I ran into this while working on #9581
this seems like a different bug from #9752
The text was updated successfully, but these errors were encountered: