[Top][All Lists]

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

Re: memory corruption bug?

From: Norbert Nemec
Subject: Re: memory corruption bug?
Date: Thu, 8 Mar 2001 22:59:00 +0100
User-agent: Mutt/1.3.12i

On Wed, Mar 07, 2001 at 01:01:28PM -0500, Jean-Pierre Dussault wrote:
> > Have you tried to fiddly around with compiler options? The sacomp 
> > optimization
> > engine is somewhat buggy, so whenever you want to debug your code, you 
> > should
> > switch optimization off first and see whether the problem might dissolve by
> > itself.
> I did, I ran it with -chk and -debug (the standard debugging setup), no
> optimization at all, and got the same bug.

OK, that should be fine.

> > Also, once you've located the problem in the Sather source code, you might 
> > want
> > to take a look at the produced ANSI-C code. It is not very readable, but
> > commands are translated rather straightforward, so you should be able to
> > identify the lines created by that offending command.
> I just tried. The following Sather code seems at the origin of the problem:
>       --mapDir := arg.mapDir;
>       mapDir[0].copy(arg.mapDir[0]);   -- line 142
>       mapDir[1].copy(arg.mapDir[1]);   -- line 143

How is mapDir assigned before? As I assume, mapDir is of a normal class type, 
i.e. for the deepcopy variant a object has to be created before you can use [0] 
[1] on it. For the refcopy variant on the other hand, the that creation is not 

Therefore, by just swapping the comments in the above three lines, one of the 
two versions will be buggy, (depending on the context that is missing in this 

Apart from that, I cannot identify a problem in the code. If the above does not 
solve it, I do not believe I'll be able to help any further. The current 
implementation really has twists I cannot always follow...

> > Another hint: gcc2.95.2 has a bug in the optimization code as well. Do not 
> > use
> > -O2 on sather code. That bug seems fixed for 2.95.3 but I do not know about
> > 2.96
> I use "-O" because of that bug, and no, it's not fixed for 2.96.69 (I use the 
> distribution).

Good to know. Anyway - I'll just leave it to -O until 2.95.2 is ancient history 
and there is no risk someone still uses it. There's a proper comment now, that 
tells everybody, he can try -O2 instead.


-- ______________________________________________________
--          To Him, even that machine here has to obey...
-- _________________________________Norbert "Nobbi" Nemec
-- Hindenburgstr. 44  ...  D-91054 Erlangen  ...  Germany
-- eMail: <address@hidden>   Tel: +49-(0)-9131-204180

reply via email to

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