-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Playground to_unix_timestamp nanoseconds precision error #20325
Comments
Thanks for this thorough report @DimDroll I think this might be related to the fact that the VRL Playground compiles VRL into a WASM module which is then executed in the browser 🤔 . I agree if we aren't able to resolve it we should at least call it out. |
(I transferred this issue to Vector since that is where the VRL playground code lives) |
Spent some time trying to understand the issue with WASM and precision, but realized that this issue is out of my depth. So here is the research I did if it helps anyone else: wasm-bingden supports BigInt since 0.2.77: serde-wasm-bindgen also implemented it in: Mozilla added it to standards: WASM and JS features that added BigInt: Browsers that support WASM with BigInt: I tried to see if the issue replicates locally, but following this manual: Presumably because zstd needs to be build like this: |
Are there more errors in the log output that indicate the issue it had building |
Thank you Jesse for taking the time to look at this, Replication steps from my side are:
Here are excerpts from the error output:
There are a lot more details in it, so I've attached full log in the file: |
Looks like someone else discovered it too, gyscos/zstd-rs#271, and there is an open a PR to fix it: gyscos/zstd-rs#274. I'll bump back down in the meanwhile. |
Opened #20369 to bump down the zstd dependency for now. |
Thank you, I was finally able to build playground and replicate the issue there as well. For those stumbling into the thread and building it in WSL too, I had to apply this fix for WSL2: p.s. @jszwedko I really appreciate your lightning speed replies and changes. thank you. |
Hello Vector Team,
It seems there is some sort of integer overflow happening during nanoseconds parsing:
I assume this is something JavaScript related as in VRL CLI it works just fine.
This is first magical number when it starts occurring "9007199254740993". Here is the relevant artice that I found:
https://medium.com/@vinaymahamuni/interesting-bug-finding-related-to-javascript-e31de4dac02d
I spent significant time researching this issue because I assumed playground works for the most part 1-1 with VRL.
If it is something that can't be fixed maybe it should be added as note here:
https://vector.dev/docs/reference/vrl/#learn
And as info box in the top right in the Playground UI as well.
Some more examples:
Following became irrelevant when I found that this is not Rust related issue.
The text was updated successfully, but these errors were encountered: