From nobody  Sun Aug 30 08:41:06 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id IAA01767;
          Sun, 30 Aug 1998 08:41:06 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199808301541.IAA01767@hub.freebsd.org>
Date: Sun, 30 Aug 1998 08:41:06 -0700 (PDT)
From: kkennawa@physics.adelaide.edu.au
To: freebsd-gnats-submit@freebsd.org
Subject: Running ldd on a script causes the script to execute
X-Send-Pr-Version: www-1.0

>Number:         7783
>Category:       bin
>Synopsis:       Running ldd on a script causes the script to execute
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jdp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 30 08:50:00 PDT 1998
>Closed-Date:    Sun Aug 30 11:31:12 PDT 1998
>Last-Modified:  Sun Aug 30 11:31:40 PDT 1998
>Originator:     Kris Kennaway
>Release:        3.0-CURRENT
>Organization:
>Environment:
FreeBSD morden.rebel.net.au 3.0-CURRENT FreeBSD 3.0-CURRENT #50: Sun Aug 30 22:28:42 CST 1998     kkenn@morden.rebel.net.au:/usr2/src/sys/compile/MORDEN  i386
>Description:
Running ldd on a shell script causes the script to be executed, leading
to unpredictable results if you're trying to gather data on the
libraries which shared binaries are linked against (for example,
/usr/src/tools/LibraryReport/LibraryReport.tcl), which fails upon
reaching one of the scripts in /usr/bin which does not return an error
goes into a loop.

This script worked when I last tried it earlier this year, so the behaviour
of ldd probably was introduced at some point since. If this is
intentional behaviour for ldd then the LibraryReport script is busted
and should be changed to e.g. check the type of the file it's
examining before it tries to run ldd on it.
>How-To-Repeat:
ldd /usr/bin/zmore

OR (if this is now deemed to be correct behaviour)

/usr/src/tools/LibraryReport/LibraryReport.tcl

which will fail at some point in /usr/bin when it hits one of the
scripts and tries to ldd it. This script doesnt return control back
to the executing process, so the tcl script hangs.
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: jdp 
State-Changed-When: Sun Aug 30 11:21:32 PDT 1998 
State-Changed-Why:  
I have a fix for this almost ready to commit. 


Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: jdp 
Responsible-Changed-When: Sun Aug 30 11:21:32 PDT 1998 
Responsible-Changed-Why:  
I am in a helpful mood this morning. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jdp 
State-Changed-When: Sun Aug 30 11:31:12 PDT 1998 
State-Changed-Why:  
Fixed in ldd.c revision 1.16. 
>Unformatted:
