This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Fw: Bug#180914: sed: Another .* crash
- From: Paolo Bonzini <paolo dot bonzini at polimi dot it>
- To: Isamu Hasegawa <isamu at yamato dot ibm dot com>, "Bonzini" <bonzini at gnu dot org>
- Cc: "Isamu Hasegawa" <isamu at yamato dot ibm dot com>, "Ulrich Drepper" <drepper at redhat dot com>, "Aharon Robbins" <arnold at skeeve dot com>, <libc-alpha at sources dot redhat dot com>
- Date: Wed, 19 Feb 2003 14:29:02 +0100
- Subject: Re: Fw: Bug#180914: sed: Another .* crash
- References: <001501c2d507$19f243b0$0cdd1d97@bonz> <000b01c2d692$6f845cf0$f7dc1d97@bonz> <uptpolc6b.wl@AMBER.yamato.ibm.com>
- Reply-to: bonzini at gnu dot org
> Then, regarding the bug of \'.* regex, I think your analysis is quite
> right. duplicate_node_closure fails to keep the constraint in this case.
Hmmm... are you sure? :-)
Thinking more about it, it looks like check_halt_node_context checks if the
constraint is satisfied for the *last* character (after the DFA has halted),
while the transition table includes the check for the constraint being
satisfied *before* a transition. Take \>.* instead of \'.* (both because it
works and because it makes sense): the DFA is the same as what I had posted
earlier, with the interesting part being
node 1 (. without constraints)
transition to 2
node 2 (* without constraints)
epsilon transition to 1
node 4 (* with \> constraint)
epsilon transition to 5
node 5 (. with \> constraint)
transition to 2
After we transit out of node 5, there is no longer the need to satisfy \> (for
"abc def", after the space does the transition to 2 we need to match
everything until the end, independent of the context). So the transition to
2 is not bogus!
The bug is that build_trtable that is incorrectly building the transition
table for . instead of \'. (while it is building the table for \>.
correctly).
Paolo