in reply to Re: XS Error: Segfault with B::HooksAtRuntime
in thread XS Error: Segfault with B::HooksAtRuntime
I can't solve the problem, but that info turned out to be sufficient for me to guess where to poke. I can reproduce a segfault in just 7 lines of code.
File: mx_segfault.plFile: Demo.pmuse lib '.'; use Demo;
File: Stuff.pmpackage Demo; use MooseX::Extended; require Stuff;
With this code, perl -wc mx_segfault.pl segfaults, and valgrind throws a 455-line tantrum.package Stuff; use MooseX::Extended;
==12066== Memcheck, a memory error detector ==12066== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et +al. ==12066== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyrigh +t info ==12066== Command: perl -wc mx_segfault.pl ==12066== ==12066== Invalid read of size 2 ==12066== at 0x251CCD: S_pop_eval_context_maybe_croak (in /home/haj +/perl5/perlbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x25FFA0: Perl_pp_leaveeval (in /home/haj/perl5/perlbr +ew/perls/perl-5.36.0/bin/perl) ==12066== by 0x213312: Perl_runops_standard (in /home/haj/perl5/per +lbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x177DFD: Perl_call_sv (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x17A70D: Perl_call_list (in /home/haj/perl5/perlbrew/ +perls/perl-5.36.0/bin/perl) ==12066== by 0x15E84A: S_process_special_blocks (in /home/haj/perl5 +/perlbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x170805: Perl_newATTRSUB_x (in /home/haj/perl5/perlbr +ew/perls/perl-5.36.0/bin/perl) ==12066== by 0x1743DA: Perl_utilize (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x1B000E: Perl_yyparse (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x17E836: perl_parse (in /home/haj/perl5/perlbrew/perl +s/perl-5.36.0/bin/perl) ==12066== by 0x155295: main (in /home/haj/perl5/perlbrew/perls/perl +-5.36.0/bin/perl) ==12066== Address 0x4c2528a is 314 bytes inside a block of size 1,872 + free'd ==12066== at 0x483AD7B: realloc (vg_replace_malloc.c:834) ==12066== by 0x1F385C: Perl_safesysrealloc (in /home/haj/perl5/perl +brew/perls/perl-5.36.0/bin/perl) ==12066== by 0x24D3BB: Perl_cxinc (in /home/haj/perl5/perlbrew/perl +s/perl-5.36.0/bin/perl) ==12066== by 0x21CED4: Perl_pp_entersub (in /home/haj/perl5/perlbre +w/perls/perl-5.36.0/bin/perl) ==12066== by 0x213312: Perl_runops_standard (in /home/haj/perl5/per +lbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x25130B: S_docatch (in /home/haj/perl5/perlbrew/perls +/perl-5.36.0/bin/perl) ==12066== by 0x213312: Perl_runops_standard (in /home/haj/perl5/per +lbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x177C5A: Perl_call_sv (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x87D828C: call_after (in /home/haj/perl5/perlbrew/per +ls/perl-5.36.0/lib/site_perl/5.36.0/x86_64-linux/auto/B/Hooks/AtRunti +me/AtRuntime.so) ==12066== by 0x24F7A1: Perl_leave_scope (in /home/haj/perl5/perlbre +w/perls/perl-5.36.0/bin/perl) ==12066== by 0x251CCC: S_pop_eval_context_maybe_croak (in /home/haj +/perl5/perlbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x25FFA0: Perl_pp_leaveeval (in /home/haj/perl5/perlbr +ew/perls/perl-5.36.0/bin/perl) ==12066== Block was alloc'd at ==12066== at 0x483877F: malloc (vg_replace_malloc.c:307) ==12066== by 0x1F3502: Perl_safesysmalloc (in /home/haj/perl5/perlb +rew/perls/perl-5.36.0/bin/perl) ==12066== by 0x24D316: Perl_new_stackinfo (in /home/haj/perl5/perlb +rew/perls/perl-5.36.0/bin/perl) ==12066== by 0x15E9D6: S_process_special_blocks (in /home/haj/perl5 +/perlbrew/perls/perl-5.36.0/bin/perl) ==12066== by 0x170805: Perl_newATTRSUB_x (in /home/haj/perl5/perlbr +ew/perls/perl-5.36.0/bin/perl) ==12066== by 0x1743DA: Perl_utilize (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x1B000E: Perl_yyparse (in /home/haj/perl5/perlbrew/pe +rls/perl-5.36.0/bin/perl) ==12066== by 0x17E836: perl_parse (in /home/haj/perl5/perlbrew/perl +s/perl-5.36.0/bin/perl) ==12066== by 0x155295: main (in /home/haj/perl5/perlbrew/perls/perl +-5.36.0/bin/perl)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XS Error: Segfault with B::HooksAtRuntime
by dave_the_m (Monsignor) on Aug 06, 2022 at 18:31 UTC | |
|
Re^3: XS Error: Segfault with B::HooksAtRuntime
by Ovid (Cardinal) on Aug 06, 2022 at 16:44 UTC |