I'll try to give some more info. Perl version is 5.6.1, build 626 from Activestate. I am running PWS v4, build 1381. The new code that seems to make my program crash after being run about 4 times:

use GD; use GD::Graph; use GD::Graph::lines; use GD::Graph::pie; use GD::Graph::bars; use GD::Graph::colour; $field = $inputs{"field"}; $query = "SELECT $field FROM system_info"; print "<font size=-1>Query performed: $query<p>"; ## BEGIN DB ACCESS ## # Make a database handle $dbh = DBI->connect('dbi:Oracle:server', 'username', 'pass',) || d +ie "Database connection not made $DBI::errstr"; # Make a statement handle $sth = $dbh->prepare($query); $sth->execute; $i=0; while (@data=$sth->fetchrow_array()) { @array[$i]=$data[0]; $i++; } # Sort the array @array = sort {$a cmp $b} @array; $a=0; $b=0; $array_length = scalar(@array); print "Generating a graph for $array_length machines. Please wait +..."; # Create an associative array for all entries and the number of ti +mes in database while ($a < $array_length) { $b = $a + 1; if ($array[$a] =~ $array[$b]) { $count{$array[$a]}++; } $a++; } #### Start Graph Stuff @keys = keys(%count); @values = values(%count); @graphdata = ([@keys],[@values]); $num_graph_columns = scalar (@keys); $width=$num_graph_columns * 30; if ($width < 450) { $width=450; } $graph = GD::Graph::bars->new($width, 500); $graph->set( x_label => "$field", y_label => "number", title => "Graph of $field", bar_spacing => 6, shadow_depth => 4, shadowclr => 'dred', transparent => '1', x_labels_vertical => '1', show_values => '1' ); $graph->set_title_font('C:/winnt/fonts/arial.ttf', 18); $graph->set_x_axis_font('C:/winnt/fonts/arial.ttf', 8); $graph->set_y_axis_font('C:/winnt/fonts/arial.ttf', 8); $graph->set_y_label_font('C:/winnt/fonts/arial.ttf', 12); $graph->set_x_label_font('C:/winnt/fonts/arial.ttf', 12); $graph->plot(\@graphdata); open(OUTPUT, ">../wwwroot/chart.jpg") or die "Can't open chart.jpg +: $!\n"; binmode OUTPUT; print OUTPUT $graph->gd->jpeg(); close(OUTPUT); print "<p><center><img src=../chart.jpg><BR><BR><BR><font size=-2> +<table border=1 width=25%>"; foreach (keys(%count)) { print "<tr><td><font size=-1>$_</td><td><font size=-1>$count{$ +_}</td></tr>"; } print "</font></table>";
This code works, and I can display 4 or 5 graphs, but then the entire program stops responding. No error messages except: 'C:\Inetpub\scripts\webdb.cgi' script produced no output

If run from the command line the program runs correctly, with no errors. However, when run from the command line it never calls this method. It just checks the syntax. Any ideas?
Thanks, Kevin


In reply to Re: GD module stops working by kbradford
in thread GD module stops working by kbradford

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.