ziglang/zig
259
6.0k
Fork
You've already forked zig
772

SPIR-V: Compiler crash when indexing a storage buffer #35769

Closed
opened 2026年06月14日 10:24:37 +02:00 by glowsquid · 0 comments
Contributor
Copy link

Zig Version

0.17.0-dev.836+e357134f0

Steps to Reproduce, Observed Behavior, and Expected Behavior

Steps to Reproduce:

Compile the following code:

const std = @import("std");
const gpu = std.gpu;
const Chunk = extern struct {
 _: f32,
};
extern const chunks: [*]Chunk addrspace(.storage_buffer);
export fn main() callconv(.spirv_vertex) void {
 _ = chunks[1];
}

With any SPIR-V target:

zig build-exe src/vert.zig -target spirv32-vulkan

Observed Behavior:

Compiler crash context:
Analyzing 'src/vert.zig'
 %23 = dbg_stmt(2, 5)
 > %24 = decl_ref("chunks") token_offset:11:9 to :11:15
 %25 = dbg_stmt(2, 15)
 %26 = elem_ptr_load(%24, @one) node_offset:11:9 to :11:18
 %27 = ensure_result_non_error(%26) node_offset:11:9 to :11:18
 %28 = restore_err_ret_index_unconditional(.none) node_offset:10:1 to :10:10
 %29 = ret_implicit(@void_value) token_offset:12:1 to :12:1
 For full context, use the command
 ../ziglang/zig/zig-out/bin/zig ast-check -t src/vert.zig
thread 504265 panic: reached unreachable code
error return context:
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2027:21: 0x5da941c in ensureNavTypeUpToDate (main.zig)
└─ chunks
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30241:13: 0x42265b8 in ensureNavResolved (main.zig)
 const payload_ty = ty.optionalChild(zcu);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30273:5: 0x486079d in analyzeNavRefInner (main.zig)
 return .true;
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30262:5: 0x4860442 in analyzeNavRef (main.zig)
 const zcu = pt.zcu;
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:6056:5: 0x4748642 in zirDeclRef (main.zig)
 const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1201:46: 0x41d191f in analyzeBodyInner (main.zig)
 .elem_val => try sema.zirElemVal(block, inst),
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1105:13: 0x482d5f3 in resolveInlineBody (main.zig)
/// This function is the main loop of `Sema`. It analyzes a single body of ZIR instructions.
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:5421:9: 0x423eba5 in resolveBlockBody (main.zig)
 assert(!child_block.isComptime()); // Should already got a compile error in the condbr condition.
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:12057:5: 0x46bbf3c in resolveSwitchProng (main.zig)
 operand_ty.fmt(pt),
 ^unks
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:11936:5: 0x46b96c6 in resolveSwitchBlock (main.zig)
 kind: SwitchProngKind,
 ^rt.chunks
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:10325:29: 0x464e239 in analyzeSwitchBlock (main.zig)
 else
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:10175:23: 0x464c156 in zirSwitchBlock (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1261:46: 0x41d4659 in analyzeBodyInner (main.zig)
 .typeof => try sema.zirTypeof(block, inst),
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig)
 switch (break_inst.tag) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig)
 const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig)
 ^
(13 additional stack frames skipped due to buffer size limitations...)
stack trace:
/home/sacha/.zvm/0.16.0/lib/std/debug.zig:420:14: 0x174a109 in assert (std.zig)
 if (!ok) unreachable; // assertion failure
 ^n
/home/sacha/Documents/code/ziglang/zig/src/Type.zig:698:11: 0x236b341 in fromInterned (main.zig)
 assert(i != .none);
 ^
/home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:1507:53: 0x2e408d8 in resolveType (main.zig)
 const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]);
 ^
/home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:1446:51: 0x2e3f705 in resolveType (main.zig)
 const child_ty_id = try cg.resolveType(child_ty, .indirect);
 ^
/home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:262:45: 0x2c8c17e in genNav (main.zig)
 const ty_id = try cg.resolveType(ty, .indirect);
 ^
/home/sacha/Documents/code/ziglang/zig/src/link/SpirV.zig:142:21: 0x2c7fe1e in generate (main.zig)
 linker.cg.genNav(do_codegen) catch |err| switch (err) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/link/SpirV.zig:174:24: 0x2c803fa in updateNav (main.zig)
 try linker.generate(pt, nav, undefined, undefined, false);
 ^
/home/sacha/Documents/code/ziglang/zig/src/link.zig:790:81: 0x2c7f572 in updateNav (main.zig)
 }
 ^
/home/sacha/Documents/code/ziglang/zig/src/link.zig:1543:29: 0x279deee in doZcuTask (main.zig)
 const diags = &comp.link_diags;
 ^
/home/sacha/Documents/code/ziglang/zig/src/link/Queue.zig:121:19: 0x279a644 in enqueueZcu (main.zig)
 link.doZcuTask(comp, tid, task);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:4396:39: 0x279a202 in getExtern (main.zig)
 }
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:1816:54: 0x5d9af70 in analyzeNavVal (main.zig)
 .is_threadlocal = zir_decl.is_threadlocal,
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:1621:80: 0x5d96049 in ensureNavValUpToDate (main.zig)
 false,
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30243:49: 0x4226611 in ensureNavResolved (main.zig)
 return true; // e.g. `?noreturn`
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30285:47: 0x4860950 in analyzeNavRefInner (main.zig)
/// union if our implementation is to be legal, and likewise for coercing `@as(E, undefined)` to
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30262:35: 0x4860419 in analyzeNavRef (main.zig)
 const zcu = pt.zcu;
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:6056:30: 0x4748619 in zirDeclRef (main.zig)
 const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty);
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1201:65: 0x41d18b8 in analyzeBodyInner (main.zig)
 .elem_val => try sema.zirElemVal(block, inst),
 ^
/home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1054:26: 0x4177c41 in analyzeFnBody (main.zig)
 };
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:3454:23: 0x5cf6a9a in analyzeFuncBodyInner (main.zig)
 error.ComptimeReturn => unreachable,
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2287:42: 0x48fb705 in analyzeFuncBody (main.zig)
 var air_owned = true;
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2228:66: 0x400937e in ensureFuncBodyUpToDate (main.zig)
 .{ prev_failed or result.ies_outdated, false }
 ^
/home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:345:54: 0x4005524 in update (main.zig)
 .func => |func| pt.ensureFuncBodyUpToDate(func, null),
 ^
/home/sacha/Documents/code/ziglang/zig/src/Compilation.zig:4522:22: 0x3b9831a in performAllTheWork (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/Compilation.zig:3091:31: 0x2469533 in update (main.zig)
 if (comp.zcu) |zcu| {
 ^
/home/sacha/Documents/code/ziglang/zig/src/main.zig:4698:20: 0x2359dbb in updateModule (main.zig)
 ^
/home/sacha/Documents/code/ziglang/zig/src/main.zig:3790:21: 0x1a221ef in buildOutputType (main.zig)
 if (switch (arg_mode) {
 ^
/home/sacha/Documents/code/ziglang/zig/src/main.zig:283:31: 0x1a6ce57 in mainArgs (main.zig)
 dev.check(.build_lib_command);
 ^
/home/sacha/Documents/code/ziglang/zig/src/main.zig:236:20: 0x19c9cf1 in main (main.zig)
 ^
/home/sacha/.zvm/0.16.0/lib/std/start.zig:699:88: 0x19c8830 in callMain (std.zig)
 if (fn_info.params[0].type.? == std.process.Init.Minimal) return wrapMain(root.main(.{
 ^
/home/sacha/.zvm/0.16.0/lib/std/start.zig:190:5: 0x19c8201 in _start (std.zig)
 asm volatile (switch (native_arch) {
 ^
Aborted (core dumped)

Expected Behavior:

The compiler should not crash

### Zig Version 0.17.0-dev.836+e357134f0 ### Steps to Reproduce, Observed Behavior, and Expected Behavior # Steps to Reproduce: Compile the following code: ``` const std = @import("std"); const gpu = std.gpu; const Chunk = extern struct { _: f32, }; extern const chunks: [*]Chunk addrspace(.storage_buffer); export fn main() callconv(.spirv_vertex) void { _ = chunks[1]; } ``` With any SPIR-V target: ``` zig build-exe src/vert.zig -target spirv32-vulkan ``` # Observed Behavior: ``` Compiler crash context: Analyzing 'src/vert.zig' %23 = dbg_stmt(2, 5) > %24 = decl_ref("chunks") token_offset:11:9 to :11:15 %25 = dbg_stmt(2, 15) %26 = elem_ptr_load(%24, @one) node_offset:11:9 to :11:18 %27 = ensure_result_non_error(%26) node_offset:11:9 to :11:18 %28 = restore_err_ret_index_unconditional(.none) node_offset:10:1 to :10:10 %29 = ret_implicit(@void_value) token_offset:12:1 to :12:1 For full context, use the command ../ziglang/zig/zig-out/bin/zig ast-check -t src/vert.zig thread 504265 panic: reached unreachable code error return context: /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2027:21: 0x5da941c in ensureNavTypeUpToDate (main.zig) └─ chunks ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30241:13: 0x42265b8 in ensureNavResolved (main.zig) const payload_ty = ty.optionalChild(zcu); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30273:5: 0x486079d in analyzeNavRefInner (main.zig) return .true; ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30262:5: 0x4860442 in analyzeNavRef (main.zig) const zcu = pt.zcu; ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:6056:5: 0x4748642 in zirDeclRef (main.zig) const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1201:46: 0x41d191f in analyzeBodyInner (main.zig) .elem_val => try sema.zirElemVal(block, inst), ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1105:13: 0x482d5f3 in resolveInlineBody (main.zig) /// This function is the main loop of `Sema`. It analyzes a single body of ZIR instructions. ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:5421:9: 0x423eba5 in resolveBlockBody (main.zig) assert(!child_block.isComptime()); // Should already got a compile error in the condbr condition. ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:12057:5: 0x46bbf3c in resolveSwitchProng (main.zig) operand_ty.fmt(pt), ^unks /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:11936:5: 0x46b96c6 in resolveSwitchBlock (main.zig) kind: SwitchProngKind, ^rt.chunks /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:10325:29: 0x464e239 in analyzeSwitchBlock (main.zig) else ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:10175:23: 0x464c156 in zirSwitchBlock (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1261:46: 0x41d4659 in analyzeBodyInner (main.zig) .typeof => try sema.zirTypeof(block, inst), ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1076:21: 0x4232067 in analyzeInlineBody (main.zig) switch (break_inst.tag) { ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1918:32: 0x41e26b7 in analyzeBodyInner (main.zig) const inline_body = sema.code.bodySlice(extra.end, extra.data.body_len); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1833:37: 0x41e12d3 in analyzeBodyInner (main.zig) ^ (13 additional stack frames skipped due to buffer size limitations...) stack trace: /home/sacha/.zvm/0.16.0/lib/std/debug.zig:420:14: 0x174a109 in assert (std.zig) if (!ok) unreachable; // assertion failure ^n /home/sacha/Documents/code/ziglang/zig/src/Type.zig:698:11: 0x236b341 in fromInterned (main.zig) assert(i != .none); ^ /home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:1507:53: 0x2e408d8 in resolveType (main.zig) const field_ty: Type = .fromInterned(struct_type.field_types.get(ip)[field_index]); ^ /home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:1446:51: 0x2e3f705 in resolveType (main.zig) const child_ty_id = try cg.resolveType(child_ty, .indirect); ^ /home/sacha/Documents/code/ziglang/zig/src/codegen/spirv/CodeGen.zig:262:45: 0x2c8c17e in genNav (main.zig) const ty_id = try cg.resolveType(ty, .indirect); ^ /home/sacha/Documents/code/ziglang/zig/src/link/SpirV.zig:142:21: 0x2c7fe1e in generate (main.zig) linker.cg.genNav(do_codegen) catch |err| switch (err) { ^ /home/sacha/Documents/code/ziglang/zig/src/link/SpirV.zig:174:24: 0x2c803fa in updateNav (main.zig) try linker.generate(pt, nav, undefined, undefined, false); ^ /home/sacha/Documents/code/ziglang/zig/src/link.zig:790:81: 0x2c7f572 in updateNav (main.zig) } ^ /home/sacha/Documents/code/ziglang/zig/src/link.zig:1543:29: 0x279deee in doZcuTask (main.zig) const diags = &comp.link_diags; ^ /home/sacha/Documents/code/ziglang/zig/src/link/Queue.zig:121:19: 0x279a644 in enqueueZcu (main.zig) link.doZcuTask(comp, tid, task); ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:4396:39: 0x279a202 in getExtern (main.zig) } ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:1816:54: 0x5d9af70 in analyzeNavVal (main.zig) .is_threadlocal = zir_decl.is_threadlocal, ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:1621:80: 0x5d96049 in ensureNavValUpToDate (main.zig) false, ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30243:49: 0x4226611 in ensureNavResolved (main.zig) return true; // e.g. `?noreturn` ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30285:47: 0x4860950 in analyzeNavRefInner (main.zig) /// union if our implementation is to be legal, and likewise for coercing `@as(E, undefined)` to ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:30262:35: 0x4860419 in analyzeNavRef (main.zig) const zcu = pt.zcu; ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:6056:30: 0x4748619 in zirDeclRef (main.zig) const err_return_trace = try block.addTy(.err_return_trace, ptr_stack_trace_ty); ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1201:65: 0x41d18b8 in analyzeBodyInner (main.zig) .elem_val => try sema.zirElemVal(block, inst), ^ /home/sacha/Documents/code/ziglang/zig/src/Sema.zig:1054:26: 0x4177c41 in analyzeFnBody (main.zig) }; ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:3454:23: 0x5cf6a9a in analyzeFuncBodyInner (main.zig) error.ComptimeReturn => unreachable, ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2287:42: 0x48fb705 in analyzeFuncBody (main.zig) var air_owned = true; ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:2228:66: 0x400937e in ensureFuncBodyUpToDate (main.zig) .{ prev_failed or result.ies_outdated, false } ^ /home/sacha/Documents/code/ziglang/zig/src/Zcu/PerThread.zig:345:54: 0x4005524 in update (main.zig) .func => |func| pt.ensureFuncBodyUpToDate(func, null), ^ /home/sacha/Documents/code/ziglang/zig/src/Compilation.zig:4522:22: 0x3b9831a in performAllTheWork (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/Compilation.zig:3091:31: 0x2469533 in update (main.zig) if (comp.zcu) |zcu| { ^ /home/sacha/Documents/code/ziglang/zig/src/main.zig:4698:20: 0x2359dbb in updateModule (main.zig) ^ /home/sacha/Documents/code/ziglang/zig/src/main.zig:3790:21: 0x1a221ef in buildOutputType (main.zig) if (switch (arg_mode) { ^ /home/sacha/Documents/code/ziglang/zig/src/main.zig:283:31: 0x1a6ce57 in mainArgs (main.zig) dev.check(.build_lib_command); ^ /home/sacha/Documents/code/ziglang/zig/src/main.zig:236:20: 0x19c9cf1 in main (main.zig) ^ /home/sacha/.zvm/0.16.0/lib/std/start.zig:699:88: 0x19c8830 in callMain (std.zig) if (fn_info.params[0].type.? == std.process.Init.Minimal) return wrapMain(root.main(.{ ^ /home/sacha/.zvm/0.16.0/lib/std/start.zig:190:5: 0x19c8201 in _start (std.zig) asm volatile (switch (native_arch) { ^ Aborted (core dumped) ``` # Expected Behavior: The compiler should not crash
glowsquid changed title from (削除) SPIR-V: Compiler crash when indexing a storage buffer with an input (削除ここまで) to SPIR-V: Compiler crash when indexing a storage buffer 2026年06月14日 10:31:20 +02:00
alexrp added this to the 0.17.0 milestone 2026年06月18日 13:39:54 +02:00
Sign in to join this conversation.
No Branch/Tag specified
master
elfv2
spork8
restricted
0.16.x
panic-rewrite
parking-futex-lockfree
windows-Io-cleanup
Io-watch
ParseCommandLineOptions
windows-async-files
poll-ring
debug-file-leaks-differently
debug-file-leaks
ProcessPrng
elfv2-dyn
jobserver
threadtheft
io-threaded-no-queue
0.15.x
Io.net
comptime-allocator
restricted-function-pointers
cli
wasm-linker-writer
wrangle-writer-buffering
sha1-stream
async-await-demo
fixes
0.14.x
ast-node-methods
macos-debug-info
make-vs-configure
fuzz-macos
sans-aro
ArrayList-reserve
incr-bug
llvm-ir-nosanitize-metadata
ci-tarballs
ci-scripts
threadpool
0.12.x
new-pkg-hash
json-diagnostics
more-doctests
rework-comptime-mutation
0.11.x
ci-perf-comment
stage2-async
0.10.x
autofix
0.9.x
aro
hcs
0.8.x
0.7.x
0.16.0
0.15.2
0.15.1
0.15.0
0.14.1
0.14.0
0.12.1
0.13.0
0.12.0
0.11.0
0.10.1
0.10.0
0.9.1
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.1
0.1.0
Labels
Clear labels
abi/f32
abi/ilp32
abi/sf
accepted
This proposal is planned.
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
The web application for interactive documentation and generation of its assets.
backend/c
The C backend outputs C source code.
backend/llvm
The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted
The self-hosted backends produce machine code directly.
binutils
Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
build system
The Zig build system - zig build, std.Build, the build runner, and package management.
debug info
An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs
An issue with documentation, e.g. the language reference or standard library doc comments.
error message
This issue points out an error message that is unhelpful and should be improved.
frontend
Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing
An issue related to Zig's integrated fuzz testing.
incremental
Reuse of internal compiler state for faster compilation.
lib/c
This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt
This issue relates to Zig's compiler-rt library.
lib/cxx
This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std
This issue relates to Zig's standard library.
lib/tsan
This issue relates to Zig's vendored libtsan.
lib/ubsan-rt
This issue relates to Zig's ubsan-rt library.
lib/unwind
This issue relates to Zig's vendored libunwind.
linking
Zig's integrated object file and incremental linker.
miscompilation
The compiler reports success but produces semantically incorrect code.
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
This issue suggests language modifications. If it also has the "accepted" label then it is planned.
release notes
This issue or pull request should be mentioned in the release notes.
testing
This issue is related to testing the compiler, standard library, or other parts of Zig.
zig cc
Zig as a drop-in C-family compiler.
zig fmt
The Zig source code formatter.
zig reduce
The Zig source code reduction tool.
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
No labels
abi/f32
abi/ilp32
abi/sf
accepted
arch/21k
arch/6502
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/bfin
arch/bpf
arch/colossus
arch/cris
arch/csky
arch/dlx
arch/epiphany
arch/fr30
arch/frv
arch/hexagon
arch/hppa
arch/hppa64
arch/ia64
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/mcore
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/ns32k
arch/nvptx
arch/or1k
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390x
arch/sh
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/tricore
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/x86
arch/x86_64
arch/xcore
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/android
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/tvos
os/uefi
os/visionos
os/wasi
os/watchos
os/windows
proposal
release notes
testing
zig cc
zig fmt
zig reduce
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
use case
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig#35769
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?