Re: [ng-spice] Segmentation violation on running scripts


To Bob Carragher <dancebob@mindspring.com>, ng-spice@ieee.ing.uniroma1.it
From "Mark C. Johnson" <mcjohnso@gte.net>
Date Thu, 11 Jan 2001 22:59:11 -0500
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <200101110812.AAA11901@mindspring.com>
Reply-To ng-spice@ieee.ing.uniroma1.it
Sender mcjohnso@verizon.net

Hi,

I have found a different problem that is nevertheless related to the segfault
problem described by Bob. Once the fault is cleared up by eliminating the call
to tfree(ss), I find that ngspice pays no attention whatsoever to the
simulator variables that I do set. I can set tolerances to ridiculously large
or small values or change iteration limits, but when I run the simulation
I observe no effect on things like the number of transient iterations reported
by the Rusage command. Has anyone else dealt with this?

thanks

Mark

Mark C. Johnson
mcjohnso@gte.net

Bob Carragher wrote:

> ------- Blind-Carbon-Copy
>
> From: bobthedancer@yahoo.com (Bob Carragher)
> Originator: bobthedancer@yahoo.com (Bob Carragher)
> To: ng-spice@ieee.ing.uniroma1.it
> Reply-To: bobthedancer@yahoo.com (Bob Carragher)
> Subject: Re: [ng-spice] Segmentation violation on running scripts
> In-reply-to: Message <CF654D964573D311A1CA0090278A36FF4CBD34@EDIN_EXM1
>
>              from ng-spice@ieee.ing.uniroma1.it
>              on Wed, 10 Jan 2001 11:05:47 +0000.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=iso-2022-jp
> Content-Transfer-Encoding: 7bit
> Date: Thu, 11 Jan 2001 00:12:00 -0800
> Sender: dancebob@contra
>
> Hello,
>
> I too have run into a segmentation fault similar to what Alan
> describes.  Perhaps it is the same one.  In file variable.c,
> function cp_setparse(), at roughly line 359, is a call to
> tfree(),
>
>         tfree(ss);/*DG: cp_unquote Memory leak*/
>
> This will eventually cause variable ss to be passed to free().
> It is at this point that a segmentation violation can occur.
>
> The call is located a few lines after a call to ft_numparse(),
>
>         td = ft_numparse(&ss, FALSE);
>
> If I understand that function correctly, it can update the
> value of variable ss.  Unfortunately, trying to free ss is
> what causes the segmentation violation.  A fix would be to
> keep a copy of the original value of ss before it is passed
> to ft_numparse(), then pass that location to tfree() instead
> of ss.  (That is the fix that I have applied to my local copy.)
>
> Is or will this fixed in a subsequent rework of NG Spice?
>
> Thanks!
>
>                                 Bob
>
> - ------------Included Message------------
> From:     "Gillespie, Alan" <Alan.Gillespie@analog.com>
> To:       "'ng-spice@ieee.ing.uniroma1.it'" <ng-spice@ieee.ing.uniroma1.it>
> Date:     Wed, 10 Jan 2001 11:05:47 -0000
> Subject:  RE: [ng-spice] Segmentation violation on running scripts
>
> Is this a different seg fault from the one that has been
> fixed since rework 13 ? As far as I remember, the file
> variable.c had some fixes to stop some memory leaks, but
> because of some side effects of other functions, it ended
> up freeing pointers which had been moved from their
> original malloced location.
>
> Cheers,
>
> Alan
> - ----------End Included Message----------
>
> ------- End of Blind-Carbon-Copy

--
Mark C. Johnson
mcjohnso@gte.net




Partial thread listing: