[bug #27031] grep -w Operates on word level and crashes for LANG != C

View: New views
3 Messages — Rating Filter:   Alert me  

[bug #27031] grep -w Operates on word level and crashes for LANG != C

by INVALID.NOREPLY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.gnu.org/bugs/?27031>

                 Summary: grep -w Operates on word level and crashes for LANG
!= C
                 Project: grep
            Submitted by: themadsens
            Submitted on: Wed 15 Jul 2009 07:41:43 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Using the -w option causes grep to select its output on word level rather
than causing the match engine to work on word level. Also it seems that
mathces in the fist line causes crashes. LANG=C fixes all this.

$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2'
the quick brown fox jumped over the lazy dog
line 2
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | grep -w
line
line$>
$>
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | grep -v
-w line
the quick brown fox jumped over the lazy dog
 2
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | grep -w
fox
fox$>
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | grep -v
-w fox
Segmentation fault
$>
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | LANG=C
grep -v -w fox
line 2
$> echo -e 'the quick brown fox jumped over the lazy dog\nline 2' | LANG=C
grep  -w fox
the quick brown fox jumped over the lazy dog
$>





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27031>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27031] grep -w Operates on word level and crashes for LANG != C

by INVALID.NOREPLY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #1, bug #27031 (project grep):

More info:

$> grep -V
GNU grep 2.5.4

Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$> locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=C
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
$>



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27031>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27031] grep -w Operates on word level and crashes for LANG != C

by INVALID.NOREPLY :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #27031 (project grep):

   This issue isn't reprodued on orginal grep-2.5.4.  But if included
BACKERF in a pattern, it may be reproduced.

   Thought The first argument `beg' of `prtext' expects beginning of
a line, `EGexecute' isn't likely to return it in not-exact word-matching.


(file #18426)
    _______________________________________________________

Additional Item Attachment:

File name: grep-2.5.4.word_match.patch    Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27031>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/