bug-gawk
[Top][All Lists]
Advanced

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

Re: double free error in gawk


From: Andrew J. Schorr
Subject: Re: double free error in gawk
Date: Wed, 1 Jul 2020 13:20:12 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

It seems to be GMP. Apparently something changed between
6.1.2 and 6.2.0 that impacts this. I still wonder whether there
is something happening on the gawk side to trigger this though,
but I haven't looked closely.

Regards,
Andy

On Wed, Jul 01, 2020 at 02:50:11AM -0600, arnold@skeeve.com wrote:
> Hi.
> 
> This is an interesting issue. It turns out to be a problem in either
> the MPFR or GMP libraries.  When I upgrade to the latest versions of
> those libraries, valgrind reports no problems.
> 
> $ cat t.awk 
> BEGIN {
>       $0 = "a0 b"
>       gsub(/0/, "", $1)
>       $2 == "b"
>       $0 = ""
> }
> $ valgrind --leak-check=full ./gawk -M -f t.awk 
> ==24719== Memcheck, a memory error detector
> ==24719== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==24719== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
> ==24719== Command: ./gawk -M -f t.awk
> ==24719== 
> ==24719== 
> ==24719== HEAP SUMMARY:
> ==24719==     in use at exit: 99,434 bytes in 1,143 blocks
> ==24719==   total heap usage: 1,262 allocs, 119 frees, 162,787 bytes allocated
> ==24719== 
> ==24719== LEAK SUMMARY:
> ==24719==    definitely lost: 0 bytes in 0 blocks
> ==24719==    indirectly lost: 0 bytes in 0 blocks
> ==24719==      possibly lost: 0 bytes in 0 blocks
> ==24719==    still reachable: 99,434 bytes in 1,143 blocks
> ==24719==         suppressed: 0 bytes in 0 blocks
> ==24719== Reachable blocks (those to which a pointer was found) are not shown.
> ==24719== To see them, rerun with: --leak-check=full --show-leak-kinds=all
> ==24719== 
> ==24719== For counts of detected and suppressed errors, rerun with: -v
> ==24719== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> 
> Hope this helps,
> 
> Arnold
> 
> "NIDE, Naoyuki" <nide@ics.nara-wu.ac.jp> wrote:
> 
> > Hello,
> > gawk causes a double free error with the -M option and a certain program.
> >
> > $ LC_ALL=C gawk -M 'BEGIN{$0 = "a0 b"; gsub(/0/, "", $1); $2 == "b"; $0 = 
> > ""}'
> > free(): double free detected in tcache 2
> > Aborted (core dumped)
> > $ LC_ALL=C gawk --version
> > GNU Awk 5.1.0, API: 3.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
> > Copyright (C) 1989, 1991-2020 Free Software Foundation.
> >
> > This program is free software; you can redistribute it and/or modify
> > it under the terms of the GNU General Public License as published by
> > the Free Software Foundation; either version 3 of the License, or
> > (at your option) any later version.
> >
> > This program is distributed in the hope that it will be useful,
> > but WITHOUT ANY WARRANTY; without even the implied warranty of
> > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > GNU General Public License for more details.
> >
> > You should have received a copy of the GNU General Public License
> > along with this program. If not, see http://www.gnu.org/licenses/.
> >
> > -- 
> > NIDE, Naoyuki
> > nide@ics.nara-wu.ac.jp



reply via email to

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