Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML-LibYAML CPAN distribution.

Report information
The Basics
Id: 64011
Status: open
Priority: 0/
Queue: YAML-LibYAML

People
Owner: Nobody in particular
Requestors: obh [...] telenor.net
Cc:
AdminCc:

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



Subject: perl -d assert error when using !!perl/regexp '(?mix-s: ^\r? username: \s* $ )'
YAML::XS gives assert error under perl -d, but not when running perl with no debugger. Save this program unto /tmp/aa: -- use YAML::XS; use Data::Dumper; my $x = YAML::XS::LoadFile("/tmp/ax"); print Dumper $x; -- Save this to file /tmp/ax: -- x: y: z: !!perl/regexp '(?mix-s: ^\r? username: \s* $ )' u: !!perl/regexp '(?mix-s: ^\r? Error \s? : )' Under perl 5.12.2 run the program in the following way: perl /tmp/aa <it will run ok> perl -d /tmp/aa main::(/tmp/a3:6): my $x = YAML::XS::LoadFile("/tmp/ax"); DB<1> c perl: pp_hot.c:1901: Perl_pp_leave: Assertion `((char*)(my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1] == (char*)"block") ||
(!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) && __builtin_constant_p ("block") && (__s1_len = strlen ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1]), __s2_len = strlen
("block"), (!((size_t)(const void *)(((my_perl->Iscopestack_name) [(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const void *)((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) || __s1_len >= 4)
&& (!((size_t)(const void *)(("block") + 1) - (size_t)(const void *) ("block") == 1) || __s2_len >= 4)) ? __builtin_strcmp ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1], "block") :
(__builtin_constant_p ((my_perl->Iscopestack_name)[(my_perl- Show quoted text
>Iscopestack_ix)-1]) && ((size_t)(const void *)(((my_perl- >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const
void *)((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) && (__s1_len = strlen ((my_perl->Iscopestack_name)[(my_perl- Show quoted text
>Iscopestack_ix)-1]), __s1_len < 4) ? (__builtin_constant_p ("block") &&
((size_t)(const void *)(("block") + 1) - (size_t)(const void *)("block") == 1) ? __builtin_strcmp ((my_perl->Iscopestack_name)[(my_perl- Show quoted text
>Iscopestack_ix)-1], "block") : (__extension__ ({ __const unsigned char
*__s2 = (__const unsigned char *) (__const char *) ("block"); int __result = (((__const unsigned char *) (__const char *) ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1]))[0] - __s2[0]); if
(__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)- 1]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1]))[2] - __s2[2]); if
(__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)- 1]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("block") && ((size_t)(const void *)(("block") + 1) - (size_t)(const void *) ("block") == 1) && (__s2_len = strlen ("block"), __s2_len < 4) ? (__builtin_constant_p ((my_perl->Iscopestack_name)[(my_perl- Show quoted text
>Iscopestack_ix)-1]) && ((size_t)(const void *)(((my_perl- >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const
void *)((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) ? __builtin_strcmp ((my_perl->Iscopestack_name)[(my_perl- Show quoted text
>Iscopestack_ix)-1], "block") : (__extension__ ({ __const unsigned char
*__s1 = (__const unsigned char *) (__const char *) ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1]); int __result = __s1[0]
- ((__const unsigned char *) (__const char *) ("block"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("block"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("block"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("block"))[3]); } } __result; }))) : __builtin_strcmp ((my_perl- Show quoted text
>Iscopestack_name)[(my_perl->Iscopestack_ix)-1], "block")))); }))'
failed. Aborted uname says: 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:56:11 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux perl -V Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at Dec 17 2010 11:00:44 @INC: /local/nms/perl/5.12.2-dev/lib/site_perl/5.12.2/x86_64-linux-thread- multi /local/nms/perl/5.12.2-dev/lib/site_perl/5.12.2 /local/nms/perl/5.12.2-dev/lib/5.12.2/x86_64-linux-thread-multi /local/nms/perl/5.12.2-dev/lib/5.12.2 . [tiadm@asol1:perl-5.12.2]$ cpan -i YAML::XS CPAN: Storable loaded ok (v2.22) Going to read '/local/ti/home/tiadm/.cpan/Metadata' Database was generated on Thu, 16 Dec 2010 11:30:21 GMT CPAN: Module::CoreList loaded ok (v2.38) YAML::XS is up to date (0.34). [tiadm@asol1:perl-5.12.2]$
From: arieshout [...] gmail.com
The following script outputs 1 2 2 followed by an unexpected termination. It might be the same bug. The script gets a SEGV signal when executed with "perl -d" at the Load line. #!/usr/bin/perl -w use strict; use YAML::XS; my $hash_ref; { print "1\n"; local $/; ($hash_ref) = Load(<DATA>); print "2\n"; } print "3\n"; __DATA__ key: - !!perl/regexp '1' - !!perl/regexp '2' On Fri Dec 17 05:58:58 2010, obh wrote: Show quoted text
> YAML::XS gives assert error under perl -d, but not when running perl > with no debugger. > > Save this program unto /tmp/aa: > -- > use YAML::XS; > use Data::Dumper; > > my $x = YAML::XS::LoadFile("/tmp/ax"); > print Dumper $x; > -- > > Save this to file /tmp/ax: > -- > x: > y: > z: !!perl/regexp '(?mix-s: ^\r? username: \s* $ )' > u: !!perl/regexp '(?mix-s: ^\r? Error \s? : )' > > Under perl 5.12.2 run the program in the following way: > > perl /tmp/aa > > <it will run ok> > > perl -d /tmp/aa > > main::(/tmp/a3:6): my $x = YAML::XS::LoadFile("/tmp/ax"); > DB<1> c > perl: pp_hot.c:1901: Perl_pp_leave: Assertion `((char*)(my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1] == (char*)"block") ||
> (!__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p > ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) && > __builtin_constant_p ("block") && (__s1_len = strlen ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]), __s2_len = strlen
> ("block"), (!((size_t)(const void *)(((my_perl->Iscopestack_name) > [(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const void *)((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) || __s1_len >= 4)
> && (!((size_t)(const void *)(("block") + 1) - (size_t)(const void *) > ("block") == 1) || __s2_len >= 4)) ? __builtin_strcmp ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1], "block") :
> (__builtin_constant_p ((my_perl->Iscopestack_name)[(my_perl-
> >Iscopestack_ix)-1]) && ((size_t)(const void *)(((my_perl- > >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const
> void *)((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) > && (__s1_len = strlen ((my_perl->Iscopestack_name)[(my_perl-
> >Iscopestack_ix)-1]), __s1_len < 4) ? (__builtin_constant_p ("block") &&
> ((size_t)(const void *)(("block") + 1) - (size_t)(const void *)("block") > == 1) ? __builtin_strcmp ((my_perl->Iscopestack_name)[(my_perl-
> >Iscopestack_ix)-1], "block") : (__extension__ ({ __const unsigned char
> *__s2 = (__const unsigned char *) (__const char *) ("block"); int > __result = (((__const unsigned char *) (__const char *) ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]))[0] - __s2[0]); if
> (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) > (__const char *) ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)- > 1]))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = > (((__const unsigned char *) (__const char *) ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]))[2] - __s2[2]); if
> (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) > (__const char *) ((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)- > 1]))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("block") > && ((size_t)(const void *)(("block") + 1) - (size_t)(const void *) > ("block") == 1) && (__s2_len = strlen ("block"), __s2_len < 4) ? > (__builtin_constant_p ((my_perl->Iscopestack_name)[(my_perl-
> >Iscopestack_ix)-1]) && ((size_t)(const void *)(((my_perl- > >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) + 1) - (size_t)(const
> void *)((my_perl->Iscopestack_name)[(my_perl->Iscopestack_ix)-1]) == 1) > ? __builtin_strcmp ((my_perl->Iscopestack_name)[(my_perl-
> >Iscopestack_ix)-1], "block") : (__extension__ ({ __const unsigned char
> *__s1 = (__const unsigned char *) (__const char *) ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1]); int __result = __s1[0]
> - ((__const unsigned char *) (__const char *) ("block"))[0]; if > (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const > unsigned char *) (__const char *) ("block"))[1]); if (__s2_len > 1 && > __result == 0) { __result = (__s1[2] - ((__const unsigned char *) > (__const char *) ("block"))[2]); if (__s2_len > 2 && __result == 0) > __result = (__s1[3] - ((__const unsigned char *) (__const char *) > ("block"))[3]); } } __result; }))) : __builtin_strcmp ((my_perl-
> >Iscopestack_name)[(my_perl->Iscopestack_ix)-1], "block")))); }))'
> failed. > Aborted > > uname says: > 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:56:11 EDT 2008 x86_64 x86_64 > x86_64 GNU/Linux > > > perl -V > Characteristics of this binary (from libperl): > Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV > PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP > PERL_TRACK_MEMPOOL PERL_USE_SAFE_PUTENV > USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS > USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF > USE_REENTRANT_API > Built under linux > Compiled at Dec 17 2010 11:00:44 > @INC: > /local/nms/perl/5.12.2-dev/lib/site_perl/5.12.2/x86_64-linux-thread- > multi > /local/nms/perl/5.12.2-dev/lib/site_perl/5.12.2 > /local/nms/perl/5.12.2-dev/lib/5.12.2/x86_64-linux-thread-multi > /local/nms/perl/5.12.2-dev/lib/5.12.2 > . > [tiadm@asol1:perl-5.12.2]$ > > cpan -i YAML::XS > CPAN: Storable loaded ok (v2.22) > Going to read '/local/ti/home/tiadm/.cpan/Metadata' > Database was generated on Thu, 16 Dec 2010 11:30:21 GMT > CPAN: Module::CoreList loaded ok (v2.38) > YAML::XS is up to date (0.34). > [tiadm@asol1:perl-5.12.2]$ >