From owner-freebsd-threads@FreeBSD.ORG Thu Aug 3 20:08:25 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1648216A4DA; Thu, 3 Aug 2006 20:08:25 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBE8443D82; Thu, 3 Aug 2006 20:08:24 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 55932170C5; Thu, 3 Aug 2006 20:08:21 +0000 (UTC) To: Daniel Eischen From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 03 Aug 2006 16:04:49 -0400." Date: Thu, 03 Aug 2006 20:08:20 +0000 Message-ID: <50596.1154635700@critter.freebsd.dk> Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/101323: fork(2) in threaded programs broken. X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 20:08:25 -0000 In message , Daniel Eischen wr ites: >There's no easy way to hold all library locks. They are >littered in libc and libpthread and the application doesn't >have access to them. You would have to teach libc to >record these locks and export a function to lib >to lock and unlock these them. I would be perfectly happy if libpthread would just at the very least release the locks it specifically grabs for the fork. There's a big difference between giving it a sensible shot and downright sabotaging it the way we do currently. Anyway, apart from the view from the theoretical high ground and the fact that POSIX doesn't actually say anything helpful here, are there any objections to the fix I proposed ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.