This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fw: Bug#180914: sed: Another .* crash


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]