patchgrep - Patches: patch #5115, Reassigned to another tracker...


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

patch #5115: Reassigned to another tracker [was: Collating symbols and equivalence classes incorrectly parsed if !MBS_SUPPORT]

Submitted by:  Ben Byer <bbyer>
Submitted on:  Sat May 20 16:27:10 2006  
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Closed

Thu Mar 11 09:02:46 2010, comment #5:


Please, do not post any new comments to this item.

Paolo Bonzini <bonzini>
Thu Mar 11 09:02:46 2010, comment #4:

[. .] and [= =] are currently not supported if !MBS_SUPPORT, but the patch is wrong because [[.ch.]] would become equivalent to [ch] rather than "ch".

I moved this to the bug tracker.

Paolo Bonzini <bonzini>
Thu Jun 1 13:56:54 2006, comment #3:

After applying the patch:

$ echo abc | LC_ALL=C src/grep [^[.a.]b]
Segmentation fault
$ echo abc | LC_ALL=nl_NL src/grep [^[.a.]b]
Segmentation fault
$ echo abc | LC_ALL=nl_NL.utf8 src/grep [^[.a.]b]

$ LC_ALL=C gdb src/grep
Using host libthread_db library "/lib/".
(gdb) run [^[.a.]b] abcfile
Starting program: /home/ben/Sources/grep/src/grep [^[.a.]b] abcfile

Program received signal SIGSEGV, Segmentation fault.
0x08050090 in setbit (b=12, c=0xbf917ce0) at dfa.c:277
277 c[b / INTBITS] |= 1 << b % INTBITS;
(gdb) back
#0 0x08050090 in setbit (b=12, c=0xbf917ce0) at dfa.c:277
#1 0x08051815 in lex () at dfa.c:1109
#2 0x08052cce in dfaparse (s=0x1000 <Address 0x1000 out of bounds>, len=4096,
d=0x805d3c0) at dfa.c:1487
#3 0x08056f9e in dfacomp (s=0x805e098 "[^[.a.]b]", len=9, d=0x805d3c0, searchflag=1)
at dfa.c:3085
#4 0x0804da44 in GEAcompile (pattern=0x805e098 "[^[.a.]b]", size=9, syntax_bits=2822)
at search.c:273
#5 0x0804dc41 in Gcompile (pattern=0x1000 <Address 0x1000 out of bounds>,
size=3213982944) at search.c:283
#6 0x0804c6be in main (argc=6, argv=0x805e078) at grep.c:2222

Benno Schulenberg <bens>
Thu Jun 1 00:41:12 2006, comment #2:

Sorry about that -- I rewrote the patch to the appropriate portable functions; does this work for you?

Ben Byer <bbyer>
Thu May 25 21:38:53 2006, comment #1:

Patch applies cleanly, but make fails here with:

dfa.o: In function `try_collating_thing':
/home/ben/Sources/grep-new/src/dfa.c:766: undefined reference to `strnstr'
/home/ben/Sources/grep-new/src/dfa.c:780: undefined reference to `strlcpy'

The command

$ echo abc | src/grep [^[.a.]b]

fails only in C and iso-8859 locales though, not in utf8 locales.

Benno Schulenberg <bens>
Sat May 20 16:27:10 2006, original submission:


A collating symbol is a collating element enclosed within bracket-period ( "[." and ".]" ) delimiters. Collating elements are defined as described in Collation Order . Conforming applications shall represent multi-character collating elements as collating symbols when it is necessary to distinguish them from a list of the individual characters that make up the multi-character collating element. For example, if the string "ch" is a collating element defined using the line:

collating-element <ch-digraph> from "<c><h>"

in the locale definition, the expression "[[.ch.]]" shall be treated as an RE containing the collating symbol 'ch' , while "[ch]" shall be treated as an RE matching 'c' or 'h' . Collating symbols are recognized only inside bracket expressions. If the string is not a collating element in the current locale, the expression is invalid.

Ben Byer <bbyer>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)

    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):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Mar 11 09:02:46 2010bonziniSummarygrep [^[.a.]b] fails with input abc=>Collating symbols and equivalence classes incorrectly parsed if !MBS_SUPPORT
      Reassign Itemgrep, patch #5115=>grep, bug #29188
    Thu Jun 1 00:41:12 2006bbyerAttached File-=>Added dfa.patch.v2, #10097
    Sat May 20 16:27:10 2006bbyerAttached File-=>Added dfa.patch, #10015

    Back to the top

    Powered by Savane 3.1-cleanup1