-
Notifications
You must be signed in to change notification settings - Fork 7
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
Angstrom-based parser causes stack overflow in JavaScript output #67
Comments
Oh huh, this is curious - my recollection is browser runs fine with it, though maybe that is a faulty recollection as well. @glennsl were you using JS version of timedesc? Do you have any similar experience? |
I'll try adding more |
I can't recall having any technical issues at all! But the project I was using it for unfortunately collapsed (for entirely unrelated reasons!) so I haven't tried it after you overhauled the dependencies. |
Ah, oh well. I tried adding some commits to no avail, but found out that the number passed to let half_compressed : string M.t Angstrom.t =
BE.any_uint16 >>=
(fun table_count ->
count table_count (commit *> half_compressed_name_and_table) >>|
(fun l ->
l
|> List.to_seq
|> M.of_seq
)
) If I swap So I suspect |
Okay, someone made the presumably same discovery: inhabitedtype/angstrom#221 |
Using the tail-recursive version mentioned in the issue doesn't seem to help - probably failed to compile that to loop during JS compilation. Looks like I'll have to hand roll a parser for this. |
@zbaylin I pushed a fix and tried it with nodejs and seems to be working now - can you try pinning to Thanks for investigating btw! |
Closing this as the mentioned fix has been pushed to Timedesc 0.9.1 and seems to side step the issue. |
This was pretty hard to debug because any JS executable that includes
timere
ortimedesc
immediately crashes. To replicate, simply create an empty OCaml file withThen running
node
on the generated file with a large stacktrace limit and source maps enabled:This produces a (very) long stacktrace with this at the bottom:
half_compressed_string
lives here:timere/timedesc/time_zone.ml
Line 651 in f8e2fd5
I assume this has to do with the new Angstrom-based parser, but I haven't gone into the semantics to figure out why.
The text was updated successfully, but these errors were encountered: