[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] gawk 4.1 windows: application crash while dumping SYMTAB
From: |
Aharon Robbins |
Subject: |
Re: [bug-gawk] gawk 4.1 windows: application crash while dumping SYMTAB array |
Date: |
Mon, 27 May 2013 21:00:18 +0300 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Hello. Thanks for the bug report.
> Date: Mon, 27 May 2013 19:06:53 +0300
> From: Denis Shirokov <address@hidden>
> To: bug-gawk <address@hidden>
> Subject: [bug-gawk] gawk 4.1 windows: application crash while dumping SYMTAB
> array
>
> Hi Aharon, Eli,
>
> Here is my gawk crash report that i was saying few days ago. Sorry
> this is not simpliest example, may be later i will send you more
> simply example.
>
> Reproducible in Win7x64SP1 and Win2008R2SP1. Other systems i was not tested.
>
> The attached file _main.gwk contains program that doing dump of the
> array FUNCTAB - and it is successed, and then while dumping SYMTAB -
> it is crashing.
>
> Also i attach archive report.piz with the gawk that i was used. This
> is normal ZIP-archive that i was renamed due to mail-engine is not
> allowing to send through email executable files, and also inside the
> archives.
>
> Hope this will help You.
>
> best Regards
This script crashes on GNU/Linux also. It is likely the same crash that
you're seeing on Windows although Eli will have to confirm that.
The following patch fixes it. I believe it is a safe fix.
Arnold
-----------------------------------
diff --git a/array.c b/array.c
index 5dac7a4..92a1cb8 100644
--- a/array.c
+++ b/array.c
@@ -113,7 +113,16 @@ null_array(NODE *symbol)
symbol->table_size = symbol->array_size = 0;
symbol->array_capacity = 0;
symbol->flags = 0;
- assert(symbol->xarray == NULL);
+ /*
+ * 5/2013: This used to be
+ *
+ * assert(symbol->xarray == NULL);
+ *
+ * But that seems to cause problems for no good reason
+ * that I can see. I believe it to be an artifact of the
+ * union getting in the way.
+ */
+ symbol->xarray = NULL;
/* vname, parent_array not (re)initialized */
}