First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 104286
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo's Team for Core System packages <base-system@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: peteru <gentoo.bugzilla@peteru.dnsalias.net>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 104286 depends on: Show dependency tree
Show dependency graph
Bug 104286 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-08-30 11:19 0000
generic/000_all_coreutils-i18n.patch in coreutils-5.3.0 breaks expand in such a
way that expand does not work properly when LANG="C" and it encounters a blank line.

Simple test:

$ echo | LANG="en_AU.UTF-8" expand

$ echo | LANG="C" expand
expand: input line is too long

This is caused by the following part of the patch:

@@ -352,7 +372,8 @@ expand (void)
                }
              else
                {
-                 column++;
+                 if (!ISCNTRL (c))
+                   column++;
                  if (!column)
                    error (EXIT_FAILURE, 0, _("input line is too long"));
                }

Furthermore, this failure is masked by generic/009_all_coreutils-tests.patch
which explicitly disables expand test and comments on the fact that it fails in
this manner.

This makes the expand command almost completely useless and can cause nasty
failures. For example, glibc build failure.


Reproducible: Always
Steps to Reproduce:

------- Comment #1 From peteru 2005-08-30 11:57:40 0000 -------
This patch appears to fix the problem.

Rather than relying on integer overflow to indicate that a line is too long,
this code checks that column index has not reached the maximum signed value of
the variable. I decided to use the signed limit as opposed to unsigned limit
(the variable itself is unsigned) because the number is sufficiently large
enough and there is no risk of sign errors due to inadvertent casts.

diff -u expand.c expand.c~
--- expand.c    2005-08-31 04:47:34.000000000 +1000
+++ expand.c~   2005-08-31 03:30:54.000000000 +1000
@@ -374,7 +374,7 @@
                {
                  if (!ISCNTRL (c))
                    column++;
-                 if (!column)
+                 if (column >= INTMAX_MAX)
                    error (EXIT_FAILURE, 0, _("input line is too long"));
                }


------- Comment #2 From SpanKY 2005-08-30 16:31:56 0000 -------
or better yet, use the coreutils define UINTMAX_MAX

------- Comment #3 From SpanKY 2005-08-30 16:53:14 0000 -------
fixed in coreutils-5.3.0-r1, thanks

First Last Prev Next    No search results available      Search page      Enter new bug