From owner-freebsd-questions@FreeBSD.ORG Fri Feb 16 12:19:25 2007 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1577916A400; Fri, 16 Feb 2007 12:19:25 +0000 (UTC) (envelope-from thomas@bsdunix.ch) Received: from conversation.bsdunix.ch (ns1.bsdunix.ch [82.220.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id C893513C48D; Fri, 16 Feb 2007 12:19:24 +0000 (UTC) (envelope-from thomas@bsdunix.ch) Received: from localhost (localhost.bsdunix.ch [127.0.0.1]) by conversation.bsdunix.ch (Postfix) with ESMTP id 5999D5D3D; Fri, 16 Feb 2007 12:52:21 +0100 (CET) X-Virus-Scanned: by amavisd-new at mail.bsdunix.ch Received: from conversation.bsdunix.ch ([127.0.0.1]) by localhost (conversation.bsdunix.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4-CCICcEv564; Fri, 16 Feb 2007 12:52:19 +0100 (CET) Received: from [212.101.1.83] (bert.mlan.solnet.ch [212.101.1.83]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by conversation.bsdunix.ch (Postfix) with ESMTP id 934F65D38; Fri, 16 Feb 2007 12:52:19 +0100 (CET) From: Thomas Vogt To: freebsd-questions@FreeBSD.ORG Content-Type: text/plain Date: Fri, 16 Feb 2007 12:52:18 +0100 Message-Id: <1171626738.73878.28.camel@bert.mlan.solnet.ch> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-apache@freebsd.org Subject: apache, gd and mod_perl2 problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2007 12:19:25 -0000 Hello I've a strange problem with apache2.0, gd2 and mod_perl2. I wrote a small test script which creates a png file in my /tmp directory. This perl script works fine if I run it localy on a shell, it works also as normal cgi script but it doesn't work with apache2 and mod_perl2. It crashes with: print HF $im->png; (see the whole script below) httpd-error.log message (debug enabled) [Tue Feb 13 09:41:34 2007] [notice] child pid 24480 exit signal Abort trap (6) t/www in free(): error: pointer to wrong page The script I'm talking about: cat buttontest.html #!/usr/bin/perl use GD; # create a new image $im = new GD::Image(100, 100); # allocate some colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); # make the background transparent and interlaced $im->transparent($white); $im->interlaced('true'); # Put a black frame around the picture $im->rectangle(0,0,99,99,$black); # Draw a blue oval $im->arc(50,50,95,75,0,360,$blue); # And fill it with red $im->fill(50,50,$red); print "Content-type: text/html\n\n"; print "

Hello world

"; # make sure we are writing to a binary stream open HF, ">/tmp/file.png"; binmode HF; # Convert the image to PNG and print it on standard output # here it crashes with apache print HF $im->png; close HF; print "

Foobar"; my httpd.conf: LoadModule perl_module libexec/apache2/mod_perl.so PerlModule Apache2::Reload # -- mod_perl stuff SetHandler perl-script PerlResponseHandler ModPerl::RegistryPrefork PerlInitHandler Apache2::Reload Options +ExecCGI AddHandler cgi-script html png PerlOptions +ParseHeaders PerlSetVar StatINCDebug On My System: 6.2-RELEASE-p1 (i386) Packets I use: apache-2.0.59 png-1.2.12_1 perl-5.8.8 p5-GD-2.35 mod_perl2-2.0.3_ gd-2.0.33_4,11,3 freetype2-2.2.1_1 I compiled everything with -DWITHOUT_X11 knob but I also tested it with X support too. It doesn't work either. I also tried mod_perl2-2.0.2 to make sure it's not a new 2.0.3 bug. The same script works fine on an Ubuntu Linux Server with apache2.0.x, mod_perl2 and gd. Any idea? Regards, Thomas -- Terry Lambert: "It is not unix's job to stop you from shooting your foot. If you so choose to do so, then it is UNIX's job to deliver Mr. Bullet to Mr Foot in the most efficient way it knows."