Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Infinite loop when compiling procedure with weird parapoly signature

Open dholmin opened this issue 1 year ago • 2 comments

Context

Odin:    dev-2024-06:02f11dfde
OS:      macOS Mojave 10.14.6 (build: 18G2022, kernel: 18.7.0)
CPU:     Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
RAM:     8192 MiB
Backend: LLVM 13.0.1

Also happens on my M1 Pro MacBook.

Failure Information

odin build . doesn't terminate when compiling the following:

binary_search :: proc(slice: $T/[]$E, value: E, projection: proc(v: E) -> $K = proc(v2: E) -> K { return v2 }) -> int
{
	return 0
}

It happened when I added the parapoly proc default argument, but I haven't had time to boil it down further.

dholmin avatar Jun 14 '24 20:06 dholmin

Replicated. It's stuck at check procedure bodies.

W:\Odin\bug>odin build bug.odin -file -show-debug-messages
<snip>
[DEBUG] [Section] export entities - post
[DEBUG] [Section] add entities from packages
[DEBUG] [Section] check all global entities
[DEBUG] [Section] init preload
[DEBUG] [Section] add global untyped expression to queue
[DEBUG] [Section] check procedure bodies

Kelimion avatar Jun 14 '24 20:06 Kelimion

I'm looking at this at the moment. Be careful if you let this run too long without sending a pause signal. It's allocating infinitely many procedures to check and consumed several gigabytes of memory for me.

Feoramund avatar Jun 15 '24 00:06 Feoramund

This still replicates.

Kelimion avatar May 09 '25 11:05 Kelimion