[nix-shell:~/dev/zig/build-release]$ ./zig build test-stage2 Test [1/1] test "self-hosted"...tests [1/22] call undefined local [1/1] update [2/3] parse/analysis/codetests [13/22] referencing decls which appear later in the file [1/1] update [4/5...Segmentation fault at address 0x7f7082fd9000 /home/andy/dev/zig/lib/std/hash_map.zig:495:29: 0x5188af in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getIndex (test) if (item.hash == h and eql(key, item.key)) { ^ /home/andy/dev/zig/lib/std/hash_map.zig:486:40: 0x517043 in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getEntry (test) const index = self.getIndex(key) orelse return null; ^ /home/andy/dev/zig/lib/std/hash_map.zig:510:37: 0x46c545 in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).get (test) return if (self.getEntry(key)) |entry| entry.value else null; ^ /home/andy/dev/zig/lib/std/hash_map.zig:204:38: 0x46382b in std.hash_map.HashMap(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).get (test) return self.unmanaged.get(key); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:1060:49: 0x3b8186 in zir.Writer.writeParamToStream (test) if (self.module.metadata.get(inst)) |metadata| { ^ /home/andy/dev/zig/src-self-hosted/zir.zig:990:40: 0x30258d in zir.Writer.writeInstToStreamGeneric (test) try self.writeParamToStream(stream, &@field(inst.positionals, arg_field.name)); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:969:53: 0x2f8385 in zir.Writer.writeInstToStream (test) return self.writeInstToStreamGeneric(stream, expected_tag, inst); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:944:40: 0x28e9bb in zir.Module.writeToStream (test) try write.writeInstToStream(stream, decl.inst); ^ /home/andy/dev/zig/src-self-hosted/test.zig:521:57: 0x2887d2 in TestContext.runOneCase (test) try new_zir_module.writeToStream(allocator, out_zir.outStream()); ^ /home/andy/dev/zig/src-self-hosted/test.zig:419:32: 0x28455e in TestContext.run (test) try self.runOneCase(std.testing.allocator, &prg_node, case); ^ /home/andy/dev/zig/src-self-hosted/test.zig:21:16: 0x2840b5 in test "self-hosted" (test) try ctx.run(); ^ /home/andy/dev/zig/lib/std/special/test_runner.zig:56:28: 0x521b51 in std.special.main (test) } else test_fn.func(); ^ /home/andy/dev/zig/lib/std/start.zig:252:37: 0x284bdd in std.start.posixCallMainAndExit (test) const result = root.main() catch |err| { ^ /home/andy/dev/zig/lib/std/start.zig:123:5: 0x28491f in std.start._start (test) @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{}); ^ Tests failed. Use the following command to reproduce the failure: /home/andy/dev/zig/zig-cache/o/tiRBPWYy-FXCJNPduzAUj0hMIjLE5JCoZm8kICTHgS_viUMWaFZKg852EUl7osni/test The following command exited with error code 255: /home/andy/dev/zig/build-release/zig test /home/andy/dev/zig/src-self-hosted/test.zig --pkg-begin build_options /home/andy/dev/zig/zig-cache/test_build_options.zig --pkg-end --cache-dir /home/andy/dev/zig/zig-cache --name test --pkg-begin stage2_tests /home/andy/dev/zig/test/stage2/test.zig --pkg-end Build failed. The following command failed: /home/andy/dev/zig/zig-cache/o/f_zpiKgxbqSjrWvVkuYBBqfYOK7Wfh8eEfzr4hyGqGbV4uvtD6GfY4SJogPG_JQz/build /home/andy/dev/zig/build-release/zig /home/andy/dev/zig /home/andy/dev/zig/zig-cache test-stage2 [nix-shell:~/dev/zig/build-release]$ rr record /home/andy/dev/zig/zig-cache/o/tiRBPWYy-FXCJNPduzAUj0hMIjLE5JCoZm8kICTHgS_viUMWaFZKg852EUl7osni/test rr: Saving execution to trace directory `/home/andy/.local/share/rr/test-72'. Test [1/1] test "self-hosted"...tests [1/22] call undefined local [1/1] update [2/3] parse/analysis/codetests [13/22] referencing decls which appear later in the file [1/1] update [4/5...Segmentation fault at address 0x7f34c5858000 /home/andy/dev/zig/lib/std/hash_map.zig:495:29: 0x5188af in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getIndex (test) if (item.hash == h and eql(key, item.key)) { ^ /home/andy/dev/zig/lib/std/hash_map.zig:486:40: 0x517043 in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getEntry (test) const index = self.getIndex(key) orelse return null; ^ /home/andy/dev/zig/lib/std/hash_map.zig:510:37: 0x46c545 in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).get (test) return if (self.getEntry(key)) |entry| entry.value else null; ^ /home/andy/dev/zig/lib/std/hash_map.zig:204:38: 0x46382b in std.hash_map.HashMap(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).get (test) return self.unmanaged.get(key); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:1060:49: 0x3b8186 in zir.Writer.writeParamToStream (test) if (self.module.metadata.get(inst)) |metadata| { ^ /home/andy/dev/zig/src-self-hosted/zir.zig:990:40: 0x30258d in zir.Writer.writeInstToStreamGeneric (test) try self.writeParamToStream(stream, &@field(inst.positionals, arg_field.name)); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:969:53: 0x2f8385 in zir.Writer.writeInstToStream (test) return self.writeInstToStreamGeneric(stream, expected_tag, inst); ^ /home/andy/dev/zig/src-self-hosted/zir.zig:944:40: 0x28e9bb in zir.Module.writeToStream (test) try write.writeInstToStream(stream, decl.inst); ^ /home/andy/dev/zig/src-self-hosted/test.zig:521:57: 0x2887d2 in TestContext.runOneCase (test) try new_zir_module.writeToStream(allocator, out_zir.outStream()); ^ /home/andy/dev/zig/src-self-hosted/test.zig:419:32: 0x28455e in TestContext.run (test) try self.runOneCase(std.testing.allocator, &prg_node, case); ^ /home/andy/dev/zig/src-self-hosted/test.zig:21:16: 0x2840b5 in test "self-hosted" (test) try ctx.run(); ^ /home/andy/dev/zig/lib/std/special/test_runner.zig:56:28: 0x521b51 in std.special.main (test) } else test_fn.func(); ^ /home/andy/dev/zig/lib/std/start.zig:252:37: 0x284bdd in std.start.posixCallMainAndExit (test) const result = root.main() catch |err| { ^ /home/andy/dev/zig/lib/std/start.zig:123:5: 0x28491f in std.start._start (test) @call(.{ .modifier = .never_inline }, posixCallMainAndExit, .{}); ^ Aborted [nix-shell:~/dev/zig/build-release]$ rr replay GNU gdb (GDB) 8.3.1 Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/andy/.local/share/rr/test-72/mmap_hardlink_3_test... Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal] Remote debugging using 127.0.0.1:3963 std.start._start () at /home/andy/dev/zig/lib/std/start.zig:92 92 starting_stack_ptr = asm ("" (rr) continue Continuing. Test [1/1] test "self-hosted"...tests [1/22] call undefined local [1/1] update [2/3] parse/analysis/codetests [13/22] referencing decls which appear later in the file [1/1] update [4/5... Program received signal SIGSEGV, Segmentation fault. 0x00000000005188af in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getIndex (self=..., key=0x7f34c5856120) at /home/andy/dev/zig/lib/std/hash_map.zig:495 495 if (item.hash == h and eql(key, item.key)) { (rr) p item $1 = (struct std.hash_map.Entry *) 0x7f34c5858000 (rr) watch *0x7f34c5858000 Hardware watchpoint 1: *0x7f34c5858000 (rr) reverse-cont Continuing. Program received signal SIGSEGV, Segmentation fault. 0x00000000005188af in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).getIndex (self=..., key=0x7f34c5856120) at /home/andy/dev/zig/lib/std/hash_map.zig:495 495 if (item.hash == h and eql(key, item.key)) { (rr) reverse-cont Continuing. Hardware watchpoint 1: *0x7f34c5858000 Old value = New value = -1431655766 std.os.linux.x86_64.syscall2 (number=munmap, arg1=139864628887552, arg2=4096) at /home/andy/dev/zig/lib/std/os/linux/x86_64.zig:21 21 return asm volatile ("syscall" (rr) up #1 0x0000000000312a32 in std.os.linux.munmap (address=0x7f34c5858000 '\252' ..., length=4096) at /home/andy/dev/zig/lib/std/os/linux.zig:227 227 return syscall2(.munmap, @ptrToInt(address), length); (rr) #2 0x0000000000291e67 in std.os.munmap (memory=...) at /home/andy/dev/zig/lib/std/os.zig:3469 3469 switch (errno(system.munmap(memory.ptr, memory.len))) { (rr) #3 0x0000000000281b0f in std.heap.PageAllocator.resize (allocator=0x6916b0 , buf_unaligned=..., buf_align=4096, new_size=0, len_align=0, return_address=2693583) at /home/andy/dev/zig/lib/std/heap.zig:257 257 os.munmap(ptr[0 .. buf_aligned_len - new_size_aligned]); (rr) #4 0x0000000000295934 in std.mem.Allocator.shrinkBytes (self=0x6916b0 , buf=..., buf_align=4096, new_len=0, len_align=0, return_address=2693583) at /home/andy/dev/zig/lib/std/mem/Allocator.zig:485 485 return self.resizeFn(self, buf, buf_align, new_len, len_align, return_address) catch unreachable; (rr) #5 0x000000000031285f in std.mem.Allocator.free (self=0x6916b0 , memory=0x7f34c5858000) at /home/andy/dev/zig/lib/std/mem/Allocator.zig:454 454 _ = self.shrinkBytes(non_const_ptr[0..bytes_len], Slice.alignment, 0, 0, @returnAddress()); (rr) #6 0x00000000002919cf in std.heap.general_purpose_allocator.GeneralPurposeAllocator((struct std.heap.general_purpose_allocator.Config constant)).freeSlot (self=0x6916c0 , bucket=0x7f34c5859000, bucket_index=8, size_class=256, slot_index=0, used_byte=0x7f34c5859020 "", used_bit_index=0 '\000', trace_addr=3891685) at /home/andy/dev/zig/lib/std/heap/general_purpose_allocator.zig:425 425 self.backing_allocator.free(bucket.page[0..page_size]); (rr) #7 0x0000000000282393 in std.heap.general_purpose_allocator.GeneralPurposeAllocator((struct std.heap.general_purpose_allocator.Config constant)).resize (allocator=0x6916c0 , old_mem=..., old_align=8, new_size=0, len_align=0, ret_addr=3891685) at /home/andy/dev/zig/lib/std/heap/general_purpose_allocator.zig:559 559 self.freeSlot(bucket, bucket_index, size_class, slot_index, used_byte, used_bit_index, ret_addr); (rr) #8 0x0000000000295934 in std.mem.Allocator.shrinkBytes (self=0x6916c0 , buf=..., buf_align=8, new_len=0, len_align=0, return_address=3891685) at /home/andy/dev/zig/lib/std/mem/Allocator.zig:485 485 return self.resizeFn(self, buf, buf_align, new_len, len_align, return_address) catch unreachable; (rr) #9 0x000000000045ea3f in std.mem.Allocator.free (self=0x6916c0 , memory=...) at /home/andy/dev/zig/lib/std/mem/Allocator.zig:454 454 _ = self.shrinkBytes(non_const_ptr[0..bytes_len], Slice.alignment, 0, 0, @returnAddress()); (rr) #10 0x00000000003b61e5 in std.array_list.ArrayListAlignedUnmanaged(std.hash_map.Entry,null).deinit ( self=0x7ffc8cd318f0, allocator=0x6916c0 ) at /home/andy/dev/zig/lib/std/array_list.zig:370 370 allocator.free(self.allocatedSlice()); (rr) #11 0x00000000002f6b4d in std.hash_map.HashMapUnmanaged(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).deinit (self=0x7ffc8cd318f0, allocator=0x6916c0 ) at /home/andy/dev/zig/lib/std/hash_map.zig:300 300 self.entries.deinit(allocator); (rr) #12 0x00000000002ccdbd in std.hash_map.HashMap(*zir.Inst,zir.MetaData,std.hash_map.getAutoHashFn(*zir.Inst).hash,std.hash_map.getAutoEqlFn(*zir.Inst).eql,true).deinit (self=0x7ffc8cd318f0) at /home/andy/dev/zig/lib/std/hash_map.zig:96 96 self.unmanaged.deinit(self.allocator); (rr) #13 0x000000000028e477 in zir.emit (allocator=0x6916c0 , old_module=...) at zir.zig:1548 1548 defer ctx.metadata.deinit(); (rr) #14 0x00000000002886ad in TestContext.runOneCase (self=0x7ffc8cd33078, allocator=0x6916c0 , root_node=0x7ffc8cd32cf0, case=...) at test.zig:513 513 var new_zir_module = try zir.emit(allocator, module); (rr)