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

Files more than 1024 under wasmplugin/rules directory will prompt error when execute go run mage.go build #277

Open
caogw279 opened this issue Jun 11, 2024 · 0 comments

Comments

@caogw279
Copy link

caogw279 commented Jun 11, 2024

In wasmplugin/rules directory, I split the waf ruls and put every secrule directive to a file and then use include directive to include these files, but after splited most the ruls, it's seam that all the files (not only the rule files new generated but also other exsit files)more than 1024, then I execute go run mage.go build it will prompt the error as following, it's seam tinygo have a limitation for the files number, what should to do to enlarge it ?

[root@a34e88a9c347 coraza-proxy-wasm]# go run mage.go build
panic: runtime error: slice bounds out of range [::1112] with length 1024

goroutine 1 [running]:
github.com/tinygo-org/tinygo/builder.RunTool({0x7ffdaae8dda1, 0x7}, {0xc000028828?, 0x457?, 0x5fd0c3e?})
/__w/tinygo/tinygo/builder/tools-builtin.go:31 +0x4d9
main.main()
/__w/tinygo/tinygo/main.go:1485 +0xe7a
error: failed to link /tmp/tinygo2059273237/main: exit status 2
Error: running "tinygo build -gc=custom -opt=2 -o build/mainraw.wasm -scheduler=none -target=wasi -tags='custommalloc nottinygc_envoy no_fs_access memoize_builders coraza.rule.multiphase_evaluation'" failed with exit code 1
exit status 1

Then version of tinygo and go:

[root@a34e88a9c347 coraza-proxy-wasm]# tinygo version
tinygo version 0.31.2 linux/amd64 (using go version go1.22.3 and LLVM version 17.0.1)

@caogw279 caogw279 changed the title Files more than 1024 under wasmplugin/rules director will prompt error when execute go run mage.go build Files more than 1024 under wasmplugin/rules directory will prompt error when execute go run mage.go build Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant