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
foreach @foo ( @bar ) causes segfault with namespace::clean #9471
Comments
From nothingmuch@syeeda.localCreated by nothingmuch@syeeda.localThis is a bug report for perl from nothingmuch@syeeda.local, ----------------------------------------------------------------- The following script produces a segfault or bus error for me: package Foo; use namespace::clean -except => 'meta'; sub bar { my @ret; # without this it's a segfault, with it it's a bus error (null pointer deref on osx) foreach my @error ( @args ) { Moose uses Sub::Exporter to create export closures for its declaration syntax. These are then deleted by namespace::clean when the Scope::Guard it puts in %^H I suspect that the parse failure is causing %^H to be cleaned up differently, I can't reduce the test case any more than this. Perl Info
|
From @iabynOn Fri, Sep 05, 2008 at 01:01:34PM -0700, nothingmuch@syeeda.local (via RT) wrote:
I can reduce it to the following, which crashes on bleed and doesn't F1.pm: package F1; sub foo { }; sub import { my %store; $^H{'xxx'} = bless [ sub { foo(keys %store) } ]; 1; main script: #!/usr/bin/perl use F1; sub bar { It appears that bar()'s pad is freed during error cleanup *before* I've kind of of run out of time to look at this any further for a bit. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @nwc10Dave notes: coredump on bleed, maint. regression since 5.8.8 |
From p5p@spam.wizbit.beOn Thu May 28 07:28:55 2009, nicholas wrote:
Binary search: Running the prog '/tmp/rt-58614/script.pl' for installed-perls/perl/ use F1; sub bar { ----Output of .../p9sdLdP/perl-5.9.4@29542/bin/perl---- ----EOF ($?='65280')---- ----EOF ($?='11')---- http://public.activestate.com/cgi-bin/perlbrowse/p/29543 fix parser leaks caused by croaking while shifting or reducing |
From @schwernThis appears to have been fixed at some point in blead, but its still Attached is a test. I can't even fathom what to call it or where it |
From @schwern0001-A-test-for-rt.cpan.org-58614-which-I-can-t-fathom-wh.patchFrom fe8f92b3738c369dc737e04125efd17ed03a11eb Mon Sep 17 00:00:00 2001
From: Michael G. Schwern <schwern@pobox.com>
Date: Sun, 12 Jul 2009 03:19:24 -0700
Subject: [PATCH] A test for rt.cpan.org 58614 which I can't fathom where it would go or what to call it.
---
t/rt.cpan.org-58614.t | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
create mode 100644 t/rt.cpan.org-58614.t
diff --git a/t/rt.cpan.org-58614.t b/t/rt.cpan.org-58614.t
new file mode 100644
index 0000000..71a12af
--- /dev/null
+++ b/t/rt.cpan.org-58614.t
@@ -0,0 +1,48 @@
+#!./perl
+
+# A test for rt.cpan.org 58614
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+}
+
+use strict;
+plan tests => 1;
+
+{
+ # Write out a module which is necessary to reproduce the failure
+ my $module = "TestModule$$";
+ END { 1 while unlink "$module.pm" }
+ open my $fh, ">", "$module.pm";
+ print $fh sprintf <<'MODULE', $module;
+package %s;
+
+sub foo { };
+
+sub import {
+ my %%store;
+ $store{$_} = 1 for 1..8;
+
+ $^H{'xxx'} = bless [ sub { foo(keys %%store) } ];
+}
+
+sub DESTROY {
+ $_[0][0]->();
+}
+
+1;
+MODULE
+ close $fh;
+
+ # This code would segfault in 5.10.0.
+ fresh_perl_like(sprintf(<<'CODE', $module), qr/^Missing \$ on loop variable/, {});
+use %s;
+
+sub bar {
+ my ($x,$y);
+ for my @e ( @args ) { }
+}
+CODE
+}
--
1.6.2.4
|
From @obraOn Sun Jul 12 04:21:40 2009, schwern wrote:
Confirmed fixed in 5.11. Resolving. |
@obra - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#58614 (status was 'resolved')
Searchable as RT58614$
The text was updated successfully, but these errors were encountered: