Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

perl -wle '%::=();//' crash

14 views
Skip to first unread message

Reini Urban

unread,
May 12, 2008, 1:57:55 PM5/12/08
to per...@perl.org, The Perl5 Porters Mailing List
perl -wle '%::=();//' crashes in all perl versions.

In regexec.c PL_replgv is empty after the whole symboltable is cleared
and then used as GV.

regexec.c: SV* const oreplsv = GvSV(PL_replgv);
The gp pointer is 0x0, the type is BIND.

I would check for the empty gp pointer in PL_replgv and create an empty
but valid stash.
The problem is the semantically an empty stash should be allowed in
simple regex's. At least perl should not crash.

--
Reini Urban
http://phpwiki.org/ http://murbreak.at/

Reini Urban

unread,
May 12, 2008, 1:58:43 PM5/12/08
to bugs-bi...@rt.perl.org
# New Ticket Created by Reini Urban
# Please include the string: [perl #54044]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54044 >

Reini Urban via RT

unread,
May 12, 2008, 2:18:36 PM5/12/08
to perl5-...@perl.org
Just for reference:
assertion "SvTYPE(shplep) == SVt_PVGV || SvTYPE(shplep) == SVt_PVLV"
failed: file "regexec.c", line 2768

But I haven't decided yet how to fix #54044.
Error out or create a new empty stash just for the match operator.
--
Reini Urban

Abigail

unread,
May 12, 2008, 4:47:03 PM5/12/08
to Reini Urban, per...@perl.org, The Perl5 Porters Mailing List
On Mon, May 12, 2008 at 07:57:55PM +0200, Reini Urban wrote:
> perl -wle '%::=();//' crashes in all perl versions.

In 5.10.0, I get:

$ perl -wle '%::=();//'
Use of uninitialized value $_ in pattern match (m//) at -e line 1.
Assertion ((svtype)((shplep)->sv_flags & 0xff)) == SVt_PVGV || ((svtype)((shplep)->sv_flags & 0xff)) == SVt_PVLV failed: file "regexec.c", line 2741 at -e line 1.
$


Anything else gives me a segmentation fault.

Abigail

Abigail

unread,
May 12, 2008, 4:47:27 PM5/12/08
to bugs-bi...@rt.perl.org
# New Ticket Created by Abigail
# Please include the string: [perl #54052]

# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=54052 >

Rafael Garcia-Suarez

unread,
May 15, 2008, 9:15:03 AM5/15/08
to Reini Urban, The Perl5 Porters Mailing List
2008/5/12 Reini Urban <rur...@x-ray.at>:

> perl -wle '%::=();//' crashes in all perl versions.
>
> In regexec.c PL_replgv is empty after the whole symboltable is cleared and
> then used as GV.
>
> regexec.c: SV* const oreplsv = GvSV(PL_replgv);
> The gp pointer is 0x0, the type is BIND.
>
> I would check for the empty gp pointer in PL_replgv and create an empty but
> valid stash.

Why create a stash ? %:: has been emptied, not deleted. I think it's
sufficient to create an entry for *^R in the main stash (just like
perl.c does).

Reini Urban

unread,
May 15, 2008, 11:04:20 AM5/15/08
to pp
2008/5/15 Rafael Garcia-Suarez <rgarci...@gmail.com>:

So for safety reasons we should check in pp_hot.c:1044
hv_clear(hash) that if the HV is the main stash, that a *^R entry is
always present,
not to fall into the GvSV(gv) assertion / crash ??
That seems odd to me.
I would rather check in the match operator for an empty PL_replgv.

perl.c
PL_replgv = gv_fetchpvs("\022", GV_ADD|GV_NOTQUAL, SVt_PV); /* ^R */
GvMULTI_on(PL_replgv);

$ perl5.11.0 -MO=Concise -e'%::=();//'
a <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:{ ->3
7 <2> aassign[t3] vKS ->8
- <1> ex-list lK ->4
3 <0> pushmark s ->4
- <0> stub lP ->-
- <1> ex-list lK ->7
4 <0> pushmark s ->5
6 <1> rv2hv[t2] lKRM*/1 ->7
5 <#> gv[*main::] s ->6
8 <;> nextstate(main 1 -e:1) v:{ ->9
9 </> match(/""/) v/RTIME ->a

Rafael Garcia-Suarez

unread,
May 15, 2008, 11:25:02 AM5/15/08
to Reini Urban, pp
2008/5/15 Reini Urban <rur...@x-ray.at>:

>> Why create a stash ? %:: has been emptied, not deleted. I think it's
>> sufficient to create an entry for *^R in the main stash (just like
>> perl.c does).
>
> So for safety reasons we should check in pp_hot.c:1044
> hv_clear(hash) that if the HV is the main stash, that a *^R entry is
> always present,
> not to fall into the GvSV(gv) assertion / crash ??
> That seems odd to me.
> I would rather check in the match operator for an empty PL_replgv.

I think that it's what I intended to say.

Reini Urban

unread,
Apr 8, 2013, 1:21:27 PM4/8/13
to pp
---------- Forwarded message ----------
From: rur...@cpanel.net via RT <perlbug-...@perl.org>
Date: Mon, Apr 8, 2013 at 12:07 PM
Subject: [PATCH] 40bb0e6 Error "Attempt to clear the %main:: symbol
table" [perl #54044]
To: abi...@abigail.be, fras...@gmail.com, jet...@cpan.org, rur...@x-ray.at



This is a bug report for perl from rur...@cpanel.net,
generated with the help of perlbug 1.39 running under perl 5.14.2.

From 40bb0e6fc1252879ea0cd48a0267e4db5a2d6bc7 Mon Sep 17 00:00:00 2001
From: Reini Urban <rur...@x-ray.at>
Date: Mon, 8 Apr 2013 12:02:17 -0500
Subject: [PATCH] Error "Attempt to clear the %main:: symbol table" [perl
#54044]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------1.7.10.4"

This is a multi-part message in MIME format.
--------------1.7.10.4
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


Perl used to crash when the %main:: stash is undef'ed or cleared and some
magic to be expected symbol is accessed, such as perl -wle '%::=();//'
with PL_replgv.
Check both cases: undef and assignment in hv_clear()/sv_clear().
---
hv.c | 4 ++++
pod/perldiag.pod | 9 +++++++++
sv.c | 2 ++
t/op/stash.t | 16 ++++++++++++----
t/op/undef.t | 16 +++++++++++++++-
5 files changed, 42 insertions(+), 5 deletions(-)


--------------1.7.10.4
Content-Type: text/x-patch;
name="0001-Error-Attempt-to-clear-the-main-symbol-table-perl-54.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="0001-Error-Attempt-to-clear-the-main-symbol-table-perl-54.patch"

diff --git a/hv.c b/hv.c
index ec1bfe8..4e93315 100644
--- a/hv.c
+++ b/hv.c
@@ -1469,6 +1469,8 @@ Perl_hv_clear(pTHX_ HV *hv)
xhv = (XPVHV*)SvANY(hv);

ENTER;
+ if ( hv == PL_defstash && PL_phase != PERL_PHASE_DESTRUCT )
+ croak("Attempt to clear the %main:: symbol table");
SAVEFREESV(SvREFCNT_inc_simple_NN(hv));
if (SvREADONLY(hv) && HvARRAY(hv) != NULL) {
/* restricted hash: convert all keys to placeholders */
@@ -1706,6 +1708,8 @@ Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags)
/* note that the code following prior to hfreeentries is duplicated
* in sv_clear(), and changes here should be done there too */
if (PL_phase != PERL_PHASE_DESTRUCT && (name = HvNAME(hv))) {
+ if (hv == PL_defstash)
+ croak("Attempt to clear the %main:: symbol table");
if (PL_stashcache) {
DEBUG_o(Perl_deb(aTHX_ "hv_undef_flags clearing
PL_stashcache for '%"
HEKf"'\n", HvNAME_HEK(hv)));
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index f7eb662..f3fb28b 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -277,6 +277,15 @@ example by:

bless $self, "$proto";

+=item Attempt to clear the %main:: symbol table
+
+(F) The failing code attempted to delete or set the C<%main::>
+symboltable, with something like C<%::=()> or C<undef %::>. If you
+want to really clear all entries from the C<%main::> symboltable you
+need to do it manually, element by element. But beware that a lot of
+magic main symbols entries are required, e.g. for the regex engine,
+and all namespaces will be gone also, as they are keys of C<%main::>.
+
=item Attempt to clear deleted array

(S debugging) An array was assigned to when it was being freed.
diff --git a/sv.c b/sv.c
index 3736ba8..b095591 100644
--- a/sv.c
+++ b/sv.c
@@ -6120,6 +6120,8 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
/* Free back-references before magic, in case the magic calls
* Perl code that has weak references to sv. */
if (type == SVt_PVHV) {
+ if (PL_phase != PERL_PHASE_DESTRUCT && hv == PL_defstash)
+ croak("Attempt to clear the %main:: symbol table");
Perl_hv_kill_backrefs(aTHX_ MUTABLE_HV(sv));
if (SvMAGIC(sv))
mg_free(sv);
diff --git a/t/op/stash.t b/t/op/stash.t
index fd5450e..fd9392c 100644
--- a/t/op/stash.t
+++ b/t/op/stash.t
@@ -7,12 +7,12 @@ BEGIN {

BEGIN { require "./test.pl"; }

-plan( tests => 58 );
+plan( tests => 59 );

-# Used to segfault (bug #15479)
+# Used to segfault (bug #15479 and #54044)
fresh_perl_like(
'%:: = ""',
- qr/Odd number of elements in hash assignment at - line 1\./,
+ qr/^Attempt to clear the %main:: symbol table at - line 1\./,
{ switches => [ '-w' ] },
'delete $::{STDERR} and print a warning',
);
@@ -60,7 +60,7 @@ package main;
local $ENV{PERL_DESTRUCT_LEVEL} = 2;
fresh_perl_is(
'package A; sub a { // }; %::=""',
- '',
+ 'Attempt to clear the current symbol table at - line 1.',
'',
);
# Variant of the above which creates an object that persists until global
@@ -336,3 +336,11 @@ ok eval '
sub foo{};
1
', 'no crashing or errors when clobbering the current package';
+
+{
+ # [perl #54004] disallow setting i.e. clearing %main::
+ eval '%::=()';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+ eval '%main:: = ($_ = "")';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+}
diff --git a/t/op/undef.t b/t/op/undef.t
index eafa6db..fa4cdfc 100644
--- a/t/op/undef.t
+++ b/t/op/undef.t
@@ -10,7 +10,7 @@ use strict;

use vars qw(@ary %ary %hash);

-plan 85;
+plan 90;

ok !defined($a);

@@ -176,3 +176,17 @@ sub PVBM () { 'foo' }
my $pvbm = PVBM;
undef $pvbm;
ok !defined $pvbm;
+
+{
+ # [perl #54004] disallow undef %main::
+ eval 'undef %::';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+ eval 'undef %main::';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+ eval 'undef %main::main::';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+ eval 'package A; undef %main::';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+ eval 'package A; undef %::';
+ like $@, qr/^Attempt to clear the %main:: symbol table/;
+}

--------------1.7.10.4--


---
Flags:
category=core
severity=medium
---
This perlbug was built using Perl 5.17.3 - Mon Jul 30 16:28:27 CDT 2012
It is being executed now by Perl 5.14.2 - Wed Oct 26 17:33:43 CDT 2011.

Site configuration information for perl 5.14.2:

Configured by rurban at Wed Oct 26 17:33:43 CDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 2) configuration:

Platform:
osname=linux, osvers=3.0.0-1-amd64, archname=x86_64-linux
uname='linux reini 3.0.0-1-amd64 #1 smp sun jul 24 02:24:44 utc
2011 x86_64 gnulinux '
config_args='-de -Dmksymlinks -Duseshrplib -Dusedevel
-Doptimize=-Os -Accflags=-msse4.2 -Accflags=-march=corei7
-Dcf_email=rur...@cpanel.net -Dperladmin=rur...@cpanel.net
-Dstartperl=#!/usr/local/bin/perl5.14.2-nt
-Dperlpath=/usr/local/bin/perl5.14.2-nt'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='ccache cc', ccflags ='-msse4.2 -march=corei7
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-Os',
cppflags='-msse4.2 -march=corei7 -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.6.1', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib/x86_64-linux-gnu
/lib64 /usr/lib64
libs=-lnsl -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.13'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/usr/local/lib/perl5/5.14.2/x86_64-linux/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib -fstack-protector'

Locally applied patches:


---
@INC for perl 5.14.2:
/usr/local/lib/perl5/site_perl/5.14.2/x86_64-linux
/usr/local/lib/perl5/site_perl/5.14.2
/usr/local/lib/perl5/5.14.2/x86_64-linux
/usr/local/lib/perl5/5.14.2
.

---
Environment for perl 5.14.2:
HOME=/home/rurban
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH=/usr/src/perl/blead/perl-git
LOGDIR (unset)
PATH=/home/rurban/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PERL_BADLANG (unset)
SHELL=/bin/bash



--
Reini Urban
http://cpanel.net/ http://www.perl-compiler.org/

Reini Urban via RT

unread,
Apr 8, 2013, 2:36:25 PM4/8/13
to perl5-...@perl.org
Oops, previous patch had a last minute typo in it (sv vs hv)

Use this one instead.
I'm smoking it now with my cpan subset to catch possible
%{"$pkg\::"}=... cases with empty $pkg.

On Mon Apr 08 10:22:20 2013, rurban wrote:
> ---------- Forwarded message ----------
> From: rur...@cpanel.net via RT <perlbug-...@perl.org>
> Date: Mon, Apr 8, 2013 at 12:07 PM
> Subject: [PATCH] 40bb0e6 Error "Attempt to clear the %main:: symbol
> table" [perl #54044]
> To: abi...@abigail.be, fras...@gmail.com, jet...@cpan.org,
> rur...@x-ray.at
> Subject: [PATCH] Error "Attempt to clear the %main:: symbol table"
> [perl #54044]

--
Reini Urban

---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=54044
0001-Error-Attempt-to-clear-the-main-symbol-table-perl-54.patch

Reini Urban via RT

unread,
Apr 8, 2013, 5:27:04 PM4/8/13
to perl5-...@perl.org
On Mon Apr 08 11:36:23 2013, rurban wrote:
> Oops, previous patch had a last minute typo in it (sv vs hv)
>
> Use this one instead.
> I'm smoking it now with my cpan subset to catch possible
> %{"$pkg\::"}=... cases with empty $pkg.

Smoked my cpan successfully with this revised patch.
0001-Error-Attempt-to-clear-the-main-symbol-table-perl-54.patch

Steffen Mueller

unread,
Apr 9, 2013, 1:03:39 AM4/9/13
to perlbug-...@perl.org, perl5-...@perl.org
On 04/08/2013 11:27 PM, Reini Urban via RT wrote:
> On Mon Apr 08 11:36:23 2013, rurban wrote:
>> Oops, previous patch had a last minute typo in it (sv vs hv)
>>
>> Use this one instead.
>> I'm smoking it now with my cpan subset to catch possible
>> %{"$pkg\::"}=... cases with empty $pkg.
>
> Smoked my cpan successfully with this revised patch.

FWIW if nobody beats me to it or strongly objects I'll try to remember
to apply this after 5.18. Feel free to remind me then as well.

--Steffen

Brian Fraser

unread,
Apr 9, 2013, 1:09:43 AM4/9/13
to Steffen Mueller, Brian Fraser via RT, Perl5 Porters Mailing List
My soft objection is that it doesn't really solve the underlaying issue, it just hides it; perl -e 'delete $::{ENV}; chdir' will still fail. But that's a reason to keep the ticket open, not one not to merge the patch.

Brian Fraser

unread,
Apr 10, 2013, 5:48:23 AM4/10/13
to Steffen Mueller, Brian Fraser via RT, Perl5 Porters Mailing List
Another objection, I don't think either of these should fail:

$ ./perl -e '%:: = %::'
Attempt to clear the %main:: symbol table at -e line 1.

$ ./perl -e '%:: = map { $_ => $::{$_} } grep !/foo|bar/, keys %::;'
Attempt to clear the %main:: symbol table at -e line 1.

Nicholas Clark

unread,
Apr 10, 2013, 6:04:37 AM4/10/13
to Brian Fraser, Steffen Mueller, Brian Fraser via RT, Perl5 Porters Mailing List
On Wed, Apr 10, 2013 at 06:48:23AM -0300, Brian Fraser wrote:
> Another objection, I don't think either of these should fail:
>
> $ ./perl -e '%:: = %::'
> Attempt to clear the %main:: symbol table at -e line 1.
>
> $ ./perl -e '%:: = map { $_ => $::{$_} } grep !/foo|bar/, keys %::;'
> Attempt to clear the %main:: symbol table at -e line 1.

Given how hash list assignment is implemented, it's hard to see how to
permit those to keep working whilst also adding a way to prevent
clearing %::

I can see that they are reduced test cases, but what's the real world
use case that they represent?

Nicholas Clark

Brian Fraser

unread,
Apr 10, 2013, 6:50:27 AM4/10/13
to Nicholas Clark, Steffen Mueller, Brian Fraser via RT, Perl5 Porters Mailing List
Ah. Good question; None productive from me. I've only used them in joke modules and when trying to make Perl crash. So that's a strike against that objection.

Nicholas Clark

unread,
Apr 10, 2013, 7:13:37 AM4/10/13
to Steffen Mueller, perl5-...@perl.org
On Mon, Apr 08, 2013 at 02:27:04PM -0700, Reini Urban via RT wrote:
> On Mon Apr 08 11:36:23 2013, rurban wrote:
> > Oops, previous patch had a last minute typo in it (sv vs hv)
> >
> > Use this one instead.
> > I'm smoking it now with my cpan subset to catch possible
> > %{"$pkg\::"}=... cases with empty $pkg.
>
> Smoked my cpan successfully with this revised patch.

Mmm, that's an interesting failure case that I'd not thought of.


> +++ b/t/op/stash.t
> @@ -7,12 +7,12 @@ BEGIN {
>
> BEGIN { require "./test.pl"; }
>
> -plan( tests => 58 );
> +plan( tests => 60 );
>
> -# Used to segfault (bug #15479)
> +# Used to segfault (bug #15479 and #54044)
> fresh_perl_like(
> '%:: = ""',
> - qr/Odd number of elements in hash assignment at - line 1\./,
> + qr/^Attempt to clear the %main:: symbol table at - line 1\./m,
> { switches => [ '-w' ] },
> 'delete $::{STDERR} and print a warning',
> );
> @@ -60,14 +60,14 @@ package main;
> local $ENV{PERL_DESTRUCT_LEVEL} = 2;
> fresh_perl_is(
> 'package A; sub a { // }; %::=""',
> - '',
> + 'Attempt to clear the %main:: symbol table at - line 1.',
> '',
> );
> # Variant of the above which creates an object that persists until global
> # destruction.
> fresh_perl_is(
> 'use Exporter; package A; sub a { // }; %::=""',
> - '',
> + 'Attempt to clear the %main:: symbol table at - line 1.',
> '',
> );
> }

I don't think that these three should be changed like that. Clearing %::
was the intent of the tests. Triggering an error or SEGV as the side effect
of something no longer being in %:: was the intent. I think that a better
change would be this:

diff --git a/t/op/stash.t b/t/op/stash.t
index fd5450e..2681d47 100644
--- a/t/op/stash.t
+++ b/t/op/stash.t
@@ -11,7 +11,7 @@ plan( tests => 58 );

# Used to segfault (bug #15479)
fresh_perl_like(
- '%:: = ""',
+ 'delete $::{STDERR}; my %a = ""',
qr/Odd number of elements in hash assignment at - line 1\./,
{ switches => [ '-w' ] },
'delete $::{STDERR} and print a warning',
@@ -59,14 +59,15 @@ package main;
{
local $ENV{PERL_DESTRUCT_LEVEL} = 2;
fresh_perl_is(
- 'package A; sub a { // }; %::=""',
+ 'package A::B; sub a { // }; %A::=""',
'',
'',
);
# Variant of the above which creates an object that persists until global
- # destruction.
+ # destruction, and triggers an assertion failure prior to change
+ # a420522db95b7762
fresh_perl_is(
- 'use Exporter; package A; sub a { // }; %::=""',
+ 'use Exporter; package A; sub a { // }; delete $::{$_} for keys %::',
'',
'',
);


as those all maintain the original intent of the tests.

Verified. In that I built the 3 revisions where those 3 were added and
checked that my suggested revised test case also triggers the bug that each
was testing. Also, as those 3 don't change behaviour with Reini's patch
added, I'd be tempted to apply them as a commit before Reini's patch, so that
it's clear that the revised versions pass independently of his change.

I sort of assume that "code freeze" applies equally to the code that is tests,
so I'm not doing it now.

Nicholas Clark

Nicholas Clark

unread,
May 22, 2013, 8:12:11 AM5/22/13
to perl5-...@perl.org
*That* change is now in blead, but the rest of this ticket is not yet done.

Nicholas Clark

Father Chrysostomos via RT

unread,
Oct 27, 2013, 7:23:04 PM10/27/13
to perl5-...@perl.org
Another objection: It doesn’t fix the underlying issue, and it just adds a special case to prevent something that nobody does anyway (and the extra check will make every %hash=() marginally slower).

I think the real fix here is to make certain shortcut pointers (like PL_replgv) reference-counted as necessary.

I have already begun this. I started for a different purpose; namely, to prevent gv_try_downgrade from trying to delete these (yes, it can do that!).

Once that’s done, I think this ticket can be closed.

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=54044

Father Chrysostomos via RT

unread,
Oct 27, 2013, 7:40:23 PM10/27/13
to perl5-...@perl.org
I forgot to mention: If someone removes, say, $::{ENV} and expects *{"ENV"} to work thereafter, that’s not our problem. That counts as podotoxoboly (with apologies to Damian Conway).

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=54044

Paul Miller

unread,
Oct 27, 2013, 10:45:17 PM10/27/13
to perlbug-...@perl.org
Apologies if this is a stupid question, but I can't figure why I'm copied on this -- fascinating though the discussion is.  Did I report this bug? I highly doubt it, and I can't see where I commented on it.

Is this the best place to find the full history?

http://www.nntp.perl.org/group/perl.perl5.porters/2013/04/msg200892.html  


On Sun, Oct 27, 2013 at 7:23 PM, Father Chrysostomos via RT <perlbug-...@perl.org> wrote:
On Wed Apr 10 03:51:04 2013, Hugmeir wrote:
> On Wed, Apr 10, 2013 at 7:04 AM, Nicholas Clark <ni...@ccl4.org> wrote:
>
> > On Wed, Apr 10, 2013 at 06:48:23AM -0300, Brian Fraser wrote:
> > > Another objection, I don't think either of these should fail:
> > >
> > > $ ./perl -e '%:: = %::'
> > > Attempt to clear the %main:: symbol table at -e line 1.
> > >
> > > $ ./perl -e '%:: = map { $_ => $::{$_} } grep !/foo|bar/, keys %::;'
> > > Attempt to clear the %main:: symbol table at -e line 1.
> >
> > Given how hash list assignment is implemented, it's hard to see how to
> > permit those to keep working whilst also adding a way to prevent
> > clearing %::
> >
> > I can see that they are reduced test cases, but what's the real world
> > use case that they represent?
> >
>
> Ah. Good question; None productive from me. I've only used them in joke
> modules and when trying to make Perl crash. So that's a strike against that
> objection.

Another objection:  It doesn’t fix the underlying issue, and it just adds a special case to prevent something that nobody does anyway (and the extra check will make every %hash=() marginally slower).

I think the real fix here is to make certain shortcut pointers (like PL_replgv) reference-counted as necessary.

I have already begun this.  I started for a different purpose; namely, to prevent gv_try_downgrade from trying to delete these (yes, it can do that!).

Once that’s done, I think this ticket can be closed.

--

Father Chrysostomos




--
If riding in an airplane is flying, then riding in a boat is swimming.
116 jumps, 48.6 minutes of freefall, 92.9 freefall miles.

Aristotle Pagaltzis

unread,
Oct 28, 2013, 2:33:10 AM10/28/13
to perl5-...@perl.org
* Father Chrysostomos via RT <perlbug-...@perl.org> [2013-10-28 00:45]:
> I forgot to mention: If someone removes, say, $::{ENV} and expects
> *{"ENV"} to work thereafter, that’s not our problem. That counts as
> podotoxoboly (with apologies to Damian Conway).

Quoth `man bash` describing `unset`:

If any of RANDOM, SECONDS, LINENO, HISTCMD, FUNCNAME, GROUPS, or
DIRSTACK are unset, they lose their special properties, even if they
are subsequently reset.

So assuming that I am making the right connection here, the sentiment
seems common and to have precedent.

--
Aristotle Pagaltzis // <http://plasmasturm.org/>

Smylers

unread,
Oct 28, 2013, 3:22:59 AM10/28/13
to perl5-...@perl.org
Paul Miller writes:

> Apologies if this is a stupid question, but I can't figure why I'm copied
> on this -- fascinating though the discussion is. Did I report this bug? I
> highly doubt it, and I can't see where I commented on it.
>
> Is this the best place to find the full history?

Hi Paul. At the very bottom of Father Chrysostomos's message that you
replied to is this link, which has the full bug details:
https://rt.perl.org/Ticket/Display.html?id=54044

Reading down it seems you first reported Bug 54050, which was then
merged into this one:
https://rt.perl.org/Public/Bug/Display.html?id=54044#txn-403224

Smylers
--
Stop drug companies hiding negative research results.
Sign the AllTrials petition to get all clinical research results published.
Read more: http://www.alltrials.net/blog/the-alltrials-campaign/

jettero@cpan.org via RT

unread,
Oct 28, 2013, 6:46:33 AM10/28/13
to perl5-...@perl.org
On Mon Oct 28 00:23:37 2013, smy...@stripey.com wrote:
> Hi Paul. At the very bottom of Father Chrysostomos's message that you

It's actually not on his. I looked at that first thing (then checked the raw copy after you said to see if gmail hid it somehow), as I expected it would be if it was from RT. I think he replied in another way.

But all I had to do was put 54044 into the regular old rt.perl.org? I feel silly regardless.

Looks like I did report this at one point. I wonder how I found that.

---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=54044

Smylers

unread,
Oct 28, 2013, 5:55:16 PM10/28/13
to perl5-...@perl.org
jet...@cpan.org via RT writes:

> On Mon Oct 28 00:23:37 2013, smy...@stripey.com wrote:
>
> > Hi Paul. At the very bottom of Father Chrysostomos's message that you
>
> It's actually not on his.

In which case, my apologies for suggesting otherwise.

> I looked at that first thing (then checked the raw copy after you said
> to see if gmail hid it somehow), as I expected it would be if it was
> from RT. I think he replied in another way.

It was via RT, but possibly RT sends different messages to ‘internal’
and ‘external’ recipients. Here's the copy which RT sent to the P5P
mailing list, with the RT footer:
http://www.nntp.perl.org/group/perl.perl5.porters/2013/10/msg208991.html

> But all I had to do was put 54044 into the regular old rt.perl.org? I
> feel silly regardless.

Please don't feel silly: I don't see why it would be obvious to somebody
who's reported a bug using the perlbug command that it would have a
public web interface available at a particular URL, especially not when
several years have gone by since reporting it.

Cheers

Father Chrysostomos via RT

unread,
Oct 28, 2013, 8:43:18 PM10/28/13
to perl5-...@perl.org
This is now fixed in commit 475b1e90 and some of the commits leading up to it.

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=54044
0 new messages