Summary for p5p: David Dyck has found that Inline::C refuses to make test
on currently bleadperl. It seems to lock up into an infinite CPU loop.
Repeating "make test" causes it all to work. I can recreate the loop:
On Thu, Feb 27, 2003 at 04:35:03PM +0000, Nicholas Clark wrote:
> On Thu, Feb 27, 2003 at 04:06:51PM +0000, Nicholas Clark wrote:
>
> > I don't quite what that means, but I'm guessing that something is sending
> > the regexp ending into a (near) infinite loop.
>
> -Dtr suggests an infinite loop:
>
> Found floating substr `'' at offset -1115720...
> Contradicts anchored substr `'', trying floating at offset -1115719...
> Found floating substr `'' at offset -1115720...
> Contradicts anchored substr `'', trying floating at offset -1115719...
> Found floating substr `'' at offset -1115720...
> Contradicts anchored substr `'', trying floating at offset -1115719...
> Found floating substr `'' at offset -1115720...
> Contradicts anchored substr `'', trying floating at offset -1115719...
> Found floating substr `'' at offset -1115720...
The loops is while matching the attached data against the attached regepx
(as stolen from gdb:
(gdb) call open ("foo", 66, 511)
$4 = 10
(gdb) call write (10, 0x87251b0, 3379)
$5 = 3379
(gdb) call close(10)
$6 = 0
)
However, if I attempt to write a test script to do this, I see:
Found floating substr ` ' ' at offset 1827...
Contradicts anchored substr ` ' ', trying floating at offset 1828...
Found floating substr ` ' ' at offset 2186...
Found anchored substr ` ' ' at offset 1827...
Starting position does not contradict /^/m...
Guessed: match at offset 1827
then some more stuff, then
Match failed
Freeing REx: `" \\' [^\\\\']* (\\\\.[^\\\\']*)* \\' "'
and the script exits.
I've no idea where that offset of -1115719 comes from. The SV as matched
against is:
(gdb) call Perl_sv_dump(targ)
SV = PVMG(0x85a9520) at 0x85d8b18
REFCNT = 37
FLAGS = (SMG,POK,pPOK,SCREAM)
IV = 0
NV = 0
PV = 0x87251b0 "\12code: part(s) \12 {\12 return 1;\12
...
else: \12 /.*/\12\12"\0
CUR = 3379
LEN = 3380
MAGIC = 0x84f6e80
MG_VIRTUAL = &PL_vtbl_mglob
MG_TYPE = PERL_MAGIC_regex_global(g)
MG_LEN = 473
so there doesn' appear to be any UTF8 flag on it. The most recent patching
activity nearby seems to be patch 15356:
http://public.activestate.com/cgi-bin/perlbrowse?patch=15356&action=patch
I'm not able to reverse that patch cleanly, so I can't test without it.
Any ideas? For debugging purposes, is it possible to disable Jarkko's UTF8
offset cache?
Should some assertions get added to trap negative offsets?
Nicholas Clark
PS regexp has no trailing newline. I'm not sure if mailers will add one. \' [^\\']* (\\.[^\\']*)* \'
code: part(s)
{
return 1;
}
part: comment
| function_definition
{
my $function = $item[1][0];
$return = 1, last if $thisparser->{data}{done}{$function}++;
push @{$thisparser->{data}{functions}}, $function;
$thisparser->{data}{function}{$function}{return_type} =
$item[1][1];
$thisparser->{data}{function}{$function}{arg_types} =
[map {ref $_ ? $_->[0] : '...'} @{$item[1][2]}];
$thisparser->{data}{function}{$function}{arg_names} =
[map {ref $_ ? $_->[1] : '...'} @{$item[1][2]}];
}
| function_declaration
{
$return = 1, last unless $thisparser->{data}{AUTOWRAP};
my $function = $item[1][0];
$return = 1, last if $thisparser->{data}{done}{$function}++;
my $dummy = 'arg1';
push @{$thisparser->{data}{functions}}, $function;
$thisparser->{data}{function}{$function}{return_type} =
$item[1][1];
$thisparser->{data}{function}{$function}{arg_types} =
[map {ref $_ ? $_->[0] : '...'} @{$item[1][2]}];
$thisparser->{data}{function}{$function}{arg_names} =
[map {ref $_ ? ($_->[1] || $dummy++) : '...'} @{$item[1][2]}];
}
| anything_else
comment:
m{\s* // [^\n]* \n }x
| m{\s* /\* (?:[^*]+|\*(?!/))* \*/ ([ \t]*)? }x
function_definition:
rtype IDENTIFIER '(' <leftop: arg ',' arg>(s?) ')' '{'
{
[EMAIL PROTECTED],1], $item[4]]
}
function_declaration:
rtype IDENTIFIER '(' <leftop: arg_decl ',' arg_decl>(s?) ')' ';'
{
[EMAIL PROTECTED],1], $item[4]]
}
rtype: rtype1 | rtype2
rtype1: modifier(s?) TYPE star(s?)
{
$return = $item[2];
$return = join ' ',@{$item[1]},$return
if @{$item[1]} and $item[1][0] ne 'extern';
$return .= join '',' ',@{$item[3]} if @{$item[3]};
return undef unless (defined $thisparser->{data}{typeconv}
{valid_rtypes}{$return});
}
rtype2: modifier(s) star(s?)
{
$return = join ' ',@{$item[1]};
$return .= join '',' ',@{$item[2]} if @{$item[2]};
return undef unless (defined $thisparser->{data}{typeconv}
{valid_rtypes}{$return});
}
arg: type IDENTIFIER [EMAIL PROTECTED],2]]}
| '...'
arg_decl:
type IDENTIFIER(s?) {[$item[1], $item[2][0] || '']}
| '...'
type: type1 | type2
type1: modifier(s?) TYPE star(s?)
{
$return = $item[2];
$return = join ' ',@{$item[1]},$return if @{$item[1]};
$return .= join '',' ',@{$item[3]} if @{$item[3]};
return undef unless (defined $thisparser->{data}{typeconv}
{valid_types}{$return});
}
type2: modifier(s) star(s?)
{
$return = join ' ',@{$item[1]};
$return .= join '',' ',@{$item[2]} if @{$item[2]};
return undef unless (defined $thisparser->{data}{typeconv}
{valid_types}{$return});
}
modifier:
'unsigned' | 'long' | 'extern' | 'const'
star: '*'
IDENTIFIER:
/\w+/
TYPE: /\w+/
anything_else:
/.*/