Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 95326
Status: rejected
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: jiminaus [...] gmail.com
Cc:
AdminCc:

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



Subject: Modification of a read-only value
Date: Sun, 4 May 2014 09:06:14 +1000
To: bug-Mail-Box [...] rt.cpan.org
From: Jiminaus <jiminaus [...] gmail.com>
After upgrading a system to perl v5.18.2, I started to receive the following error: Modification of a read-only value attempted at /perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Mail/Box/Locker/POSIX.pm line 29 I had to apply the following patch to resolve the error. --- /tmp/POSIX.pm 2014-05-04 09:03:51.000000000 +1000 +++ /perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Mail/Box/Locker/POSIX.pm 2014-05-04 08:57:32.000000000 +1000 @@ -26,13 +26,15 @@ sub _try_lock($) { my ($self, $file) = @_; - $? = fcntl($file, F_SETLK, pack('s @256', F_WRLCK)) || ($!+0); + my $p = pack('s @256', F_WRLCK); + $? = fcntl($file, F_SETLK, $p) || ($!+0); $?==0; } sub _unlock($) { my ($self, $file) = @_; - fcntl($file, F_SETLK, pack('s @256', F_UNLCK)); + my $p = pack('s @256', F_UNLCK); + fcntl($file, F_SETLK, $p); delete $self->{MBL_has_lock}; $self; }
Subject: Re: [rt.cpan.org #95326] Modification of a read-only value
Date: Sun, 4 May 2014 01:34:24 +0200
To: Jim In Aus via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <secretaris [...] nluug.nl>
* Jim In Aus via RT (bug-Mail-Box@rt.cpan.org) [140503 23:06]: Show quoted text
> Sat May 03 19:06:39 2014: Request 95326 was acted upon. > Transaction: Ticket created by jiminaus@gmail.com > Queue: Mail-Box > Subject: Modification of a read-only value > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=95326 > > > After upgrading a system to perl v5.18.2, I started to receive the > following error:
Show quoted text
> - $? = fcntl($file, F_SETLK, pack('s @256', F_WRLCK)) || ($!+0); > + my $p = pack('s @256', F_WRLCK); > + $? = fcntl($file, F_SETLK, $p) || ($!+0);
I have not seen error like this reported by cpantesters. No idea why you see them, and other people do not. The cause may be compile-time constant resolving, where constant expressions are already computed early... but now the result is a constant... not a variable :( The locker code is very old, taken from an existing implementation. I have no idea why this pack is used. Do you have any idea? It seem wrong to me. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #95326] Modification of a read-only value
Date: Sun, 4 May 2014 09:42:25 +1000
To: bug-Mail-Box [...] rt.cpan.org
From: Jiminaus <jiminaus [...] gmail.com>
Hello Mark, I had no idea why this was happening. I only found the "solution" by unpacking all the stages of evaluation into separate statements and isolating it down to the inlining of the pack calls. Honestly this is the only system I've written in Perl and it's stable system that has required very little maintenance. My Perl knowledge is rather rusty now. Actually porting the system to Scala and Akka is on my to-do list. If no-one else is seeing this, then I'll make a note of the patch and re-apply it when/if I update Mail-Box. BTW Thank you for this module. This system has been running strong for the last 5 or so years, in no small part thanks to your work. Regards, Jim Nicholls On 2014-May-04, at 09:34, Mark Overmeer via RT <bug-Mail-Box@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=95326 > > > * Jim In Aus via RT (bug-Mail-Box@rt.cpan.org) [140503 23:06]:
>> Sat May 03 19:06:39 2014: Request 95326 was acted upon. >> Transaction: Ticket created by jiminaus@gmail.com >> Queue: Mail-Box >> Subject: Modification of a read-only value >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=95326 > >> >> After upgrading a system to perl v5.18.2, I started to receive the >> following error:
>
>> - $? = fcntl($file, F_SETLK, pack('s @256', F_WRLCK)) || ($!+0); >> + my $p = pack('s @256', F_WRLCK); >> + $? = fcntl($file, F_SETLK, $p) || ($!+0);
> > I have not seen error like this reported by cpantesters. No idea > why you see them, and other people do not. > > The cause may be compile-time constant resolving, where constant > expressions are already computed early... but now the result is > a constant... not a variable :( > > The locker code is very old, taken from an existing implementation. I > have no idea why this pack is used. Do you have any idea? It seem > wrong to me. > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net > >