(none) imager-devel
/ help / lists / applications / search /
 

Sefault/Bus error with Imager 0.41 on IRIX (perl 5.6.1/5.8.0)

From: Nigel Roberts (
06046@xyz.molar.is)
Date: Sun 03 Nov 2002 - 22:01:02 GMT

  • Next message: Nigel Roberts: "Re: Sefault/Bus error with Imager 0.41 on IRIX (perl 5.6.1/5.8.0)"

    Hi,

    *** This problem is repeatable with perl provided by the SGI perl
    5.6.1 package and a gcc compiled perl v5.8.0 for IRIX ***

    I'm having a problem with Imager 0.41 on IRIX 6.5.15m. I've compiled
    and installed Imager with support for freetype2, jpeg, png etc. (using
    gcc 3.0.4) I've installed freetype and jpeg support using the SGI
    freeware packages. I've had to modify the installed Config.pm module
    when using the SGI packaged perl so that it doesn't try to use MIPSpro
    cc (which I don't have) and uses gcc with the right flags instead.

    The problem is any script I write that uses this package will either
    cause a bus error or segfault at seemlingly random times after it has
    started executing. It always fails on an instruction relating to the
    Imager module.

    I've attached the output of perl -v, how I compiled Imager and a copy
    of the source of one of my simple scripts. FYI, this is on an SGI O2
    and I'm using vidtomem(1) to capture an image in RGB format from the
    O2 cam. Please excuse the ugliness of the code, I'm not a coder by
    trade :)

    What other information would be helpful in this case?

    $ perl -v

    This is perl, v5.6.1 built for irix-n32

    --
    

    $ export IM_LIBPATH=/usr/freeware/lib32 $ export IM_INCPATH=/usr/freeware/include $ perl Makefile.PL /usr/include/freetype2 doesnt exist or is unaccessible - removed. /usr/local/include/freetype2 doesnt exist or is unaccessible - removed. /usr/local/include doesnt exist or is unaccessible - removed. /usr/include/freetype doesnt exist or is unaccessible - removed. /usr/local/include/freetype doesnt exist or is unaccessible - removed. done. TT-fonts: includes not found - libraries not found w32: includes not found - libraries not found gif: includes not found - libraries not found jpeg: includes found - libraries found freetype2: includes found - libraries found tiff: includes found - libraries found T1-fonts: includes not found - libraries not found png: includes found - libraries found ungif: includes not found - libraries not found MakeMaker (v5.45) Writing Makefile for Imager::plugins Writing Makefile for Imager

    --

    #!/usr/bin/perl

    # # Take pictures, timestamp them and archive them in a new # directory for each day indefinitly. # # Nigel Roberts (06046@xyz.molar.is) #

    use strict; use POSIX qw(strftime); use Imager;

    my $file = '/usr/people/nigel/public_html/webcam'; my $font = Imager::Font->new(file => '/usr/people/nigel/fonts/cour.ttf'); my $white = Imager::Color->new("#FFFFFF");

    while (1) { my $i = "0";

    # What's the time? my ($sec,$min,$hour,$oldday,$month,$year) = localtime(time); my $newday = $oldday;

    # Setup archive directory $year += 1900; $month += 1; my $destdir = "/usr/people/nigel/pictures/webcam/$year-$month-$oldday"; mkdir($destdir);

    while ($newday == $oldday) { # Grab the picture and time my $time = strftime "%Y-%m-%d %H:%M:%S", localtime; system('/usr/sbin/vidtomem -f '.$file); my $img = new Imager; print "Opening image $file-00000.rgb\n"; $img->open(file=>"$file-00000.rgb");

    # Timestamp it print "$time\n"; my $return=$img->string(font=>$font, x=>0, y=>20, size=>20, color=>$white, text=>$time);

    # Write it my $newfile = "$file-temp.jpg"; print "Storing image as: $newfile\n"; $Imager::formats{'jpg'}; $img->write(file=>$newfile); rename("$file-temp.jpg", "$file.jpg");

    # Archive it my $archive = "$destdir/webcam-$i.jpg"; system("cp $file.jpg $destdir/webcam-$i.jpg");

    # Meh ($sec,$min,$hour,$oldday,$month,$year) = localtime(time); $i++; sleep 2; } }

    --

    example output

    $ perl webcamv4 /usr/sbin/vidtomem: saved image to file /usr/people/nigel/public_html/webcam-00000.rgb Opening image /usr/people/nigel/public_html/webcam-00000.rgb 2002-11-04 10:56:48 Storing image as: /usr/people/nigel/public_html/webcam-temp.jpg /usr/sbin/vidtomem: saved image to file /usr/people/nigel/public_html/webcam-00000.rgb Opening image /usr/people/nigel/public_html/webcam-00000.rgb 2002-11-04 10:56:53 Storing image as: /usr/people/nigel/public_html/webcam-temp.jpg /usr/sbin/vidtomem: saved image to file /usr/people/nigel/public_html/webcam-00000.rgb Opening image /usr/people/nigel/public_html/webcam-00000.rgb 2002-11-04 10:56:57 Storing image as: /usr/people/nigel/public_html/webcam-temp.jpg /usr/sbin/vidtomem: saved image to file /usr/people/nigel/public_html/webcam-00000.rgb Opening image /usr/people/nigel/public_html/webcam-00000.rgb 2002-11-04 10:57:02 Storing image as: /usr/people/nigel/public_html/webcam-temp.jpg /usr/sbin/vidtomem: saved image to file /usr/people/nigel/public_html/webcam-00000.rgb Opening image /usr/people/nigel/public_html/webcam-00000.rgb 2002-11-04 10:57:06 Segmentation fault (core dumped) $



  •