Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Very long expressions cause stack overflow during type checking

Open Beefster09 opened this issue 1 year ago • 2 comments

Context

        Odin:    dev-2024-06:80592f0f5
        OS:      Windows 10 Home Basic (version: 22H2), build 19045.4529
        CPU:     Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
        RAM:     65343 MiB
        Backend: LLVM 17.0.1

Expected Behavior

No matter how long an expression is, the compiler should either be able to compile or it should refuse to compile it with a helpful error message.

Current Behavior

While typechecking a long series of compilie-time string concatenations, the compiler has a stack overflow.

It's possible the overflow threshold is lower on Windows, as this same file did not cause trouble on Linux.

Confirmed that a workaround is to represent that giant string another way

Failure Information (for bugs)

Seems to be reproduced consistently on a file I have in my project that creates a long list of icons and their names in one big string.

Steps to Reproduce

  1. unzip the files into a package called icons
  2. import the package
  3. in main, print ALL_THE_ICONS with fmt.println

You can probably create a similar test case quite easily

Useful Files

icons-odin.zip

Beefster09 avatar Jun 30 '24 00:06 Beefster09

I'm able to reproduce this on Linux, but I need an absurd amount of text/concatenations to do it.

Feoramund avatar Jun 30 '24 01:06 Feoramund

Confirmed on Windows. It works up to this point, but allow ARROW_UP_RIGHT + " ARROW_UP_RIGHT\n" and it's busted.

image

Kelimion avatar Jun 30 '24 10:06 Kelimion