-
Notifications
You must be signed in to change notification settings - Fork 56
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
Build error: error: string size out of bounds (at offset {offset})
#281
Comments
Without seeing the exact code that's being compiled, it's difficult to say for sure. The error you're seeing is caused by trying to read or skip string data from a WebAssembly module that exceeds the maximum allowed size for a string (100,000 bytes). If you run |
Hi Ryan, thanks for the idea. I ran the command that you mentioned, but nothing was output to the console at all. I assume that means that the checks were successful? For some additional context, I'm writing a parser using a parser combinator library called chumsky. I believe that the problem starts happening when the parser types reach a certain depth of recursion, though I haven't been able to verify that yet. |
For additional context, I only run into errors when using cargo-component. If I compile to windows-msvc or directly to wasm32-wasi, I don't see any errors. For more context, I found that when I run
It does seem that something was happening after the file was compiled that failed. |
I dug into the |
The error about the binary not being a component makes sense. It seems that The type info does seem like a very likely culprit. The short term work around is to strip that info from the binary (perhaps using |
Thanks for the suggestions. I tried using
I guess in this case, it stripped too much. Next I'll |
By the way, this issue a limitation of |
To add one more update, it does seem that the offending part of the |
Hi @toadslop.
No, this is an intentional limitation in
Given that I think the proper fix here is to add a |
I haven't tried, but the suppression of the A possible work around might be adding the following to your [profile.dev]
debug = false or [profile.dev]
strip = "symbols" Obviously that will impact your ability to see useful stack traces for traps originating from the component (or otherwise being able to debug it). |
Recently I started experiencing an error when I run
cargo comonent build
. I'm sorry, but I can't figure out what's causing it or provide a minimal example. I'm hoping you all might have some idea what could be causing it.I run this command:
I get this output:
The interesting thing is, the build appears to have worked -- I get the output file and everything works as expected. The error code that gets generated by the command causes my CICD pipeline and buildscripts to abort, so it's rather annoying.
I've dug through my code for quite a while and couldn't find anything wrong with it. I basically commented out everything and then started adding things back in line by line and at a certain point, the error would start happening. This makes me think it could be related to the size of the project, but I don't know enough about how
cargo-component
works to guess at whether or not that could be the cause so I thought I'd raise the issue here and see if anyone more familiar with the project has any insights.The text was updated successfully, but these errors were encountered: