public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* spinlock.h timeout causing *** fatal error - add_item abort
@ 2016-04-29 16:32 Kevin Nomura
  2016-05-24 10:23 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Nomura @ 2016-04-29 16:32 UTC (permalink / raw)
  To: cygwin; +Cc: Taylor Hutt

Hi,

We occasionally see an api_fatal abort during process startup like:

*** fatal error - add_item ("somepath", "/", ...) failed, errno 1

This happens if mountinfo.init(false) in user_info::initialize is
called twice.  The error occurs on a second call when trying to add
the root mount point when it already exists.

mountinfo.init is guarded by a "spinlock" object that should only
allow one process to call it.  But the spinlock has a timeout.  After
15 seconds, it stops waiting and returns a value of 0.  The fatal
error can occur if two processes are starting around the same time
and the first process takes a long time in internal_getpwsid().  We've
seen this happen in our environment due to LDAP queries taking a long
time.  (Incidentally we are using msys, but code in spinlock.h and
shared.cc looks the same in cygwin).

To solve the aborts it is tempting to make a local fix to remove the
spinlock timeout.  I assume there was a rationale for it, and would
like to understand what tradeoff is incurred if we remove it.

- Kevin


--
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] 2+ messages in thread

end of thread, other threads:[~2016-05-24 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29 16:32 spinlock.h timeout causing *** fatal error - add_item abort Kevin Nomura
2016-05-24 10:23 ` Corinna Vinschen

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).