This code:

$ cat im
$_ = "N\x{100}";
chop $_;

s/
  (?: [A-Z] | [\d] )+
  (?= [\s] )
//x;


triggers this assertion:

    /* Check if this call has already been counted because the op performed
     * a leave_scope(). E.g., OP_SUBSTCONT at end of s/.../\1/
     * or Scope::Upper's unwind()
     */
    if (subr_entry->already_counted) {
        assert(subr_entry->already_counted < 3);
        if (trace_level >= 9)
            logwarn("%2d -- already counted\n", subr_entry->subr_prof_depth);
        goto skip_sub_profile;
    }

like this:

$ ./perl -d:NYTProf im
perl: NYTProf.xs:2819: pp_subcall_profiler: Assertion 
`subr_entry->already_counted < 3' failed.
Aborted


with this backtrace:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb7db6ad0 (LWP 28517)]
0xb7f91410 in __kernel_vsyscall ()
(gdb) where
#0  0xb7f91410 in __kernel_vsyscall ()
#1  0xb7de2085 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7de3a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0xb7ddb10e in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4  0xb7d95b30 in pp_subcall_profiler (is_slowop=1) at NYTProf.xs:2819
#5  0xb7d95370 in pp_slowop_profiler () at NYTProf.xs:2690
#6  0x081387ba in Perl_runops_debug () at dump.c:2046
#7  0x0808d2e1 in Perl_call_sv (sv=0x84d75f0, flags=130) at perl.c:2584
#8  0x0808cf60 in Perl_call_method (methname=0x83aa214 "SWASHNEW", flags=2)
    at perl.c:2510
#9  0x082d1c95 in Perl_swash_init (pkg=0x83a9221 "utf8", name=0x83a5168 "", 
    listsv=0x83d0cd8, minbits=1, none=0) at utf8.c:1754
#10 0x082ca51e in Perl_regclass_swash (prog=0x83d9440, node=0x83d8c14, 
    doinit=1 '\001', listsvp=0x0, altsvp=0xbff93e64) at regexec.c:5696
#11 0x082ca7d5 in S_reginclass (prog=0x83d9440, n=0x83d8c14, p=0x83d4cf1 "", 
    lenp=0xbff94278, do_utf8=1 '\001') at regexec.c:5755
#12 0x082c059f in S_regmatch (reginfo=0xbff94690, prog=0x83d8b94)
    at regexec.c:3485
#13 0x082bb862 in S_regtry (reginfo=0xbff94690, startpos=0xbff947a4)
    at regexec.c:2454
#14 0x082ba8c3 in Perl_regexec_flags (rx=0x83d0b28, stringarg=0x83d4cf0 "N", 
    strend=0x83d4cf1 "", strbeg=0x83d4cf0 "N", minend=0, sv=0x83e1ac8, 
    data=0x0, flags=2) at regexec.c:2241
#15 0x08185b8f in Perl_pp_subst () at pp_hot.c:2151
#16 0xb7d956e1 in pp_subcall_profiler (is_slowop=1) at NYTProf.xs:2760
#17 0xb7d95370 in pp_slowop_profiler () at NYTProf.xs:2690
#18 0x081387ba in Perl_runops_debug () at dump.c:2046
#19 0x0808c199 in S_run_body (oldscope=1) at perl.c:2302
#20 0x0808b676 in perl_run (my_perl=0x83be008) at perl.c:2227
#21 0x080627f5 in main (argc=3, argv=0xbff94ea4, env=0xbff94eb4)
    at perlmain.c:117
(gdb)             


The regexp is simplified from one in Pod::Man:

http://perl5.git.perl.org/perl.git/blob/a7560424:/cpan/podlators/lib/Pod/Man.pm#l444


I don't know how to fix this, because I don't understand what the check is for.


All the current fun comes from me trying to run this, in a perl build tree:

./perl -d:NYTProf installman

Nicholas Clark

-- 
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to