-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Allocator seg fault #1083
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
Comments
Seems like the
Backtrace for reference:
|
I noticed at one point the arena allocator had its |
A little digging didn't help too much, but the failure of a new assertion I added is a bit disturbing.
The map allocator is changing somewhere between |
Yeah that's right. The problem is here: var arena = ArenaAllocator.init(allocator); // memory for arena.allocator is in this stack frame
return RuleSet{
.arena = arena,
.map = RuleMap.init(&arena.allocator), // returning a pointer that is about to become invalid
}; After #287 and after we have the ability to mark a field as "fixed" this would be a compile error, and it would be resolved by using the no-copy semantics. |
I'm not exactly sure what is going on here. If you run
zig test src/parse.zig
in https://github.com/isaachier/zig-parser-generator the test crashes. I have used gdb to track this into the first insertion into theRuleSet
hash map. The line it crashes on involves calling an arena allocator to allocate space for the map. The problem is, there is no error message here or much else to help me debug. Sorry to paste a link, but not sure what else to do here.The text was updated successfully, but these errors were encountered: