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

Met an Error of misaligned memory access when tried with sqlparser crate #142

Open
silathdiir opened this issue Apr 11, 2024 · 3 comments
Open

Comments

@silathdiir
Copy link

Hi, this is really a good project!

I tried to use the VM to write some examples with crates (nostd, default-features = false) in a simple project, most work well for me!

But I failed in a simple example with sqlparser-rs in this code, it reports the error of misaligned memory access. This code could work well in a normal project (without VM), I tried to debug it, seems the SQL tokens are parsed wrong from the string (may be caused by macro).
Do you have any ideas about this eror? Thanks.

@danielmarinq
Copy link
Contributor

Thanks @silathdiir! Great catch. Might be because of the memory allocator failing to allocate the string as expected by the parser.

@govereau or @sjudson, what do you think?

@danielmarinq
Copy link
Contributor

It might be due to the allocator here: https://github.com/nexus-xyz/nexus-zkvm/blob/main/runtime/src/lib.rs

@govereau
Copy link
Contributor

I was able to reproduce with the riscv VM using Paged memory, both release and debug with a larger memory size. Looks like a real unaligned access from the rust compiler.

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

3 participants