bug-gnu-utils
[Top][All Lists]
Advanced

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

Segfault on function crashing argument


From: Seb
Subject: Segfault on function crashing argument
Date: Tue, 16 Feb 2010 19:55:04 +0100

Hello,

I've encountered a weird behaviour with gawk (3.1.7) which looks like a bug very
much. I search the ML archives but I found nothing relative, so I post a report;
apologies if this has already been discussed/fixed. :)

It appears when a function exiting the program is passed to another one. There
is no problem if the mother function has exactly the amount of arguments its
"prototype" has declared and if the child exiting function is the last one of
them. All the other cases draw to an internal error.

I join a little script which shows the bug with three tests. Here are the
results I get (the number as argument requests the matching test):

$ awk -f debug.awk 1
 true(1, 1, crash()) => crash properly.

$ awk -f debug.awk 2
 true(1, crash(), 1) => do not crash properly.
 awk: /tmp/debug.awk:5: fatal error: internal error: segfault
 Abandon

$ awk -f debug.awk 3
 true(1, crash()) => do not crash properly.
 awk: /tmp/debug.awk:5: fatal error: internal error: segfault
 Abandon

otawk (one true awk) and mawk complain about none of these tests, it's really a
gawk-specific behaviour.

++
Seb.

Attachment: debug.awk
Description: Binary data


reply via email to

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