From owner-freebsd-questions Wed Oct 4 18:02:27 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id SAA11763 for questions-outgoing; Wed, 4 Oct 1995 18:02:27 -0700 Received: from mail.telstra.com.au (mail.telstra.com.au [192.148.160.10]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id SAA11758 for ; Wed, 4 Oct 1995 18:02:22 -0700 Received: from mail_gw.fwall.telecom.com.au(192.148.147.10) by mail via smap (V1.3) id sma012051; Thu Oct 5 10:56:32 1995 Received: from cdn_mail.dn.itg.telecom.com.au(144.135.109.134) by mail_gw.telecom.com.au via smap (V1.3) id sma027099; Thu Oct 5 10:55:33 1995 Received: from rodin.cssc-syd.tansu.com.au (rodin.cssc-syd.tansu.com.au [149.135.252.15]) by cdn_mail.dn.itg.telecom.com.au (8.6.11/8.6.9) with ESMTP id KAA16592; Thu, 5 Oct 1995 10:55:33 +1000 Received: from crab.cssc-syd.tansu.com.au (crab.ind.tansu.com.au [149.135.100.23]) by rodin.cssc-syd.tansu.com.au (8.6.11/8.6.9) with ESMTP id KAA04682; Thu, 5 Oct 1995 10:55:32 +1000 Received: from kiwi.cssc-syd.tansu.com.au (raoul@kiwi.cssc-syd.tansu.com.au [149.135.104.48]) by crab.cssc-syd.tansu.com.au (8.6.9/8.6.9) with ESMTP id KAA13387; Thu, 5 Oct 1995 10:55:30 +1000 Received: (raoul@localhost) by kiwi.cssc-syd.tansu.com.au (8.6.9/8.6.9) id KAA26622; Thu, 5 Oct 1995 10:55:29 +1000 Message-Id: <199510050055.KAA26622@kiwi.cssc-syd.tansu.com.au> Subject: Re: gdb problem? libraries, perhaps? To: julian@ref.tfs.com (Julian Elischer) Date: Thu, 5 Oct 1995 10:55:29 +1000 (EST) Cc: freebsd-questions@freebsd.org In-Reply-To: <199510040448.VAA01034@ref.tfs.com> from "Julian Elischer" at Oct 3, 95 09:48:56 pm From: raoul@cssc-syd.tansu.com.au (Raoul Golan) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1691 Sender: owner-questions@freebsd.org Precedence: bulk Re: stupid problem whereby gdb crashes when run for any executable. > > Got /proc mounted? > Yes, I have. Thanks for your reply. I managed to track down the problem by following the gdb source code last night (kind of difficult seeing that I didn't have gdb to trace it with ! :-) The problem is that my login shell is /bin/csh. Since I'd rather use zsh instead, as the last line in my .cshrc I have "exec /usr/local/bin/zsh" to switch to zsh. I didn't bother to change my /etc/passwd entry with chpass, and I thought I wouldn't need to. Anyway, I traced it down to a ptrace syscall in the gdb source code. The arguments were correct (as far as I could tell), but the call was failing. The address referred to for the child process was supposedly non-existent (yet I knew that my test program could access that address without any problems). VERY strange. I put in a sleep in the gdb code in the right place, and examined the process table. The child process which I expect to be my test program was actually a zsh. VERY strange. I then looked at the code that does the fork in gdb. I saw that what is forked is not a new process running the test program, but a shell exec-ing the test program. The penny dropped. The test program was *not* what was being ptraced - a zsh was being ptraced instead. Anyway - this is a result of forking off a shell instead of a process running the test binary. I removed the "exec zsh" from .cshrc, and gdb worked like a charm. The "exec zsh" shouldn't really be in my .cshrc, but I figure that at least some warning should be given about this by gdb. It seems that it's not so much a FreeBSD problem than a gnu problem. Raoul