buggrep - Bugs: bug #27031, grep -w Operates on word level and...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  Flemming Madsen <themadsens>
Submitted:  Wed 15 Jul 2009 07:41:43 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Fri 17 Jul 2009 01:17:42 AM UTC, comment #2: 

   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)

Norihirio Tanaka <noritnk>
Wed 15 Jul 2009 07:43:29 AM UTC, comment #1: 

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=
$>


Flemming Madsen <themadsens>
Wed 15 Jul 2009 07:41:43 AM UTC, original submission:  

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
$>

Flemming Madsen <themadsens>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by noritnk (Updated the item)
  • -email is unavailable- added by themadsens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-07-17 noritnk Attached File- Added grep-2.5.4.word_match.patch, #18426

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code