public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* timerfd deadlock
@ 2019-06-07 12:10 Ken Brown
  2019-06-11  8:52 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Brown @ 2019-06-07 12:10 UTC (permalink / raw)
  To: cygwin

While testing some new pipe code, I'm occasionally seeing a timerfd deadlock: 
The main thread is stuck in timerfd_tracker::dtor at timerfd.cc:354, waiting for 
the timerfd thread to close; and the timerfd thread is stuck at timerfd.cc:140, 
waiting to acquire a mutex that's held by timerfd_tracker::dtor.

I see this maybe 1 out of 4 times that I run 'make -j13' on a clean emacs source 
tree, and I see it only when my new pipe code is installed.  So I don't know if 
this is a bug in my code or if it's just coincidence that my code happens to 
trigger a timerfd bug.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: timerfd deadlock
  2019-06-07 12:10 timerfd deadlock Ken Brown
@ 2019-06-11  8:52 ` Corinna Vinschen
  2019-06-11 13:18   ` Ken Brown
  2019-06-24 20:16   ` Ken Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Corinna Vinschen @ 2019-06-11  8:52 UTC (permalink / raw)
  To: cygwin, Ken Brown

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

On Jun  7 12:10, Ken Brown wrote:
> While testing some new pipe code, I'm occasionally seeing a timerfd deadlock: 
> The main thread is stuck in timerfd_tracker::dtor at timerfd.cc:354, waiting for 
> the timerfd thread to close; and the timerfd thread is stuck at timerfd.cc:140, 
> waiting to acquire a mutex that's held by timerfd_tracker::dtor.

Hmm, I had hoped my current code does not have a deadlock situation
anymore, but I was wrong, apparently.

Is there any chance to create an STC?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: timerfd deadlock
  2019-06-11  8:52 ` Corinna Vinschen
@ 2019-06-11 13:18   ` Ken Brown
  2019-06-24 20:16   ` Ken Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Ken Brown @ 2019-06-11 13:18 UTC (permalink / raw)
  To: cygwin

On 6/11/2019 4:52 AM, Corinna Vinschen wrote:
> On Jun  7 12:10, Ken Brown wrote:
>> While testing some new pipe code, I'm occasionally seeing a timerfd deadlock:
>> The main thread is stuck in timerfd_tracker::dtor at timerfd.cc:354, waiting for
>> the timerfd thread to close; and the timerfd thread is stuck at timerfd.cc:140,
>> waiting to acquire a mutex that's held by timerfd_tracker::dtor.
> 
> Hmm, I had hoped my current code does not have a deadlock situation
> anymore, but I was wrong, apparently.
> 
> Is there any chance to create an STC?

I'll try.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: timerfd deadlock
  2019-06-11  8:52 ` Corinna Vinschen
  2019-06-11 13:18   ` Ken Brown
@ 2019-06-24 20:16   ` Ken Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Ken Brown @ 2019-06-24 20:16 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1240 bytes --]

On 6/11/2019 4:52 AM, Corinna Vinschen wrote:
> On Jun  7 12:10, Ken Brown wrote:
>> While testing some new pipe code, I'm occasionally seeing a timerfd deadlock:
>> The main thread is stuck in timerfd_tracker::dtor at timerfd.cc:354, waiting for
>> the timerfd thread to close; and the timerfd thread is stuck at timerfd.cc:140,
>> waiting to acquire a mutex that's held by timerfd_tracker::dtor.
> 
> Hmm, I had hoped my current code does not have a deadlock situation
> anymore, but I was wrong, apparently.
> 
> Is there any chance to create an STC?

I haven't been able to create an STC.  The deadlock seems to depend on a rare 
timing fluke, and I've only seen it when running a parallel make on a clean 
emacs tree, with my new pipe code installed.

On the other hand, I think I have a simple fix, which I'll send to 
cygwin-patches.  With this patch, I ran the parallel make 15 times without 
getting the deadlock.  After reverting the patch, I got the deadlock on the 4th run.

Ken
\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-24 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 12:10 timerfd deadlock Ken Brown
2019-06-11  8:52 ` Corinna Vinschen
2019-06-11 13:18   ` Ken Brown
2019-06-24 20:16   ` Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).