Skip Menu |

This queue is for tickets about the Moops CPAN distribution.

Report information
The Basics
Id: 99887
Status: open
Priority: 0/
Queue: Moops

People
Owner: Nobody in particular
Requestors: sven.schober [...] uni-ulm.de
Cc:
AdminCc:

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



Subject: Crash in Sub::Defer
Date: Wed, 29 Oct 2014 14:15:55 +0100
To: bug-Moops [...] rt.cpan.org
From: Sven Schober <sven.schober [...] uni-ulm.de>
Hi! It's me again. :) I am building a job system using Moops 0.034, where a parent process fetches some jobs and then spawn a lot of child processes to handle those jobs. From time to time, rather seldom (last time it was around 17 times out of 10k jobs), on of my handlers dies with: Can't use an undefined value as a SCALAR reference at /opt/perl5/perls/perl-5.21.0-shared-threaded/lib/site_perl/5.21.0/Sub/Defer.pm line 21. I googled around and came across rt#98666 ('Moo: Causing Sub::Defer to undefer early breaks some optimizations in Method::Generate::Construtor'), where you are already in contact with the authors of `Sub::Defer`. Now, reading up on the documentation for `Sub::Defer::undefer_all()` [2], I came to the conclusion that this is the thing for me: calling `undefer_all()` _before_ I start spawning the child processes. But, this is just a way to trigger the error more reliably: use strict; use warnings; use Carp::Always; { use Moops; class cA { method BUILD { print "BUILD\n"; } } } require Sub::Defer; use Data::Dumper; print Dumper(\%Sub::Defer::DEFERRED); Sub::Defer::undefer_all(); This yields: Can't use an undefined value as a SCALAR reference at /opt/perl5/perls/perl-5.21.0-shared-threaded/lib/site_perl/5.21.0/Sub/Defer.pm line 21. Sub::Defer::undefer_sub("CODE(0x1e23a48)") called at /opt/perl5/perls/perl-5.21.0-shared-threaded/lib/site_perl/5.21.0/Sub/Defer.pm line 40 Sub::Defer::undefer_all() called at sub-defer.pl line 17 No wonder, as `"CODE(0x1e23a48)"` points to an empty arrayref: ... 'CODE(0x1e23a48)' => [], ... Now, I am not sure, if calling `undefer_all()` is the right approach anyway, and I am not even sure if this is my initial problem, but maybe you a have suggestion, or pointer as to what is going on? Please let my know, if I can supply any further information, that might help clearing things up! Module versions: - Perl 5.12.0 (also occuring on 5.18.2) - Moops 0.034 - Moo 1.006001 Cheers Sven [1] https://rt.cpan.org/Public/Bug/Display.html?id=98666 [2] http://search.cpan.org/~haarg/Moo-1.006001/lib/Sub/Defer.pm#undefer_all -- Dipl.-Inf. Sven Schober Universität Ulm kiz - Abteilung Infrastruktur 89069 Ulm Tel.: +49 731 50 22484
Download smime.p7s
application/pkcs7-signature 4.6k

Message body not shown because it is not plain text.

Yes, other people have had the same issue. It's caused by Kavorka accidentally autovivifying some slots within Sub::Defer's hash. I think it should be fixed in Kavorka 0.036, but it's difficult to test because the bug is tricky to reproduce.
Subject: Re: [rt.cpan.org #99887] Crash in Sub::Defer
Date: Sat, 1 Nov 2014 18:51:16 +0100
To: bug-Moops [...] rt.cpan.org
From: Sven Schober <sven.schober [...] uni-ulm.de>
Ok, I've looked at the corresponding merge request [1] for Kavorka and read up on autovivification and I think I now understand what's going on. :) Thanks for the pointer! When do you plan to release Kavorka 0.036? [1]: https://github.com/tobyink/p5-kavorka/commit/f18b84a5ad524b5c4193ec46d115664e14c37c45 Show quoted text
> On 01 Nov 2014, at 17:51, Toby Inkster via RT <bug-Moops@rt.cpan.org> wrote: > > <URL: https://rt.cpan.org/Ticket/Display.html?id=99887 > > > Yes, other people have had the same issue. It's caused by Kavorka accidentally autovivifying some slots within Sub::Defer's hash. > > I think it should be fixed in Kavorka 0.036, but it's difficult to test because the bug is tricky to reproduce.
Download smime.p7s
application/pkcs7-signature 4.4k

Message body not shown because it is not plain text.