Bug 49278 - GC uses deprecated runtime API on shutdown
Summary: GC uses deprecated runtime API on shutdown
Alias: None
Product: Runtime
Classification: Mono
Component: GC (show other bugs)
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2016-12-08 07:15 UTC by Rodrigo Kumpera
Modified: 2017-10-06 23:30 UTC (History)
6 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Rodrigo Kumpera 2016-12-08 07:15:38 UTC
In mono_gc_cleanup, we use mono_thread_internal_stop to stop the finalizer thread.

That API is deprecated and is going untested.

We should replace it with a regular thread abort, by calling mono_thread_internal_abort.

To write a test case for this try the following:

Allocate objects with finalizers that take a long time (sleep, loops, etc).
Force a GC so those objects get in the finalizer queue.
Leave the main thread, triggering shutdown.
Ensure with CWLs and busy looping from the main thread, that we only leave it when finalization started.
Comment 1 Rodrigo Kumpera 2016-12-08 07:17:09 UTC
Hey guys,

This is a nice to have cleanup that would allow us to remove the last remaining user of thread stop, which is a very broken variant of thread abort.
Comment 2 Zoltan Varga 2016-12-17 09:54:29 UTC
We already abort the thread, the stop is done when the abort fails. _stop () is somewhat guaranteed to succeed.

Note You need to log in before you can comment on or make changes to this bug.