essentialkaos/aligo

assertion failed

Closed this issue · 4 comments

kehiy commented

we are trying to use aligo in our project linter, but we face with this issue:

aligo --tags "" check ./...
panic: /opt/hostedtoolcache/go/1.20.7/x64/src/go/types/sizes.go:181: assertion failed

goroutine 1 [running]:
go/types.assert(0x18?)

the faild workflow

how can we fix it?

kehiy commented

@andyone can you help?

You get this error because OOM killer killed the process of aligo due to lack of memory. Your project has a huge code base and building AST for analysis exceeds the size of GitHub actions worker memory. You can try setting memory limits like that:

GOMEMLIMIT=5MiB aligo check ./...

But anyway, checking for such a big amount of code on small worker (building AST requires parsing all dependencies at any depth) will take 30-40 minutes or even more.

@kehiy JFYI I've released aligo 2.0.0. I've replaced the deprecated go/loader package with go/packages and now it uses less memory and inspects sources much faster. It should help using aligo with your project without memory limits.

kehiy commented

@andyone
thank you so much I will test it!
(but the last time I faced with the same issue with 25MIB mem limit)