Skip Menu |

This queue is for tickets about the Tk-Graph CPAN distribution.

Report information
The Basics
Id: 31573
Status: new
Priority: 0/
Queue: Tk-Graph

People
Owner: Nobody in particular
Requestors: nklepeis [...] stanford.edu
Cc:
AdminCc:

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



Subject: Segmentation fault v0.06 in Linux Fedora 7 -- but works in Win32
Date: Sat, 15 Dec 2007 22:34:58 -0800
To: bug-Tk-Graph [...] rt.cpan.org
From: Neil Klepeis <nklepeis [...] stanford.edu>
This was reported in a similar issue as bug #30278 (Tk-Graph) I have use the latest Tk::Graph 0.06 in Windows XP (win32) without any problems. However, all the packaged demos and any new code I write for Fedora 7 (Linux) creates a segmentation fault after 2 points are sent to the graph. For example, the following demo code (test.pl) results in a segfault: #!/usr/bin/perl -w use strict; use lib '../.'; use Tk; use Tk::Graph; my $mw = MainWindow->new; my $to_register = { 'one' => [0,5,4,8,6,8], 'two' => [2,5,9,4,6,2], 'three' => [0,5,6,8,6,8], }; my $data = { 'one' => 3, 'two' => 3, 'three' => 3, }; my $ca = $mw->Graph( -type => 'Line', -max => 10, # -look => 10, )->pack(-expand => 1, -fill => 'both'); $ca->register($to_register); $ca->variable($data); $mw->after(2000, sub { shuffle($data, $ca) } ); MainLoop; sub shuffle { my $data = shift || die; my $ca = shift || die; foreach my $n (keys %$data) { $data->{$n} = int( rand(10) ); } #$mw->after(1000, sub { shuffle($data, $ca) } ); }
Subject: Re: [rt.cpan.org #31573] AutoReply: Segmentation fault v0.06 in Linux Fedora 7 -- but works in Win32
Date: Tue, 18 Dec 2007 10:36:48 -0800
To: bug-Tk-Graph [...] rt.cpan.org
From: Neil Klepeis <nklepeis [...] stanford.edu>
I discovered the segfault occurs in Linux Fedora 7 due to the following line in Graph.pm $self->delete('all') Not sure why this works in Windows, but it's likely some memory allocation/deallocation bug. The above line occurs in the draw_bar, draw_line, etc. subroutines and apparently serves to clear the graph between updates. When I comment out that line in Graph.pm, there is _no_ segfault and the lines are drawn but the old lines are not cleared in between draws. I assume that the "delete" method is part of the Tie::Watch module, but I haven't been able to figure out what the 'all' argument means. Any insights are welcome. I'll keep looking and post any new developments. --Neil Bugs in Tk-Graph via RT wrote: Show quoted text
> Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Segmentation fault v0.06 in Linux Fedora 7 -- but works in Win32", > 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 #31573]. Your ticket is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=31573 > > Please include the string: > > [rt.cpan.org #31573] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-Tk-Graph@rt.cpan.org > > ------------------------------------------------------------------------- > This was reported in a similar issue as bug #30278 (Tk-Graph) > > I have use the latest Tk::Graph 0.06 in Windows XP (win32) without any > problems. However, all the packaged demos and any new code I write > for Fedora 7 (Linux) creates a segmentation fault after 2 points are > sent to the graph. > > For example, the following demo code (test.pl) results in a segfault: > > > #!/usr/bin/perl -w > > use strict; > use lib '../.'; > use Tk; > use Tk::Graph; > > my $mw = MainWindow->new; > > my $to_register = { > 'one' => [0,5,4,8,6,8], > 'two' => [2,5,9,4,6,2], > 'three' => [0,5,6,8,6,8], > }; > > my $data = { > 'one' => 3, > 'two' => 3, > 'three' => 3, > }; > > my $ca = $mw->Graph( > -type => 'Line', > -max => 10, > # -look => 10, > )->pack(-expand => 1, > -fill => 'both'); > > $ca->register($to_register); > > $ca->variable($data); > > $mw->after(2000, sub { shuffle($data, $ca) } ); > > MainLoop; > > sub shuffle { > my $data = shift || die; > my $ca = shift || die; > > foreach my $n (keys %$data) { > $data->{$n} = int( rand(10) ); > } > #$mw->after(1000, sub { shuffle($data, $ca) } ); > } > > > > >
Subject: Re: [rt.cpan.org #31573] Segmentation fault v0.06 in Linux Fedora 7 -- but works in Win32
Date: Wed, 19 Dec 2007 19:09:43 -0800
To: bug-Tk-Graph [...] rt.cpan.org
From: Neil Klepeis <nklepeis [...] stanford.edu>
The delete->('all') is a valid method call for deleting all the tagged objects on a Tk::Canvas (or the derived "Graph" Tk::Canvas object). After perusing some of the Perl-Tk bug reports on rt.cpan.org, I think the segfaults we're seeing are a general problem with memory issues for Perl/Tk on Linux in general. Fedora 7 has perl-Tk-804.027, while the new version is 804.028. More later...