Skip Menu |

This queue is for tickets about the FLAT CPAN distribution.

Report information
The Basics
Id: 115718
Status: open
Priority: 0/
Queue: FLAT

People
Owner: Nobody in particular
Requestors: user42_kevin [...] yahoo.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: FLAT::DFA unset_starting() infinite recursion
Date: Wed, 29 Jun 2016 17:28:06 +1000
To: bug-FLAT [...] rt.cpan.org
From: Kevin Ryde <user42_kevin [...] yahoo.com.au>
In FLAT 0.9.1 on a debian i386 perl 5.22.1, a program #!/usr/bin/perl -w use strict; use FLAT; my $dfa = FLAT::Regex->new('a*')->as_dfa; print "reversing ...\n"; $dfa->reverse; recurses apparently infinitely until using all memory. When run with "perl -w" it warns Deep recursion on subroutine "FLAT::DFA::unset_starting" at /usr/share/perl5/FLAT/DFA.pm line 80. I struck the same attempting concat() of DFAs. (I saw the comment in that method about some known trouble there maybe.) Nosing around the code I saw the DFA ->as_nfa() method returns class FLAT::DFA, not FLAT::NFA. For reverse and concat I got some joy by re-blessing into FLAT::NFA for the operation then going back by ->as_dfa. But dunno if that's how it's meant to work.
On Wed Jun 29 03:28:27 2016, user42_kevin@yahoo.com.au wrote: Show quoted text
> In FLAT 0.9.1 on a debian i386 perl 5.22.1, a program > > #!/usr/bin/perl -w > use strict; > use FLAT; > my $dfa = FLAT::Regex->new('a*')->as_dfa; > print "reversing ...\n"; > $dfa->reverse; > > recurses apparently infinitely until using all memory. When run with > "perl -w" it warns > > Deep recursion on subroutine "FLAT::DFA::unset_starting" at > /usr/share/perl5/FLAT/DFA.pm line 80. > > I struck the same attempting concat() of DFAs. > (I saw the comment in that method about some known trouble there maybe.) > > Nosing around the code I saw the DFA ->as_nfa() method returns class > FLAT::DFA, not FLAT::NFA. For reverse and concat I got some joy by > re-blessing into FLAT::NFA for the operation then going back by > ->as_dfa. But dunno if that's how it's meant to work.
Thanks again, I will take a look soon! Brett