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

 
 

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

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

Submitted by:  Flemming Madsen <themadsens>
Submitted on:  Wed 15 Jul 2009 07:41:43 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned 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>

 

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Jul 2009 01:17:41 AM UTCnoritnkAttached File-=>Added grep-2.5.4.word_match.patch, #18426

    Back to the top


    Powered by Savane 3.1-cleanup