Closure marshalling in toplevel is broken since at least 4.00 #6760
Original bug ID: 6760
To reproduce, do in toplevel:
Comment author: @gasche
I find it rather suspicious that caml_ext_table_remove would take the responsibility to caml_stat_free the data to remove. Does this really correspond to the ownership disciplines of all users of caml_ext_table_add?
Also, I'm not familiar with this part of the code, but isn't abort()ing in caml_static_release_bytecode a bit overconfident? I would be more comfortable with at least an error message.
Comment author: @whitequark
It does; caml_ext_table_free performs caml_stat_free on the data, which is why I wrote _remove that way.
I don't think so; in the impossible case (mismatched reify/release) that it happens, the backtrace provides more than enough context to debug this.