Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the AnyEvent-Filesys-Notify CPAN distribution.

Report information
The Basics
Id: 57104
Status: open
Priority: 0/
Queue: AnyEvent-Filesys-Notify

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

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



Subject: Circular references in Notify::Role::*
The attached script should exit immediately, but instead runs forever due to references to the Notify object in watcher callbacks in Role::*. The scoundrels are: Role/Fallback.pm:16: $self->_process_events(); Role/Linux.pm:25: sub { my $e = shift; $self->_process_events($e); } ); Role/Linux.pm:55: sub { my $e = shift; $self->_process_events($e); } ); Role/Mac.pm:28: $self->_process_events( $fs_monitor->read_events() ); And could all be fixed by using Scalar::Util's weaken on $self before constructing the callback. perl v5.10.1 (*) built for i686-linux-thread-multi running on Linux 2.6.33-ARCH #1 SMP PREEMPT Mon Apr 5 05:57:38 UTC 2010 i686
Subject: notify.plx
Download notify.plx
application/octet-stream 821b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #57104] Circular references in Notify::Role::*
Date: Mon, 3 May 2010 18:54:45 -0400
To: bug-AnyEvent-Filesys-Notify <bug-AnyEvent-Filesys-Notify [...] rt.cpan.org>
From: Mark Grimes <mgrimes [...] cpan.org>
Thanks for the bug report. I agree that the script you attached should terminate. I haven't been able to implement a fix by just weakening the reference to $self, though. In my tests, that sporadically results in segfaults. The issue also seems a bit different on each platform--ie, Devel::Cycle doesn't report a cycle on the Mac or the fallback implementation. A fix for this is still on my todo list, but it might take time for me to find the tuits to implement. If you have a well tested patch, I would be happy to apply it. :) Hope this isn't a show stopper for you. -Mark
From: drrpdrrpdrrp [...] gmail.com
Thanks for looking at it. undefing _watcher seems to be an effective workaround so far and otherwise it runs like a champ. Sorry to hear about the segfaults. :( I really can't help otherwise, unfortunately.