Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2008 21:22:04 +0200
From:      David Naylor <naylor.b.david@gmail.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: FreeBSD deadlock (with fork?)
Message-ID:  <200809182122.08221.naylor.b.david@gmail.com>
In-Reply-To: <48D2807A.1050106@elischer.org>
References:  <200809180631.47071.naylor.b.david@gmail.com> <48D2807A.1050106@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart7296846.maSOvWPULo
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Thursday 18 September 2008 18:23:22 you wrote:
> David Naylor wrote:
> > Hi,
> >
> > I have a program that spawns a lot of subprocesses (with pipes open) fr=
om
> > multiple threads.  The problem is the program often deadlocks, but not
> > consistently.  Sometimes the program can run over 5 times to competition
> > without incidence and yet othertimes it locks within a few seconds.
>
> you sent this to -current. Is it in -current? (we fixed something like
> this some months back in current and 7)

=2Dcurrent cvsuped about Tuesday. =20

> do your post-fork processes do an exec?  according to the spec they
> should.

Yes, they do.  See the other replies...

> if any of your threads other than the one that did the fork ho;ds any
> mutex at teh time of fork then your process will hang. If they hold a
> umtx (between processes) then everything will hang.

Yes, the system does make use of mutexes.  The forking thread never holds a=
=20
mutex but other threads could hold a mutex.  This would explain the problem=
=2E =20
Is there any way to get around it (i.e. make sure no mutexes are held when =
a=20
fork is called?)


--nextPart7296846.maSOvWPULo
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQBI0qpgUaaFgP9pFrIRAljRAJ4yB8YgGU5m4DcNCr0mt5GVX1mmuACfTPPo
phWECfLkfwuS8eaW/LqLsP8=
=1pKp
-----END PGP SIGNATURE-----

--nextPart7296846.maSOvWPULo--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809182122.08221.naylor.b.david>