[Top][All Lists]

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

[bug-gawk] integer comparison/assignment bug

From: Noah Dean
Subject: [bug-gawk] integer comparison/assignment bug
Date: Fri, 30 Mar 2018 22:12:40 +0000

Good evening!  This is my first time submitting a bug report (for any program, 
not just gawk), so please forgive me if I leave out something obvious.  I use 
gawk almost every day, and I think it's a fantastic tool.  I would like to 
thank all of the maintainers and developers for their time and effort on this 

I've been able to reproduce a consistent bug that causes my gawk to abort.  
Attached are a MWE of a simple data file, simple script, and the dump from the 
crash.  The print command in the 'END' section is not reached.


Details on my systems (I reproduced the bug on two similarly configured 

64-bit Cygwin on Windows 7

$ gawk --version
GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)


A few observations as I was trying to narrow this down:

- It appears to only exist when the '-M' flag is enabled.  Without -M, the 
script runs successfully and produces the expected minimum result.
- The behavior is sensitive to seemingly unrelated details.  While adding 
additional print commands to better see what was going on, the crash stopped, 
although the script still could not successfully find the minimum.  (It prints 
blank for min)
- Forcing the $1 to integer via '+0' before assignment to the min variable also 
fixes the issue.


If there is any other information I can provide that would be helpful, please 
don't hesitate to let me know.


Noah Dean

The information contained in this message may contain privileged, and 
confidential information, and be protected from disclosure. If you are not the 
intended recipient, or an employee, or agent responsible for delivering this 
message to the intended recipient, you are hereby notified that reading, using, 
copying, disseminating or, distributing this communication is strictly 
prohibited. If you have received this communication in error, please notify us 
immediately by return e-mail or by calling 732-942-3999 and permanently delete 
the message and any attachments from your computer.

Attachment: debug.awk
Description: debug.awk

Attachment: gawk.exe.stackdump
Description: gawk.exe.stackdump

Attachment: data.txt
Description: data.txt

reply via email to

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