Odin
Odin copied to clipboard
Compilation segmentation fault with { break }
Context
Odin: dev-2021-12:9f0a30e3
OS: Arch Linux, Linux 5.15.5-arch1-1
CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
RAM: 15919 MiB
Steps to Reproduce
odin build repro.odin -debug
package main
import "core:fmt"
main :: proc() {
for i := 0; ; i += 1 {
{
break;
}
fmt.println("")
}
}
Failure Logs
Thread 1 "odin" received signal SIGSEGV, Segmentation fault.
0x00005555556cdcc5 in lb_add_local (p=0x7fff947b00a0, type=0x555555841930 <basic_types+3968>, e=0x0, zero_init=false, param_index=0, force_no_init=false) at src/llvm_backend_general.cpp:2653
2653 LLVMPositionBuilderAtEnd(p->builder, p->curr_block->block);
(gdb) bt
#0 0x00005555556cdcc5 in lb_add_local (p=0x7fff947b00a0, type=0x555555841930 <basic_types+3968>, e=0x0, zero_init=false, param_index=0, force_no_init=false) at src/llvm_backend_general.cpp:2653
#1 0x0000555555694ef0 in lb_add_local_generated (p=0x7fff947b00a0, type=0x555555841930 <basic_types+3968>, zero_init=false) at src/llvm_backend_general.cpp:2686
#2 0x000055555569d124 in lb_emit_conv (p=0x7fff947b00a0, value=..., t=0x555555841a30 <basic_types+4224>) at src/llvm_backend_expr.cpp:1454
#3 0x0000555555718b9c in lb_build_call_expr_internal (p=0x7fff947b00a0, expr=0x7fffdb7ff8f0) at src/llvm_backend_proc.cpp:2381
#4 0x00005555556f73b9 in lb_build_call_expr (p=0x7fff947b00a0, expr=0x7fffdb7ff8f0) at src/llvm_backend_proc.cpp:2140
#5 0x00005555556cd1ac in lb_build_expr (p=0x7fff947b00a0, expr=0x7fffdb7ff8f0) at src/llvm_backend_expr.cpp:3086
#6 0x00005555556fa33f in lb_build_stmt (p=0x7fff947b00a0, node=0x7fffdb7ff9d0) at src/llvm_backend_stmt.cpp:2127
#7 0x00005555556f96b5 in lb_build_stmt_list (p=0x7fff947b00a0, stmts=...) at src/llvm_backend_stmt.cpp:150
#8 0x00005555556f9cb1 in lb_build_stmt (p=0x7fff947b00a0, node=0x7fffdb7ffa10) at src/llvm_backend_stmt.cpp:2067
#9 0x0000555555706399 in lb_build_for_stmt (p=0x7fff947b00a0, node=0x7fffdb7ffac0) at src/llvm_backend_stmt.cpp:1752
#10 0x00005555556fa67c in lb_build_stmt (p=0x7fff947b00a0, node=0x7fffdb7ffac0) at src/llvm_backend_stmt.cpp:2143
#11 0x00005555556f96b5 in lb_build_stmt_list (p=0x7fff947b00a0, stmts=...) at src/llvm_backend_stmt.cpp:150
#12 0x00005555556f9cb1 in lb_build_stmt (p=0x7fff947b00a0, node=0x7fffdb7ffbb0) at src/llvm_backend_stmt.cpp:2067
#13 0x000055555571c309 in lb_generate_procedure (m=0x7fff947a9008, p=0x7fff947b00a0) at src/llvm_backend.cpp:1095
#14 0x000055555571f3d5 in lb_generate_code (gen=0x7fff947a8f20) at src/llvm_backend.cpp:1635
#15 0x0000555555734d6d in main (arg_count=4, arg_ptr=0x7fffffffdca8) at src/main.cpp:2690
Hello!
I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue
- open a PR referencing and resolving the issue;
- leave a comment on it and discuss ideas how you could contribute towards resolving it;
- leave a comment and describe in detail why this issue is critical for your use case;
- open a new issue with updated details and a plan on resolving the issue.
The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..