From owner-freebsd-stable Sun Apr 9 23:29:28 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.hcisp.net (Stargate.hcisp.net [208.60.89.18]) by hub.freebsd.org (Postfix) with SMTP id 74E4337B5B2 for ; Sun, 9 Apr 2000 23:29:10 -0700 (PDT) (envelope-from tim@mysql.com) Received: (qmail 27756 invoked from network); 10 Apr 2000 06:37:37 -0000 Received: from modem6.hcisp.net (HELO threads.polyesthetic.msg) (208.60.89.72) by stargate.hcisp.net with SMTP; 10 Apr 2000 06:37:37 -0000 Received: (qmail 13921 invoked by uid 1001); 10 Apr 2000 06:28:51 -0000 From: "Thimble Smith" Date: Mon, 10 Apr 2000 02:28:51 -0400 To: freebsd-stable@freebsd.org Subject: weirdness w/ gdb (and others) and home directory Message-ID: <20000410022851.B8117@threads.polyesthetic.msg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi. I'm seeing some "weird" stuff with my 4.0-STABLE box. The symptom is: tim:/tmp$ gdb /bin/pwd GNU gdb 4.18 [License] This GDB was configured as "i386-unknown-freebsd"... (no debugging symbols found)... (gdb) run Starting program: /bin/pwd warning: shared library handler failed to enable breakpoint /usr/home/tim Program exited normally. (gdb) It prints "/usr/home/tim", even though I was in "/tmp" when I ran it. It's not gdb, I'm quite sure. A 3.4-STABLE box doesn't do this. I started trying to figure this out because I was trying to use cook (/usr/ports/devel/cook), and any recipe that redirected output to a file would put that file in my home directory, no matter where I ran cook from. For example, when I run the following script I get: tim:/usr/tmp/junk$ sh thetest.sh /* Howto.list, /tmp/cook-test, Mon Apr 10 02:03 2000 */ cook: pwd > junk cook: ln -s /tmp/cook-test not-junk 1c1 < total 8 --- > total 9 6a7 > -rw-r--r-- 1 tim tim 10 Apr 10 02:03 junk /home/tim lrwxr-xr-x 1 tim wheel 14 Apr 10 02:03 /tmp/cook-test/not-junk -> /tmp/cook-test Here's the script: #! /bin/sh test -e /tmp/cook-test && rm -rf /tmp/cook-test mkdir /tmp/cook-test || exit 2 cd /tmp/cook-test || exit 2 cat < Howto.cook all: junk not-junk ; /* this will create a file in my home directory! */ junk: { pwd > junk; } /* this does what I want it to - put a symlink in the current dir */ not-junk: { ln -s `pwd` not-junk; } EOF /bin/ls -l $HOME > before cook /bin/ls -l $HOME > after diff before after cat $HOME/junk ls -l /tmp/cook-test/not-junk exit 0 I don't know what these two things have in common. Make can redirect output just fine. The shell does just fine, too. I'm trying to run through the source code for cook to see exactly what it does, but I haven't traced the problem yet. I don't even know where to start with looking at gdb's code. tim:/home/tim$ uname -a FreeBSD threads.polyesthetic.msg 4.0-STABLE FreeBSD 4.0-STABLE #3: Tue Mar 21 02:31:14 EST 2000 root@threads.polyesthetic.msg:/usr/src/sys/compile/THREADS i386 I'm wondering, is anyone else seeing this? Can anyone give me a hint about where I should be looking to track this down? I haven't seen any mention of it in -stable, -current or -bugs. If you're not seeing this, I'd appreciate your letting me know that, too, so I can narrow down the number of things I have to look at. Thanks a lot, Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message