From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 26 22:27:17 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 420C01065693 for ; Fri, 26 Sep 2008 22:27:17 +0000 (UTC) (envelope-from xorquewasp@googlemail.com) Received: from ik-out-1112.google.com (ik-out-1112.google.com [66.249.90.182]) by mx1.freebsd.org (Postfix) with ESMTP id C93D78FC15 for ; Fri, 26 Sep 2008 22:27:16 +0000 (UTC) (envelope-from xorquewasp@googlemail.com) Received: by ik-out-1112.google.com with SMTP id c29so775330ika.3 for ; Fri, 26 Sep 2008 15:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition; bh=5srK7n5Ckj9tNNVNsCVzjatZL9rZWDGtb+6qdIZO5KE=; b=vUViyZZejrHO2GR/nDAly8XIyM8S5RhkRTbUL4XerjiMHuK7e+Xqfq5aBIZSGubP3j 766lEVx4fVJX8Uqf2luk3W/J6+W4rCb8PQ3KOsUyX6nRCa2hLfQ3SpAVoTyhLPHV/us+ JCialk3DJ7+idAlw+QbU8BtXM0tBxnXCJlrRk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition; b=uI1Lq78f7JO4Ak7WgjkydVAhDx6SPEPzrrVVLuT1w5OnAnj0slCnbEGDfFeo4TJb90 jnwocfBAhMegCc9Mssa7WdFKXZOB1oTUPb5EBQ8b9jWrjgoIVdttiylbapob5aR9qo23 AR0pb8L2RSYcfufWU8CHmFlkUpoX7UIfVgHds= Received: by 10.210.27.20 with SMTP id a20mr2161885eba.86.1222468035686; Fri, 26 Sep 2008 15:27:15 -0700 (PDT) Received: from logik.internal.network ( [81.86.41.187]) by mx.google.com with ESMTPS id 10sm4740350eyd.6.2008.09.26.15.27.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Sep 2008 15:27:14 -0700 (PDT) Received: by logik.internal.network (Postfix, from userid 11001) id B7A9360AA; Fri, 26 Sep 2008 22:27:11 +0000 (UTC) Date: Fri, 26 Sep 2008 23:27:11 +0100 From: xorquewasp@googlemail.com To: freebsd-hackers@freebsd.org Message-ID: <20080926222711.GA74003@logik.internal.network> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: popen() in multithreaded program - hangs? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 22:27:17 -0000 I'm trying to write a client for the jack audio connection kit (http://jackaudio.org), have hit an apparent bug and am not sure who's at fault. This is the client: -- #include #include jack_port_t *input_port; jack_port_t *output_port; jack_client_t *client; int main (void) { jack_status_t status; client = jack_client_open ("cdemo", JackNoStartServer, &status, "default"); if (!client) errx (112, "client_open: could not"); jack_client_close (client); return 0; } -- The jack_client_open() call never returns and the process can only be killed with SIGKILL. Tracing execution in gdb shows that the hang occurs in the popen() call in jack_get_tmpdir(), defined at client.c:114: http://trac.jackaudio.org/browser/trunk/jack/libjack/client.c Is there a known issue with calling popen() in a multithreaded program? At the point of that call, on my system, there are three running threads. Any help/advice on how to resolve this problem would be appreciated. xw