Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear errinfo after each finalizer runs
In jruby#7267 we had a report of endless exception cause processing that turned out to be triggered by a bad finalizer (that allowed an exception to bubble out) stacking up causes from previous calls of that finalizer. The fix here mimics what CRuby does: where they reset the errinfo to what it was prior to the finalizer running (because CRuby's GC often/usually runs on the current user thread), we simply clear it after each finalizer has run (because the JDK runs finalizers on a separate thread, as will our future non-JVM-finalizer version of this logic). No spec is provided yet due to the difficulty of testing GC-triggered events across VMs. See ruby/spec#935 for more details. Fixes jruby#7267
- Loading branch information