From nobody@FreeBSD.org  Sat Aug  7 15:08:02 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 925C9106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  7 Aug 2010 15:08:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 814C28FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  7 Aug 2010 15:08:02 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o77F82mv077288
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 7 Aug 2010 15:08:02 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o77F82Lb077287;
	Sat, 7 Aug 2010 15:08:02 GMT
	(envelope-from nobody)
Message-Id: <201008071508.o77F82Lb077287@www.freebsd.org>
Date: Sat, 7 Aug 2010 15:08:02 GMT
From: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: truss hangs when user input is requested
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         149403
>Category:       bin
>Synopsis:       [patch] truss(1) hangs when user input is requested
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ed
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 07 15:10:04 UTC 2010
>Closed-Date:    Mon Nov 07 12:15:30 CET 2011
>Last-Modified:  Mon Nov 07 12:15:30 CET 2011
>Originator:     Marcin Wisnicki
>Release:        8.1-PRERELEASE
>Organization:
>Environment:
FreeBSD ghost.pnet.one.pl 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #4: Wed Jul 14 21:47:49 CEST 2010     root@ghost.pnet.one.pl:/home/obj/usr/src/sys/SERWER_DDB  i386
>Description:
When monitored program requests user input, truss hangs. Only way to recover is to kill it with SIGKILL. Problem occurs regardless of '-S', '-o' or '-c' flags.
>How-To-Repeat:
# this one is ok
% truss read abc < /dev/null
..
__getcwd("/home/marcin",256)                     = 0 (0x0)
read(10,"#!/bin/sh\n# $FreeBSD: src/usr.b"...,1023) = 161 (0xa1)
read(0,0xbfbfe84b,1)                             = 0 (0x0)
read(10,0x8065e20,1023)                          = 0 (0x0)
process exit, rval = 1

# this one is not
% truss read abc
__getcwd("/home/marcin",256)                     = 0 (0x0)
read(10,"#!/bin/sh\n# $FreeBSD: src/usr.b"...,1023) = 161 (0xa1)
SIGNAL 21 (SIGTTIN)
# ^T
load: 0.18  cmd: truss 11847 [wait] 1.40r 0.06u 0.04s 0% 1176k

>Fix:


>Release-Note:
>Audit-Trail:

From: Ilya Bakulin <webmaster@kibab.com>
To: bug-followup@FreeBSD.org, mwisnicki+freebsd@gmail.com
Cc:  
Subject: Re: bin/149403: truss(1) hangs when user input is requested
Date: Thu, 14 Oct 2010 00:02:25 +0400

 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMQ0KDQpTZWVtcyB0
 aGF0IHRydXNzKDEpIGlzIG5vdCBzdXBwb3NlZCB0byB0cmFuc2ZlciBhbnkgY29udHJvbCB0byB0
 aGUgdHJhY2VkIHByb2dyYW0gKGp1ZGdpbmcgYnkgc291cmNlDQpjb2RlKSwgc28gdGhpcyBpcyBu
 b3QgYSBidWcuDQoNCi0gLS0gDQpSZWdhcmRzLA0KSWx5YSBCYWt1bGluDQpodHRwOi8va2liYWIu
 Y29tDQp4bXBwOi8va2liYWI2MTJAamFiYmVyLnJ1DQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUt
 LS0tLQ0KVmVyc2lvbjogR251UEcgdjIuMC4xNSAoRnJlZUJTRCkNCg0KaUVZRUFSRUNBQVlGQWt5
 MkVGY0FDZ2tRbzl2bGoxb2Fkd2dWMUFDZlZib1dCNjZQcGxmc01HOUlZU1lla2txZw0KRnF3QW13
 VFFDdmRDRG0wR0dpUDMzckFFcXpBWnZYNTMNCj1xUnhTDQotLS0tLUVORCBQR1AgU0lHTkFUVVJF
 LS0tLS0NCg==

From: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To: Ilya Bakulin <webmaster@kibab.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/149403: truss(1) hangs when user input is requested
Date: Wed, 13 Oct 2010 22:35:36 +0200

 On Wed, Oct 13, 2010 at 22:02, Ilya Bakulin <webmaster@kibab.com> wrote:
 > -----BEGIN PGP SIGNED MESSAGE-----
 > Hash: SHA1
 >
 > Seems that truss(1) is not supposed to transfer any control to the traced program (judging by source
 > code), so this is not a bug.
 >
 
 Code does not matter. User wants to trace a program, uses truss to do
 it and it doesn't work.
 A bug from user's perspective. Especially when it works on other
 operating systems.
 
 If fixing it is hard and no one is willing to do it any time soon,
 then truss(1) should have a note in BUGS section documenting this and
 other long-time known deficiencies (like broken -f option).
 
 > - --
 > Regards,
 > Ilya Bakulin
 > http://kibab.com
 > xmpp://kibab612@jabber.ru
 > -----BEGIN PGP SIGNATURE-----
 > Version: GnuPG v2.0.15 (FreeBSD)
 >
 > iEYEARECAAYFAky2EFcACgkQo9vlj1oadwgV1ACfVboWB66PplfsMG9IYSYekkqg
 > FqwAmwTQCvdCDm0GGiP33rAEqzAZvX53
 > =qRxS
 > -----END PGP SIGNATURE-----
 >

From: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
To: Ilya Bakulin <webmaster@kibab.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/149403: truss(1) hangs when user input is requested
Date: Fri, 15 Oct 2010 02:19:03 +0200

 Patch from this thread helps:
 http://docs.freebsd.org/cgi/mid.cgi?20101011131719.GA90530
Responsible-Changed-From-To: freebsd-bugs->ed 
Responsible-Changed-By: ed 
Responsible-Changed-When: Wed Oct 20 18:49:27 UTC 2010 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=149403 
State-Changed-From-To: open->patched 
State-Changed-By: ed 
State-Changed-When: Wed Oct 20 18:49:43 UTC 2010 
State-Changed-Why:  
Fixed in r214105. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149403 
State-Changed-From-To: patched->closed 
State-Changed-By: ed 
State-Changed-When: Mon Nov 7 12:15:29 CET 2011 
State-Changed-Why:  
Close this stale PR. It has been merged back properly. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=149403 
>Unformatted:
