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) } );
}