base::MessageLoop::~MessageLoop() triggering a DCHECK when TLS is clear before termination.
Reported by
claudiom...@gmail.com,
Aug 24 2017
|
|||
Issue description
The destructor for base::MessageLoop used to have the following check:
DCHECK(current() == this || !current());
This has since then been changed to:
DCHECK((pump_ && current() == this) || (!pump_ && current() != this));
This check was changed to accommodate for when the loop being bound, due to a thread failing to be created. The problem with this change is that it doesn't account anymore for !current(), and this is causing problems when a message loop has to be destroyed for the main thread in DLL.
Solution:
Change the check to:
DCHECK((pump_ && (current() == this || !current())) ||
(!pump_ && current() != this));
,
Sep 6 2017
,
Feb 11 2018
Sami this is from your change. Thoughts?
,
Feb 13 2018
Hmm, I'm not sure how the TLS would get cleared before the MessageLoop is destructed. Do you mean the underlying TLS mechanism? Clearing that before the MessageLoop is destructed seems worse since we still run tasks at ML shutdown.
,
Feb 13 2018
I have seen this happening when having base compiled in a DLL. I only filed an issue because I noticed the check condition had changed in meaning during a refactoring.
,
Jan 11
Setting defect without priority to Pri-2. |
|||
►
Sign in to add a comment |
|||
Comment 1 by jparent@chromium.org
, Sep 6 2017