[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Memory corruption after asort() in gawk 4.1.0 on Solaris
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] Memory corruption after asort() in gawk 4.1.0 on Solaris 10 |
Date: |
Tue, 06 Aug 2013 21:01:52 -0700 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Hi.
Andy's questions are all on target. I agree there should be no
difference between the two statements.
Please let us know more details.
Thanks,
Arnold
> Date: Tue, 6 Aug 2013 14:28:55 -0400
> From: "Andrew J. Schorr" <address@hidden>
> To: Joakim ?stlund XO <address@hidden>
> Cc: "address@hidden" <address@hidden>
> Subject: Re: [bug-gawk] Memory corruption after asort() in gawk 4.1.0 on
> Solaris 10
>
> Hi,
>
> On Tue, Aug 06, 2013 at 07:55:43AM +0000, Joakim ?stlund XO wrote:
> > After some experimentation, we managed to narrow the issue down to line 919
> > of array.c:
> >
> > *array = *result; /* copy result into array */
> >
> > If this line is replaced with "memcpy(array, result, sizeof(NODE));", the
> > problem disappears.
> > I have looked at the source for gawk 4.0.1, and this part of the code is
> > identical, but I also noticed that the implementation of freenode() has
> > been changed, which might be the root cause here.
>
> Perhaps I am being idiotic, but it appears to me that those statements should
> do the same thing. The only reasons I can imagine for an error when using the
> direct assignment vs memcpy are an alignment problem, or a compiler bug. Are
> you using gcc on Solaris? Is it the same version that works OK on Linux? Do
> you have the same problem if you disable all compiler optimizations?
>
> Regards,
> Andy