From owner-freebsd-current@FreeBSD.ORG Mon Oct 11 13:17:20 2010 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B06F21065679; Mon, 11 Oct 2010 13:17:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 49F248FC17; Mon, 11 Oct 2010 13:17:20 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 6B9F62A28D2D; Mon, 11 Oct 2010 15:17:19 +0200 (CEST) Date: Mon, 11 Oct 2010 15:17:19 +0200 From: Ed Schouten To: delphij@FreeBSD.org, current@FreeBSD.org Message-ID: <20101011131719.GA90530@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: truss calls setpgid() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 13:17:20 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, I've been seeing this bug for a very long time, but I was too lazy to figure out the root cause earlier. It is TTY related, but in this case the TTY layer is not to blame. It does things correctly. When you run a command in truss which calls ioctls on TTYs, it just locks up. This is because truss runs jobs in a separate process group. This also means you cannot send signals to it: truss sleep 10000 Pressing ^C here won't work. I've fixed it locally like this: Index: usr.bin/truss/setup.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- usr.bin/truss/setup.c (revision 213113) +++ usr.bin/truss/setup.c (working copy) @@ -78,7 +78,6 @@ } if (pid =3D=3D 0) { /* Child */ ptrace(PT_TRACE_ME, 0, 0, 0); - setpgid (0, 0);=20 execvp(command[0], command); err(1, "execvp %s", command[0]); Question: was this intentional? I'd rather not break stuff. Greetings, --=20 Ed Schouten WWW: http://80386.nl/ --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkyzDl8ACgkQ52SDGA2eCwXUlwCdGaKtxCJecJfxRbJSSpLsXHSm TJUAn1QwBeKzcpgAdX7p9nMH4+hmTgZO =UZAB -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--