Skip Menu |

This queue is for tickets about the Wx CPAN distribution.

Report information
The Basics
Id: 74652
Status: resolved
Priority: 0/
Queue: Wx

People
Owner: Nobody in particular
Requestors: adamk [...] cpan.org
Cc:
AdminCc:

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



Subject: Segfault on Wx::PlThreadEvent destruction
The following code is from Padre::Wx::Role::Conduit. It seems to show that on rare occasions thread events can explode when they fall out of scope and are destroyed (at least, that's my assumption since the $_[1] param is always a plain string). It does not happen often, but the Find in Files background thread in Padre produces hundreds or thousands of thread events. sub signal { if ($CONDUIT) { $CONDUIT->AddPendingEvent( Wx::PlThreadEvent->new( -1, $SIGNAL, $_[1] ) ); } return 1; # NOTE: Crashes like the following have been observed. # # Free to wrong pool 8d60100 not 963e10 at # C:/strawberry/perl/site/lib/Padre/Wx/Role/Conduit.pm line 153. # Attempt to free unreferenced scalar: SV 0x2099354, # Perl interpreter: 0x4f2c2b4 # at C:/strawberry/perl/site/lib/Padre/Wx/Role/Conduit.pm line 153. # # It appears that the destruction of the Wx::PlThreadEvent can # cause segfaults in some situations. }
CC: wxperl-users [...] perl.org
Subject: Re: [rt.cpan.org #74652] Segfault on Wx::PlThreadEvent destruction
Date: Fri, 03 Feb 2012 09:29:01 +0000
To: bug-Wx [...] rt.cpan.org
From: Mark Dootson <mark.dootson [...] znix.com>
Hi, For thread events you must use Wx::PostEvent Wx::PostEvent( $CONDUIT, Wx::PlThreadEvent->new( -1, $SIGNAL, $_[1] ) ); I think this may be your problem as Wx::PostEvent employs a 'thread safe' stash for the thread data by using threads::shared. The error you are seeing is probably the result of not using Wx::PostEvent. Regards Mark On 03/02/2012 08:33, Adam Kennedy via RT wrote: Show quoted text
> Fri Feb 03 03:33:41 2012: Request 74652 was acted upon. > Transaction: Ticket created by ADAMK > Queue: Wx > Subject: Segfault on Wx::PlThreadEvent destruction > Broken in: 0.9903 > Severity: (no value) > Owner: Nobody > Requestors: adamk@cpan.org > Status: new > Ticket<URL: https://rt.cpan.org/Ticket/Display.html?id=74652> > > > The following code is from Padre::Wx::Role::Conduit. > > It seems to show that on rare occasions thread events can explode when > they fall out of scope and are destroyed (at least, that's my assumption > since the $_[1] param is always a plain string). > > It does not happen often, but the Find in Files background thread in > Padre produces hundreds or thousands of thread events. > > sub signal { > if ($CONDUIT) { > $CONDUIT->AddPendingEvent( > Wx::PlThreadEvent->new( -1, $SIGNAL, $_[1] ) > ); > } > return 1; > > # NOTE: Crashes like the following have been observed. > # > # Free to wrong pool 8d60100 not 963e10 at > # C:/strawberry/perl/site/lib/Padre/Wx/Role/Conduit.pm line 153. > # Attempt to free unreferenced scalar: SV 0x2099354, > # Perl interpreter: 0x4f2c2b4 > # at C:/strawberry/perl/site/lib/Padre/Wx/Role/Conduit.pm line 153. > # > # It appears that the destruction of the Wx::PlThreadEvent can > # cause segfaults in some situations. > } >
Bug marked as 'resolved' as I believe the suggested solution solved problem for requestor.