You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Java.Interop] Add JniIdentityHashCode to ObjectDisposedException (#1276)
Context: dotnet/android#9039
Context: dotnet/android@32495f3@jonpryor suspects that the `ObjectDisposedException` being thrown
within dotnet/android#9039 *may* be due to a GC-related bug.
A problem with diagnosing this is tracking object lifetimes: yes, an
`Android.Runtime.InputStreamInvoker` is throwing
`ObjectDisposedException`, but in local reproductions, there are
*multiple* `InputStreamInvoker` instances created! Which one is
throwing?
A local answer to that was "Update `InputStreamInvoker.Read()` to log
`BaseInputStream.JniIdentityHashCode`", which *was* useful, but is
not a "scalable" solution.
Review all `throw new ObjectDisposedException()` calls within
`Java.Interop.dll`, and update all sites which use `IJavaPeerable`
to include the `JniIdentityHashCode` value in the exception message.
This would result in a message like:
System.ObjectDisposedException: Cannot access disposed object with JniIdentityHashCode=0x12345678.
Object name: 'Android.Runtime.InputStreamInvoker'.
at Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable )
…
0 commit comments