[Top][All Lists]

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

Re: [bug-gawk] $0 reassignment corruption in 4.2

From: Andrew J. Schorr
Subject: Re: [bug-gawk] $0 reassignment corruption in 4.2
Date: Mon, 13 Nov 2017 16:24:44 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

I think this simple test case demonstrates the problem. The assertion
fails, at least:

bash-4.2$ cat /tmp/test.awk
function reassign(x, y) {
   $0 = x
   print y

   reassign("larry", $1)

bash-4.2$ echo hello | gawk -f /tmp/test.awk
debug $0: flags MALLOC|STRING|STRCUR stptr 0x2233530 stlen 5 string [larry] 
valref 3
debug $1: flags STRING|STRCUR|USER_INPUT stptr 0x2239710 stlen 5 string [hello] 
valref 2
gawk: field.c:357: purge_record: Assertion `(fields_arr[i]->flags & 0x0001) == 
0 ? fields_arr[i]->sub.val.sref == 1 : 1' failed.
Aborted (core dumped)

(I added those first 2 debug statements to field.c:purge_record.)

The test code is attached. I hope that fixing this may fix the big
mdlint test case. But I don't have a patch yet. Any takers?


Attachment: test.awk
Description: Text document

reply via email to

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