buggrep - Bugs: bug #29188, Collating symbols and equivalence...

 
 

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

bug #29188: Collating symbols and equivalence classes incorrectly parsed if !MBS_SUPPORT

Submitter:  Ben Byer <bbyer>
Submitted:  Thu 11 Mar 2010 09:02:46 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

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

This item has been reassigned from the project grep patch tracker to your tracker.

The original report is still available at patch #5115

Following are the information included in the original report:

[field #0]                  Item ID: 5115
[field #1]                 Group ID: 67
[field #2]              Open/Closed: Open
[field #3]                 Severity: 3 - Normal
[field #4]                  Privacy: Public
[field #9]                 Category: None
[field #10]             Submitted by: bbyer
[field #11]              Assigned to: None
[field #12]             Submitted on: Sat 20 May 2006 06:27:10 PM CEST
[field #13]                  Summary: Collating symbols and equivalence classes incorrectly parsed if !MBS_SUPPORT
[field #14]      Original Submission: From http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03_05

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 from ""

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.

[field #16]               Item Group: None
[field #17]                   Status: None
[field #18]        Component Version: None
[field #19]         Operating System: None
[field #20]          Reproducibility: None
[field #21]               Size (loc): None
[field #22]            Fixed Release: None
[field #23]          Planned Release: None
[field #24]                   Effort: 0.00
[field #28]                 Priority: 5 - Normal
[field #31]         Percent Complete: 0%
[field #33]                  Release: None
[field #58]     Custom Select Box #1: None
[field #59]     Custom Select Box #2: None
[field #60]     Custom Select Box #3: None
[field #61]     Custom Select Box #4: None
[field #62]     Custom Select Box #5: None
[field #63]     Custom Select Box #6: None
[field #64]     Custom Select Box #7: None
[field #65]     Custom Select Box #8: None
[field #66]     Custom Select Box #9: None
[field #67]    Custom Select Box #10: None

Paolo Bonzini <bonzini>
Thu 11 Mar 2010 09:02:46 AM UTC, 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 01 Jun 2006 01:56:54 PM UTC, 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]
abc


$ LC_ALL=C gdb src/grep
Using host libthread_db library "/lib/libthread_db.so.1".
(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
(gdb)

Benno Schulenberg <bens>
Thu 01 Jun 2006 12:41:12 AM UTC, comment #2: 

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

Ben Byer <bbyer>
Thu 25 May 2006 09:38:53 PM UTC, 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>
Thu 11 Mar 2010 09:02:46 AM UTC, original submission:  

From http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_03_05

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>

 

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

Attached Files
file #10097:  dfa.patch.v2 added by bbyer (3KiB - application/octet-stream - a patch rewritten to use portable functions)
file #10015:  dfa.patch added by bbyer (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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
    2010-03-11 bonzini Reassign itemgrep, patch #5115 grep, bug #29188

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code