-
Notifications
You must be signed in to change notification settings - Fork 561
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
segmentation fault in pure perl #10533
Comments
From @maukeCreated by @maukeSo pippijn on freenode/#perl had this program that made his perl #!perl use strict; # not needed sub list_rule { { my %lists; sub quantise { if (my ($sep) = } sub assemble_rules { map { quantise $_->{expr} } @{ $rule->{rhs} }; 0 for (); sub gen_yacc_rules { while (my ($nterm, $rule) = each %$rules) { sub gen_rules { gen_yacc_rules $rules; gen_rules; __END__ This segfaults his 5.10 as well as my 5.12.1 and my system perl 5.8.8. The latter doesn't exactly segfault on this version of the code; instead *** glibc detected *** /usr/bin/perl: munmap_chunk(): invalid pointer: 0x097cf574 *** Anyway, I think perl shouldn't crash here. Perl Info
|
From @avarOn Sun, Aug 8, 2010 at 11:57, l.mai@web.de <perlbug-followup@perl.org> wrote:
This will fail an assert on blead compiled with debugging flags, or @@ -5788,7 +5788,10 @@ Perl_sv_clear(pTHX_ register SV *const sv) PERL_ARGS_ASSERT_SV_CLEAR; Without the debugging assert it'll continue to: } else if (SvMAGIC(sv)) Where it'll segfault on: Perl_mg_free(pTHX_ SV *sv) PERL_ARGS_ASSERT_MG_FREE; for (mg = SvMAGIC(sv); mg; mg = moremagic) { That's not magic: (gdb) p mg->mg_virtual Looks like perl is trying to free an already freed scalar. |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Sun, Aug 08, 2010 at 12:23:14PM +0000, Ævar Arnfjörð Bjarmason wrote:
The assert-failing test can be reduced to my @a = ( {}, {} ); sub f { map { f $_ } @a; which is just an instance of the "don't modify an array you're iterating -- |
From @avarOn Wed, Aug 18, 2010 at 16:43, Dave Mitchell <davem@iabyn.com> wrote:
Even if that's unfixable we could still do better than segfault here, Is the assert only reached due to this sort of bug? If so perhaps a |
From @iabynOn Thu, Aug 19, 2010 at 10:59:36PM +0000, Ævar Arnfjörð Bjarmason wrote:
Maybe; it increases the cost of every SV freeing, though.
That assert fails any time an already-freed SV is freed. Any internal -- |
Migrated from rt.perl.org#77082 (status was 'open')
Searchable as RT77082$
The text was updated successfully, but these errors were encountered: