-
Notifications
You must be signed in to change notification settings - Fork 239
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
SEGV in xsRun.c on eval
of large (~200KB) string
#399
Comments
@phoddie We're blocked on this. Please advise. Are we doing something wrong? Any workaround until it is fixed? Thanks. |
I'm actually using a version of the SDK from Jun 5 62c7f1e with some platform tweaks. I hope to try again with the latest moddable SDK soon... |
The exception is generated from @dckc was on the right track with increasing the parser buffer size. However, the manifest adjusts the buffer for the runtime, not the tools. The buffer for the tools is 32 KB, but two of your strings are well over that. Increase buffers in the tools isn't a concern, so we will look into changing the default. In the meantime, you can build by forcing moddable/xs/sources/xsScript.c Lines 50 to 56 in 879188a
|
runtime (i.e. I'm tried to reproduce the problem with a small example using eval, but the symptoms go away. (I updated https://gist.github.com/dckc/0f6c74cd669c37079993c0d724f2e6da with details.) good news: I just realized xsbug works with our x-cli-lin headless platform. I don't know why I thought it didn't. This could be really handy in diagnosing the larger problem. |
The long string seems to be a red herring. The crash comes near
EDIT the crash actually came a little bit after that function... when the 200KB string was evaluated in a new compartment. |
We should NOT use that hacky replacement for We should never use the two-argument form of |
If there is an open issue about large strings, please let me know. Otherwise, let's close this issue out. @erights: With regard to Since nearly all of Moddable's use of |
I'm definitely getting a SEGV from somewhere. But until I know more about where, yes, let's close this. |
I got a SEGV at this line when trying to
eval
a large (~200KB) string:moddable/xs/sources/xsRun.c
Line 1359 in 6729c94
To isolate the problem, I put the big string of js in main.js in the hello-world moddable SDK example and I get
bug1/main.js:14: error: buffer overflow!
I tried allocating more space (usingcreation
stuff), but the symptoms were the same. The goal is toeval
the string, but I can't even get it to compile.Details are in https://gist.github.com/dckc/0f6c74cd669c37079993c0d724f2e6da
cc @warner @michaelfig
context: Agoric/agoric-sdk#1299 , Agoric/agoric-sdk#1407
The text was updated successfully, but these errors were encountered: