Stream: cranelift

Topic: the cranelift-egraph crate


view this post on Zulip Maja Kądziołka (Mar 02 2023 at 11:43):

Hi! I was considering using cranelift's acyclic egraph code for an independent project of mine. I found the cranelift-egraph crate, then looked at the API exposed and went "hold on, there's no way this is sound", and while getting ready to report a bug, I noticed that the crate got refactored out of existence, and the version on crates.io is just a stale snapshot from a while ago. Not ideal, but not sure what the best thing to do about it would be...

view this post on Zulip bjorn3 (Mar 02 2023 at 14:22):

Cranelift-egraph was merged into cranelift-codegen.

view this post on Zulip Maja Kądziołka (Mar 02 2023 at 15:01):

Yeah, it'd be a good idea to mark the crate as deprecated on crates.io or something

view this post on Zulip Maja Kądziołka (Mar 02 2023 at 15:04):

It seems that BumpArena itself, which was unsound, doesn't exist anymore at all?

view this post on Zulip Chris Fallin (Mar 02 2023 at 16:21):

It doesn't, that's correct. It might still be good to know what issue you found though, in case the code is ever reused for something?

view this post on Zulip Maja Kądziołka (Mar 02 2023 at 16:31):

well there was nothing preventing the use of a BumpVec allocated in one arena with a different arena, leading to reads of uninitialized memory and other fun. I'd probably mark arena_with_capacity as unsafe, making the caller ensure that there's exactly one arena of a given type "in context", whatever that would mean for the application

view this post on Zulip Chris Fallin (Mar 02 2023 at 16:52):

ah, right, we always held that invariant in practice; I agree we should have probably marked that with an unsafe


Last updated: Nov 22 2024 at 16:03 UTC