swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with -static and GDB


From: Benedikt Stefansson
Subject: Problems with -static and GDB
Date: Mon, 21 Apr 1997 20:44:08 -0700

Greetings,

I've been chasing a strange bug for 24 hrs and don't seem to be making
much headway. I hope someone can point me in the right direction with
regard to GDB and static linking of Swarm sims.

To be honest to me "debugging Swarm" until now has meant liberal uses of
printfs (a highly inefficient method to be sure). But since I can't seem
to isolate the source of this nasty error (sim crashes without any
apperent pattern) I need to be able to dig deeper with GDB.

Problem is that GDB only comes up with this:

Program received signal SIGSEGV, Segmentation fault.
0x400d566e in __libc_free ()
(gdb) bt
#0  0x400d566e in __libc_free ()
#1  0x81abc10 in ?? ()
#2  0xffffffff in ?? ()
Cannot access memory at address 0x31.

Which is not much of a help. Obviously I have poked around all
instances of free() in my program (there is exactly one), but the crash
is not coming from my part of the code.

So the only idea that I could come up with was that GDB needed all the
dynamically loaded stuff to be statically linked before he could be of
any help.

I have been trying to fool around with adding the -static flag to
Makefile.conf in EXTRALDFLAGS, but now the linker won't link the app any
more. When I use the -static flag I get the following error message:

ld: cannot open -lm: No such file or directory.

So my questions are: Does anybody have
a) Experience and suggestions with using GDB on Swarm (the docs are not
very clear on the subject)?
b) An answer to why the linker complains when I use the -static flag?

(I'm not compiling against the binary version, but the archive version
of Swarm).

Thanks,
-Benedikt

------------------
Benedikt Stefansson                 address@hidden
Center for Computable Economics     Tel. (310) 825-1777
Department of Economics, UCLA       Fax. (310) 825-9528
Los Angeles, CA 90095-1477          http://cce.sscnet.ucla.edu


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]