mattwparas / steel

An embedded scheme interpreter in Rust
Apache License 2.0
980 stars 46 forks source link

fix recyclable drop #224

Closed jrvidal closed 3 weeks ago

jrvidal commented 3 weeks ago

Fixes a panic I noticed while trying the helix integration. My guess is that:

  1. Static storage transitively contains recyclable values.
  2. The storage gets dropped at thread exit.
  3. Some recyclable value Drop impl is called and attempts to access the thread local.
  4. And that panics b/c the thread local Drop call is ongoing.
mattwparas commented 3 weeks ago

Did this happen at exit? I must have not run into it myself

Anyway this look good to me

jrvidal commented 3 weeks ago

Did this happen at exit? I must have not run into it myself

Yes, it always happened when exiting helix. FWIW I ran your helix branch together with the latest master from Steel (with some minor modifications to get it to compile).

mattwparas commented 3 weeks ago

I must just be behind then. I'll take a look this weekend

mattwparas commented 3 weeks ago

@jrvidal What were the other issues you had with helix + steel? I'm trying with latest master right now and running into some unexpected behavior with multi arity functions from the built ins

jrvidal commented 3 weeks ago

I just uploaded a couple branches:

https://github.com/jrvidal/helix/tree/mwp-steel-integration-hack https://github.com/jrvidal/steel/tree/steel-for-helix

I might be able to add more details later.