[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with gawk CONVFMT
From: |
Davide Brini |
Subject: |
Re: problem with gawk CONVFMT |
Date: |
Tue, 22 Mar 2011 12:27:41 +0000 |
User-agent: |
KMail/1.13.5 (Linux/2.6.36-gentoo-r5; KDE/4.4.5; x86_64; ; ) |
On Tuesday 08 Mar 2011 15:52:27 Alain NOULLEZ wrote:
> I have got a strange bug (crash) when converting a variable inside a loop
> modifying at the same time CONVFMT.
> The strange thing is that it seems converting a real variable to a string
> can cause a modification of the variable itself, against all expectations.
> The minimal program causing the crash is included. As such, it crashes
> with the message "fatal error: internal error" (or segfaults on some
> machines).
> If the line s = x "" is commented, and the line containing the gensub is
> uncommented, the program goes into an infinite loop. Also, if the
> initialization
> of CONVFMT is uncommented, the program crashes in some cases, but not
> always ?!?.
> For information, gawk's version is 3.1.8
> and my system 'uname -a' is
> Linux ### 2.6.34.7-66.fc13.i686.PAE #1 SMP Wed Dec 15 07:21:49 UTC
> 2010 i686 i686 i386 GNU/Linux
I can't help much but I can confirm that I see the same with gawk 3.1.6 under
Linux 64 bit. If the "print x" line is changed to "print s", then the program
does not crash.
According to gdb:
Starting program: /tmp/gawk-3.1.6/gawk -f ./crash.awk
0.5
0.6
Program received signal SIGBUS, Bus error.
0x000000000042c506 in r_dupnode (n=0x661360) at node.c:276
276 getnode(r);
(gdb) bt
#0 0x000000000042c506 in r_dupnode (n=0x661360) at node.c:276
#1 0x0000000000440d86 in r_tree_eval (tree=0x660460, iscond=1) at eval.c:1233
#2 0x00000000004413b9 in eval_condition (tree=0x660460) at eval.c:1356
#3 0x000000000043ec81 in interpret (tree=0x6612e0) at eval.c:640
#4 0x000000000043e496 in interpret (tree=0x6602e0) at eval.c:456
#5 0x000000000042b53a in main (argc=3, argv=0x7fffffffddd8) at main.c:616
--
D.