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

aes crate: the frontend loops indefinitely #686

Closed
W95Psp opened this issue May 22, 2024 · 7 comments
Closed

aes crate: the frontend loops indefinitely #686

W95Psp opened this issue May 22, 2024 · 7 comments
Assignees
Labels
bug Something isn't working frontend Issue in the Rust to JSON translation keep-open

Comments

@W95Psp
Copy link
Collaborator

W95Psp commented May 22, 2024

To reproduce, clone https://github.com/RustCrypto/block-ciphers at commit ae1892c8, and cargo hax json on crate aes.

This behavior is the same for libsignal, which uses the crate aes.

@franziskuskiefer and I looked at it a bit yesterday (with RUST_LOG=trace cargo hax json, hax being compiled in debug mode), and it seems like some Sized trait obligations are resolved a HUGE number of times before killing the memory of the laptop it's running on.
So probably there is somehow an infinite recursion or loop, but that definitively has to do with trait resolution.

Ccing @Nadrieril who had a very very similar issue a few weeks ago

@W95Psp W95Psp added bug Something isn't working frontend Issue in the Rust to JSON translation labels May 22, 2024
@sonmarcho
Copy link
Collaborator

I think this is related:
AeneasVerif/charon#191

@W95Psp
Copy link
Collaborator Author

W95Psp commented Jul 29, 2024

Strangely enough, PR #730 doesn't fix this issue but fixes the looping behavior in cipher, from https://github.com/RustCrypto/traits. So there are various bugs there.

Copy link

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

@W95Psp
Copy link
Collaborator Author

W95Psp commented Oct 2, 2024

This is still a problem, a759a1a doesn't help

@W95Psp
Copy link
Collaborator Author

W95Psp commented Oct 7, 2024

Still there after #970

@W95Psp
Copy link
Collaborator Author

W95Psp commented Oct 14, 2024

@Nadrieril mostly fixed the bug with its PR #996!
So it was just extremely slow because it was re-doing things again and again.

This pseudo-loop was hiding another bug; I have a fix, will push a PR soon. But the aes crate now extract in under 40 seconds! Thanks @Nadrieril!

@W95Psp
Copy link
Collaborator Author

W95Psp commented Oct 14, 2024

Let's close this. The extraction now works: the extraction itself takes around 40s, but the haxmeta/JSON business takes around 4 minutes on my laptop...

Let's see how we can improve that:

@W95Psp W95Psp closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Issue in the Rust to JSON translation keep-open
Projects
No open projects
Status: No status
Development

No branches or pull requests

4 participants