Re: [ng-spice] fix for segfaults
On Thu, 27 Sep 2001, Hugo van der Merwe wrote:
> On Wed, Sep 26, 2001 at 08:05:12PM -0400, Jon Engelbert wrote:
> > Hugo,
> > I reported a fix for this a couple of months ago... however, I'm running
>on
> > Windows, not on Unix, so there may be other problems. Please let me know
>if
> > this fixes it for you.
> >
> > ifnewuid.c:
> > if ( (newname = (char *) malloc(strlen((char *) olduid) +
> > strlen(suffix) + 2)) == NULL)
>
> Thanks, I tried it, but am still getting segfaults. If I have time, I
> will investigate some more this weekend. (I didn't make clean before
> rebuilding, for one, but didn't have time for a full rebuild.)
I have access to two Linux machines where I tried to compile
ng-spice-rework-14pre3.tgz, one machine has more processor power and
memory which is useful for compilation with debugging information.
Both machines compiled the ngspice source where one machine has the patch
above, both compiled ngspice versions gave a segfault. I have compiled one
ngspice with debug information and tried if gdb would give me useful
information, I am not familiar with gdb and the information given was
useless to me. I need to look for more information about gdb so i am able
to use it better. I have the gdb output scribbled on a piece of paper and
it says this:
program received signal SIGSEGV; segmentation fault.
0x40482109 in_strol_internal() from /lib/libc.so.6
It might be useful for someone else.
> Date: Fri, 9 Feb 2001 14:34:16 +0100 (CET)
> From: Paolo Nenzi <pnenzi@ieee.ing.uniroma1.it>
> Subject: Re: [ng-spice-devel] variable.c is still fighting back :-)
> Pre3 will have this bug removed. I think that I'm not having these
> segfaults because I use the libgc (garbage collector library).
> Maybe the rework-14 will make this an option, so we can test the
> memory allocation errors.
From the above mail send by Paolo and from the NOTES, Paolo suggests to
use a garbage collector. I have installed this garbage collector on both
machines and got a working ngspice on one machine, I did not test it with
make check(??). The other machine fails when linking:
gcc -o .libs/ngspice ...<snip>...-lncurses -lgc -L/usr/X11R6/lib -lX11
-lXt -lXext -lXaw -lXmu -lSM -lICE -Wl,--rpath
-Wl,/usr/local/lib/ng-spice-rework
spice.o: In function `main':
spice.o(.text+0x7c3): undefined reference to `txfree'
collect2: ld returned 1 exit status
make[3]: *** [ngspice] Error 1
I have not solved this error.
Both Linux machines use libc-2.2.4.so and libgc.so.6.0.
Enjoy your debugging weekend,
Bas
--
Partial thread listing: