Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 1995 10:43:04 +1000 (EST)
From:      raoul@cssc-syd.tansu.com.au (Raoul Golan)
To:        freebsd-questions@freebsd.org
Subject:   gdb problem?  libraries, perhaps?
Message-ID:  <199510040043.KAA19560@kiwi.cssc-syd.tansu.com.au>

next in thread | raw e-mail | index | archive | help

G'day people,

I have a strange problem with my 2.0.5 CD.

I have the following simple program (mytest.c):

main()
{
        int     a;
	a = a * 2;
}

I have the CD live filesystem (CD 2) mounted on /cdrom.

I do the following:

raoul@pogo[36]: /cdrom/usr/bin/gcc -g mytest.c

raoul@pogo[36]: /cdrom/usr/bin/gdb a.out
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.13 (i386-unknown-freebsd), 
Copyright 1994 Free Software Foundation, Inc...
(gdb) run
Starting program: /usr/home/raoul/test/a.out 
Error accessing memory address 0x6d7884: Invalid argument.
(gdb) quit

And this happens for whatever program I try to compile.  It happens
with my real gdb and gcc as well, I've just used the CDROM 
versions to demonstrate that they're identical.  It happens
regardless of whether I'm in X, or whether I'm on a text console,
whether I've got a few processes running or loads of them (so
chances are it's not a memory problem).

It always gives the same message.  I have an identical /usr/lib to
that in /cdrom/usr/lib.  I tried compiling with "-static" and
when I run gdb, I type "run" and I get dropped into a subshell (!?!?!).  
I exit from this subshell, and I'm back in gdb, telling me that my 
program exited successfully (!?!?).

I have the 2.0 compatibility libraries installed as well, and I tried
compiling and debugging with the 2.0 versions of gcc and gdb.
Same problem.

I tried rebuilding gdb from the sources on the CD, but the problem
was still there with the new binary.  I then tried to rebuild gdb from 
standard distribution, but I couldn't get it to build for freebsd (it 
built for netbsd, but the gdb binary had problems with the format of 
the a.out binary).

I've never had memory problems before on this machine, and memory 
tests (such as the 2.0 FreeBSD boot memory test) have never indicated 
any problems.

I'm running a custom kernel, but I don't see obvious parameters
being reset which would result in this problem.  Is it likely to
be a kernel problem?  If so, what parameter/option should I be
looking at?

Any ideas?

Many thanks,

Raoul




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510040043.KAA19560>