-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic: sv_len_utf8 cache with -d and -DDEBUGGING #13604
Comments
From @kentfredricThis is a bug report for perl from kentnl@cpan.org, This problem is hard for me to replicate as a reduced test case, because it seems linked to the stack depth of the problem. I have 2 scripts that trigger it, but they both require CPAN modules installed, and both require running under -d and -DDEBUGGING to trigger the failure. The crux of it is this snippet in perl5debug.pl causes the error for some reason, as it for some reason does not like calling length($sub) or substr( $sub, ) # If the last ten characters are '::AUTOLOAD', note we've traced Simply wrapping both these calls as : length("$sub") and substr( "$sub", ) Suppresses the problem entirely. Augmenting debug.pl like such prior to the length call is interesting: if ("$sub" =~ /^Git::Wrapper::Plus::Branches::/) { Because oddly, it yields SV = PV(0x2325470) at 0x1c7a170 Take note: current_branch has no magic, _current_branch_name has magic. And when invoking _current_branch_name directly, it does this: SV = PV(0x170a3c0) at 0x105f170 Noting that the previous dump showed _current_branch_name with magic, and this dump not, and instead, the magic is moved to ->git The other way to trigger it is: perl -d -E' use sanity;' , which causes the failure somewhere in Import::Into , but that loads way too many XS Magic things for me to try digging there. ( I ruled out it being a common failure point with autoviv and friends by slicing Moo and Moo::_Utils to not import strictures and checked the strictures modules were not being loaded with -d:TraceUse ) Flags: Site configuration information for perl 5.19.8: Configured by kent at Wed Jan 29 21:15:13 NZDT 2014. Summary of my perl5 (revision 5 version 19 subversion 8) configuration: @INC for perl 5.19.8: Environment for perl 5.19.8: |
From @kentfredric |
From perl5-porters@perl.orgKent Fredric wrote:
Here is a smaller case: $ perl5.19.9 -Mblib -de 'use utf8; require Git::Wrapper::Plus::Branches;Git::Wrapper::Plus::Branches::current_branch()' And blib/lib/Git/Wrapper/Plus/Branches.pm has been gutted and reduced to: package Git::Wrapper::Plus::Branches; The 'use utf8' and 'require' are necessary, so it seems to have some- |
The RT System itself - Status changed from 'new' to 'open' |
From @kentfredricMy other institutions were that it might be related to being called with a utf8 name but not being defined with a utf8 name, or vice versa, maybe causing problem. Or perhaps the problem flares up due to sharing a compile context somehow. |
From @kentfredricIf you rig @INC right, you can get this happening in a single file. Though its strange, seems entirely dependent on the `use utf8` value of the top context, and the value of utf8 in the compiled context is ignored. :/ |
From @kentfredric |
From perl5-porters@perl.orgKent Fredric wrote:
%INC is enough, as I have found out.
require Bareword causes the Bareword package to be vivified. But for $ ./perl -Ilib -e 'use utf8; ++$INC{"Branches.pm"};require Branches; use Devel::Peek; Dump ref bless [], Branches' Look, a 'one'-liner! $ PERL5DB='${^UTF8CACHE}=-1; sub DB::DB{} sub DB::sub{length($DB::sub); goto &$DB::sub}' ./miniperl -Ilib -de 'use utf8; ++$INC{"Branches.pm"};require Branches;Branches::cb();package Branches;sub _cbn {}sub cb{ _cbn();}' (BTW, ${^UTF8CACHE} is -1 by default under -DDEBUGGING, but you can Bisect points to me: commit a7999c0 Make sure $DB::sub is callable I suspect I just uncovered an existing utf8 cache bug, but I am |
From perl5-porters@perl.orgI wrote:
I think adding SvSETMAGIC to util.c:Perl_get_db_sub will fix it. |
From perl5-porters@perl.orgI wrote:
Hence, the workaround (untested) is to do this at the top of your mod- BEGIN { delete $Git::Wrapper::Plus::{"Branches::"} } |
From @ikegamiOn Sat, Feb 15, 2014 at 1:29 PM, Father Chrysostomos <sprout@cpan.org>wrote:
Well, the length cache is only used for UTF8-1 strings, so that's not |
From @cpansproutFixed in 795eb8c. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
From @demerphqOn 16 February 2014 06:00, Eric Brine <ikegami@adaelis.com> wrote:
UTF8-1? Yves -- |
From perl5-porters@perl.orgYves Orton asked:
Typo. UTF-8. |
From @ikegamiOn Mon, Feb 17, 2014 at 7:00 AM, demerphq <demerphq@gmail.com> wrote:
UTF8=1, as in the UTF8 flag set. |
Migrated from rt.perl.org#121255 (status was 'resolved')
Searchable as RT121255$
The text was updated successfully, but these errors were encountered: