logo       

Segmentation faults and bus errors: msg#00041

Subject: Segmentation faults and bus errors
Hi everyone,

I'm dabbling for the first time with perltk. I've written a script 
which does exactly what I want, except that it keeps on segfaulting 
or producing bus errors after an indetermistic number of passes 
through the main loop. Can anyone give me some hints on how to figure 
out what the problem is? I've tried it on my Mac OS X 10.4 machine 
and on this Linux server I have access to. perltk is the latest from 
CPAN, and perl is 5.8.6 on my Mac and 5.8.3 on the Linux server. Here 
is a trimmed down version of the script: 

#!/usr/bin/perl

use strict;
use warnings;
use Tk;

my @input = 
("trial26","trial19","trial09","trial18","trial30","trial08","trial27","trial20","trial02","trial16","trial11","trial21","trial07","trial05","trial17","trial01","trial10","trial25","trial22","trial03","trial23","trial04","trial28","trial06","trial14","trial15","trial13","trial12","trial24","trial29",);

my %trials = (
        "trial26" => "template21.bmp",
        "trial19" => "template34.bmp",
        "trial09" => "template24.bmp",
        "trial18" => "template42.bmp",
        "trial30" => "template23.bmp",
        "trial08" => "template43.bmp",
        "trial27" => "template32.bmp",
        "trial20" => "template21.bmp",
        "trial02" => "template14.bmp",
        "trial16" => "template23.bmp",
        "trial11" => "template23.bmp",
        "trial21" => "template21.bmp",
        "trial07" => "template23.bmp",
        "trial05" => "template31.bmp",
        "trial17" => "template21.bmp",
        "trial01" => "template31.bmp",
        "trial10" => "template21.bmp",
        "trial25" => "template43.bmp",
        "trial22" => "template24.bmp",
        "trial03" => "template43.bmp",
        "trial23" => "template24.bmp",
        "trial04" => "template13.bmp",
        "trial28" => "template31.bmp",
        "trial06" => "template32.bmp",
        "trial14" => "template31.bmp",
        "trial15" => "template41.bmp",
        "trial13" => "template21.bmp",
        "trial12" => "template24.bmp",
        "trial24" => "template43.bmp",
        "trial29" => "template41.bmp",
        );

# Main loop over trials
foreach my $trial (@input) {
        my $template_file = $trials{$trial};
        
        # Create the window
        my $mw = MainWindow->new;
        my $canvas = $mw->Canvas(-width => 102, -height => 77);
        my $template = $mw->Photo(-file => $template_file);
        $mw->{image_id} = $canvas->createImage(0, 0,
                                                                
                   -anchor => 'nw',
                                                                
                   -image => $template);
        $canvas->pack;
        # Snip...
        
        # Typing 'return' ends the current trial
        # (The next pass through the loop will show the next one)
        $mw->bind('<Return>' =>
                          sub {
                                  $mw -> destroy
                          });
        MainLoop;
}




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/beginning_perl_tk/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/beginning_perl_tk/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:beginning_perl_tk-digest@xxxxxxxxxxxxxxx 
    mailto:beginning_perl_tk-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    beginning_perl_tk-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe