Skip Menu |

This queue is for tickets about the Const-Fast CPAN distribution.

Report information
The Basics
Id: 120130
Status: open
Priority: 0/
Queue: Const-Fast

People
Owner: Nobody in particular
Requestors: peter [...] morch.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: splice doesn't honor Internals::SvREADONLY
Date: Tue, 7 Feb 2017 03:47:24 +0100
To: bug-Const-Fast [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
It is possible to modify a const array with splice. Perhaps that should be documented e.g. under CAVEATS. See: Calling splice() on Immutable Arrays http://www.perlmonks.org/?node_id=1167665 From there, a tiny script to reproduce: #!/usr/bin/perl -w use strict; use feature qw(:5.10); my @a = qw[a simple list]; Internals::SvREADONLY(@a, 1); # splice doesn't care about Internals::SvREADONLY and modifies @a splice(@a, 1, 1, qw(not quite readonly)); # "a not quite readonly list" say join ' ', @a; # This dies as expected with: Modification of a read-only value attempted unshift @a, qw*this is*;
Subject: Re: [rt.cpan.org #120130] AutoReply: splice doesn't honor Internals::SvREADONLY
Date: Tue, 7 Feb 2017 03:49:57 +0100
To: bug-Const-Fast [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
Wups... versions: Show quoted text
> perl -E 'say $];'
5.020002 Show quoted text
> perl -MConst::Fast -E 'say $Const::Fast::VERSION'
0.014 On Tue, Feb 7, 2017 at 3:47 AM, Bugs in Const-Fast via RT < bug-Const-Fast@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "splice doesn't honor Internals::SvREADONLY", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #120130]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=120130 > > Please include the string: > > [rt.cpan.org #120130] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Const-Fast@rt.cpan.org > > ------------------------------------------------------------------------- > It is possible to modify a const array with splice. Perhaps that should be > documented e.g. under CAVEATS. > > See: Calling splice() on Immutable Arrays > http://www.perlmonks.org/?node_id=1167665 > > From there, a tiny script to reproduce: > > #!/usr/bin/perl -w > use strict; > use feature qw(:5.10); > my @a = qw[a simple list]; > Internals::SvREADONLY(@a, 1); > # splice doesn't care about Internals::SvREADONLY and modifies @a > splice(@a, 1, 1, qw(not quite readonly)); > # "a not quite readonly list" > say join ' ', @a; > # This dies as expected with: Modification of a read-only value attempted > unshift @a, qw*this is*; >
-- Peter Valdemar Mørch http://www.morch.com
Subject: Re: [rt.cpan.org #120130] splice doesn't honor Internals::SvREADONLY
Date: Tue, 14 Mar 2017 21:05:08 +0100
To: bug-Const-Fast [...] rt.cpan.org
From: Leon Timmermans <fawaka [...] gmail.com>
On Tue, Feb 7, 2017 at 3:47 AM, Peter Valdemar Mørch via RT < bug-Const-Fast@rt.cpan.org> wrote: Show quoted text
> Mon Feb 06 21:47:48 2017: Request 120130 was acted upon. > Transaction: Ticket created by peter@morch.com > Queue: Const-Fast > Subject: splice doesn't honor Internals::SvREADONLY > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: peter@morch.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=120130 > > > > It is possible to modify a const array with splice. Perhaps that should be > documented e.g. under CAVEATS. > > See: Calling splice() on Immutable Arrays > http://www.perlmonks.org/?node_id=1167665 > > From there, a tiny script to reproduce: > > #!/usr/bin/perl -w > use strict; > use feature qw(:5.10); > my @a = qw[a simple list]; > Internals::SvREADONLY(@a, 1); > # splice doesn't care about Internals::SvREADONLY and modifies @a > splice(@a, 1, 1, qw(not quite readonly)); > # "a not quite readonly list" > say join ' ', @a; > # This dies as expected with: Modification of a read-only value attempted > unshift @a, qw*this is*; >
Can you report this as a perlbug? Leon
Subject: Re: [rt.cpan.org #120130] splice doesn't honor Internals::SvREADONLY
Date: Wed, 15 Mar 2017 03:36:42 +0100
To: bug-Const-Fast [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
Sure. I've created: Bug #131000 for perl5: splice doesn't honor Internals::SvREADONLY. https://rt.perl.org/Public/Bug/Display.html?id=131000 Regardless, of whether/when this gets fixed, this bug submission against Const::Fast was that it should be documented under Caveats. Released Perl versions will mean that this will be an issue for years to come. But now there is a Perl core bug to reference! :-) Peter
Subject: Re: [rt.cpan.org #120130] splice doesn't honor Internals::SvREADONLY
Date: Thu, 16 Mar 2017 13:28:08 +0100
To: bug-Const-Fast [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
FYI, "Bug #131000 for perl5: splice doesn't honor Internals::SvREADONLY" has received a reply https://rt.perl.org/Public/Bug/Display.html?id=131000#txn-1453857 : First, the obligatory disclaimers from lib/Internals.pod: Show quoted text
> > <disclaimers about how one should not use Internals removed - see link> > > Given that documentation, the fact that 'splice' does not honor > Internals::SvREADONLY is more of an unimplemented feature than a bug. The > fact that CPAN distro Const-Fast relies upon Internals::SvREADONLY is > irrelevant. Unless we can document a need for the Perl 5 core distribution > to have 'splice' honor Internals::SvREADONLY, I don't think we should do > it, as that would only encourage people to include it in non-core code. > > Thank you very much. >
So it sounds like Bug #131000 not going to be fixed anytime soon.