Opened 23 years ago

Closed 19 years ago

#303 closed defect (fixed)

gawk-3.1.5

Reported by: gerard@… Owned by: Matthew Burgess
Priority: normal Milestone:
Component: Book Version: SVN
Severity: normal Keywords:
Cc: iwanek@…

Description

Attachments (2)

gawk-3.1.2.patch (1.4 KB ) - added by iwanek@… 22 years ago.
updated patch for 3.1.2
gawk-3.1.3.patch (1.4 KB ) - added by a.fyfe@… 21 years ago.
Updated patch for 3.1.3

Download all attachments as: .zip

Change History (37)

comment:1 by gerard@…, 23 years ago

dependson: 30

comment:2 by gerard@…, 23 years ago

Resolution: fixed
Status: newclosed

comment:3 by gerard@…, 23 years ago

* Bug 211 has been marked as a duplicate of this bug. *

comment:4 by markh@…, 23 years ago

gawk install instructions work for me. closing.

comment:5 by gerard@…, 23 years ago

Resolution: fixed
Status: closedreopened
Summary: gawk-3.1.0gawk-3.1.1

comment:6 by gerard@…, 23 years ago

Cc: chthon@… added

* Bug 347 has been marked as a duplicate of this bug. *

comment:7 by gerard@…, 22 years ago

Owner: changed from lfs-book@… to gerard@…
Status: reopenedassigned

comment:8 by gerard@…, 22 years ago

Resolution: fixed
Status: assignedclosed

comment:9 by highos@…, 22 years ago

Resolution: fixed
Status: closedreopened
Summary: gawk-3.1.1gawk-3.1.2

Version increment (3.1.2)

by iwanek@…, 22 years ago

Attachment: gawk-3.1.2.patch added

updated patch for 3.1.2

comment:10 by gerard@…, 22 years ago

Priority: normalhighest

comment:11 by gerard@…, 22 years ago

Status: reopenedassigned

comment:12 by gerard@…, 22 years ago

Resolution: fixed
Status: assignedclosed

comment:13 by highos@…, 21 years ago

Resolution: fixed
Status: closedreopened
Summary: gawk-3.1.2gawk-3.1.3

Version increment (3.1.3)

by a.fyfe@…, 21 years ago

Attachment: gawk-3.1.3.patch added

Updated patch for 3.1.3

comment:14 by Matthew Burgess, 21 years ago

Also note that a problem was reported about gawk not handling zero sized files (e.g. those in the /proc filesystem) correctly and a patch posted on the lfs- dev list IIRC. This is no longer required as of version 3.1.3 (according to the ChangeLog entry under March 27 2003 at least).

Matt.

comment:15 by gerard@…, 21 years ago

Resolution: fixed
Status: reopenedclosed

comment:16 by gerard@…, 21 years ago

dependson: 30

comment:17 by tushar@…, 21 years ago

Resolution: fixed
Status: closedreopened

comment:18 by greg@…, 21 years ago

Resolution: fixed
Status: reopenedclosed

Discussion on lfs-dev reached conclusion to drop the current Gawk Libexecdir patch. Comiitted the changes. Closing.

comment:19 by Matthew Burgess, 20 years ago

Priority: highestnormal
Resolution: fixed
Status: closedreopened
Summary: gawk-3.1.3gawk-3.1.4
Version: CVSTESTING

Version increment (3.1.4)

comment:20 by jeremy@…, 20 years ago

Upgraded to 3.1.4 in unstable

comment:21 by Matthew Burgess, 20 years ago

Resolution: fixed
Status: reopenedclosed

comment:22 by Matthew Burgess, 19 years ago

Resolution: fixed
Status: closedreopened
Summary: gawk-3.1.4gawk-3.1.5
Version: TESTINGSVN

Version increment (3.1.5). Lots of multi-byte related fixes, along with a whole slew of other changes. NEWS has the gory details.

comment:23 by Matthew Burgess, 19 years ago

This appears to be the cause of a failure in gettext's testsuite:

SKIP: lang-java SKIP: lang-csharp 2c2 < 2 morceaux de gateau ---

2 pieces of cake

FAIL: lang-gawk

Can anyone confirm?

comment:24 by alexander@…, 19 years ago

Confirmed. Will investigate tomorrow.

comment:25 by Matthew Burgess, 19 years ago

Thanks. FYI, I've reported this upstream via bug-gnu-utils. I'll keep this bug posted as to any responses I receive.

comment:26 by alexander@…, 19 years ago

The quick fix (for gawk) is:

./configure --prefix=/usr --libexecdir=/usr/lib

cat >>config.h <<"EOF" #define HAVE_ISBLANK 1 #define HAVE_LANGINFO_CODESET 1 #define HAVE_LANGINFO_H 1 #define HAVE_LC_MESSAGES 1 EOF

make

make install

Upstream will update autofoo magic instead, but that's not a fix acceptable for LFS, since gawk is built before autofoo.

comment:27 by alexander@…, 19 years ago

One more gawk-3.1.5 regression has been reported to upstream by Karl Berry. Copy-and-paste from the list archive:

$ mkdir empty $ cd empty $ ls $ gawk 'END{}' \* * glibc detected * free(): invalid pointer: 0x080a15e0 * Aborted

Reproducible on LFS with gawk-3.1.5 as well. Not reproducible on UTF-8 Live CD which uses gawk-3.1.4 with a ton of patches.

comment:28 by alexander@…, 19 years ago

The second bug is fixed with (copy-and-paste from http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html):

--- ../gawk-3.1.5/io.c 2005-07-26 21:07:43.000000000 +0300 +++ io.c 2005-08-12 13:10:28.239852344 +0300 @@ -2480,9 +2480,12 @@

{

struct stat sbuf; struct open_hook *oh;

+ int iop_malloced = FALSE;

  • if (iop == NULL)

+ if (iop == NULL) {

emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");

+ iop_malloced = TRUE; + }

memset(iop, '\0', sizeof(IOBUF)); iop->flag = 0; iop->fd = fd;

@@ -2495,7 +2498,8 @@

}

if (iop->fd == INVALID_HANDLE) {

  • free(iop);

+ if (iop_malloced) + free(iop);

return NULL;

} if (isatty(iop->fd))

@@ -2503,7 +2507,7 @@

iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf); iop->sbuf = sbuf; if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)

  • lintwarn(_("data file `%s' is empty"), name);

+ lintwarn(_("data file `%s' is empty"), name);

errno = 0; iop->count = iop->scanoff = 0; emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");

comment:29 by gschafer@…, 19 years ago

(In reply to comment #17)

The quick fix (for gawk) is:

./configure --prefix=/usr --libexecdir=/usr/lib

cat >>config.h <<"EOF" #define HAVE_ISBLANK 1 #define HAVE_LANGINFO_CODESET 1 #define HAVE_LANGINFO_H 1 #define HAVE_LC_MESSAGES 1 EOF

Alexander, it doesn't necessarily follow that missing HAVE_* variables are automatic bugs IMHO. If you grepped the Gawk source code for those vars you'd see that some of those vars make no difference at all. In this case, only the HAVE_LC_MESSAGES var is needed to make the Gettext testsuite pass.

comment:30 by alexander@…, 19 years ago

I have to disagree here. HAVE_LANGINFO_CODESET is needed, because it selects a different code path in regcomp.c (falling back to manually parsing LC_* variables instead of using nl_langinfo(CODESET)). The difference leads to misdetection of character set in locales like fr_FR@euro. I will try to produce a testcase if you really want that.

As for the rest, additional reading is required in order to decide whether these macros are needed.

comment:31 by alexander@…, 19 years ago

Sorry for the last comment. While the code path without HAVE_LANGINFO_CODESET is suboptimal (and different from the intended one), it doesn't look like it can lead to a wrong result.

comment:32 by alexander@…, 19 years ago

Well, I was able to construct a semi-complete testcase for HAVE_LANGINFO_CODESET. To prove that it is needed, add some debugging output to regcomp.c:

sed -i.bak 's@dfa->is_utf8 = 1;@{dfa->is_utf8 = 1; fprintf(stderr, "UTF-8 locale detected
n");}@' regcomp.c

Then configure and make as usual:

./configure --prefix=/usr --libexecdir=/usr/lib

cat >>config.h <<"EOF" #define HAVE_LC_MESSAGES 1 EOF

make

Now the test:

LC_ALL=vi_VN ./gawk '' /dev/null

(vi_VN is a UTF-8 based locale with the name not ending in UTF-8). Without HAVE_LANGINFO_CODESET, gawk doesn't print the debugging message. With HAVE_LANGINFO_CODESET, the message is printed. What's left for a clean testcase is to find one more UTF-8 bug in dfa.c and try exploiting it in this locale.

Of course this comment is irrelevant if UTF-8 is not supported.

comment:33 by Matthew Burgess, 19 years ago

Owner: changed from gerard@… to Matthew Burgess
Status: reopenednew

comment:34 by Matthew Burgess, 19 years ago

Status: newassigned

comment:35 by Matthew Burgess, 19 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.