Hi!
I don’t know if I’m missing something or if I found a regression in zig 0.17. I have a project where everything worked on zig 0.16, but after upgrading the project to 0.17, my tests hangs, never finishing or even crashing. I found that making a DebugAllocator that I instantiate myself solves the problem before realizing that it’s not the same type.
I thought it may be an issue in my code but it happens in std.json.parseFromSlice and other seemingly random places where I use the allocator. I don’t know how to begin debugging that further…
I don’t know if it help but here is the first spot where is hangs, it’s also the first usage of the allocator:
test "interpolation.json" {
try run_tests_file("tests/specs/interpolation.json", false);
}
fn run_tests_file(comptime filename: []const u8, verbose: bool) !void {
// The commented lines prevent the issue
//var debug: std.heap.DebugAllocator(.{}) = .init;
//const allocator = debug.allocator();
const parsed = try std.json.parseFromSlice(
test_tools.Spec,
testing.allocator,
//allocator,
@embedFile(filename),
.{
.allocate = .alloc_always,
.ignore_unknown_fields = true,
});
defer parsed.deinit();
const spec = parsed.value;
// etc...