Subject: kern/33021: ktracing a script loses argv[0]
To: None <,,>
From: None <>
List: netbsd-bugs
Date: 03/07/2006 03:20:00
>Number:         33021
>Category:       kern
>Synopsis:       ktracing a script loses argv[0]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 07 03:20:00 +0000 2006
>Originator:     David A. Holland <>
>Release:        NetBSD 3.99.15 (-20060124)
   Harvard EECS
NetBSD flurgle 3.99.15 NetBSD 3.99.15 (FLURGLE) #6: Tue Jan 24 18:13:41 EST 2006  dholland@flurgle:/usr/src/sys/arch/i386/compile/FLURGLE i386
Architecture: i386
Machine: i386
	If you tell ktrace to record arguments (which it doesn't by
	default) and you trace a script, argv[0] gets lost.

	It's not immediately clear what's "right" in this case, but I
	think it's reasonable to expect to get either the arguments
	given to exec or the arguments ultimately shipped off to the

	ktrace -ta /bin/cat; kdump              ("/bin/cat")
	ktrace -ta /bin/cat /dev/null; kdump    ("/bin/cat" "/dev/null")
	ktrace -ta /usr/bin/true; kdump		()
	ktrace -ta /usr/bin/true foo; kdump	("foo")

	(true is a sh script.)

	I'll look at it when I have more time. :-|