Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when compiling with a large number of embedded files #4348

Open
kkoreilly opened this issue Jul 19, 2024 · 0 comments
Open

Crash when compiling with a large number of embedded files #4348

kkoreilly opened this issue Jul 19, 2024 · 0 comments
Labels
bug Something isn't working core

Comments

@kkoreilly
Copy link

When compiling this program with tinygo build -target wasm -o app.wasm on macOS:

package main

import _ "cogentcore.org/core/icons"

func main() {}

The compiler crashes with this error:

panic: runtime error: slice bounds out of range [::4124] with length 1024

goroutine 1 [running]:
github.com/tinygo-org/tinygo/builder.RunTool({0x16d01938a, 0x7}, {0x140000c8020?, 0x101b?, 0x1073929dd?})
        /Users/runner/work/tinygo/tinygo/builder/tools-builtin.go:31 +0x414
main.main()
        /Users/runner/work/tinygo/tinygo/main.go:1486 +0xe88
error: failed to link /var/folders/pw/lntpc2cn37v41ct1t0t9t9880000gn/T/tinygo3720530408/main: exit status 2

I have determined that the reason why it is crashing is the large number of embedded files contained within https://github.com/cogentcore/core/blob/main/icons/icongen.go. If you comment out the file embedding statements from Circles all the way to the bottom, it stops crashing, but if you uncomment enough of those lines, it starts crashing again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

2 participants