maintainer-feedback requested: [Bug 209585] www/apache24 dynamic loading of MySQL client library generates errors with mod_perl CGI scripts

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue May 17 18:49:44 UTC 2016


papowell at astart.com has reassigned Bugzilla Automation <bugzilla at FreeBSD.org>'s
request for maintainer-feedback to apache at FreeBSD.org:
Bug 209585: www/apache24 dynamic loading of MySQL client library generates
errors with mod_perl  CGI scripts
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209585



--- Description ---
Created attachment 170413
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=170413&action=edit
SHAR file containing test scripts to reproduce problem

Apache, MOD_PERL, and MySQL Modules Have Wierd Failure on FreeBSD 10.X But Not
on FreeBSD 9.3

Note: this problem was initially reported as 208370, but this problem appears
to be related to Apache and the dynamic loading of modules using MySQL and
not to using the GD graphics library.

FreeBSD 10.3:
The Apache mod_perl + p5-GD + mod_dbd DBD + mysql appear
to have a subtle but catastrophic interaction.

IF
   a Perl GCI script to try to read a PNG file using the GD Perl module
THEN
   reading the PNG file fails, you get an error and the apache log file
contains:

    GD Error: gd-png: fatal libpng error: bad parameters to zlib
    GD Warning: gd-png error: setjmp returns error condition 2

Also, the same interaction occurs when you have
Apache mod_perl + p5-GD + mod_auth_mysql

The common element appears to be the dynamic loading of the MySQL client
library.

FreeBSD 9.3:
The same combination shown above works fine.

DETAILS:

On FreeBSD 10.3:
Apache 24
IF you load the mod_perl
 AND you have a Perl CGI script
 AND the perl Perl CGI script uses GD via the p5-gd (GD.pm) module

 AND you load the mod_dbd module
 AND you configure mod_dbd to use mysql
   i.e. -
   <IfModule mod_dbd.c>
    DBDriver mysql
    DBDParams "host=127.0.0.1 dbname=apache user=admin pass=password"
   </IfModule>

  AND The Perl GCI script to try to read a PNG file

THEN
   reading the PNG file fails, you get an error and the apache log file
contains:

    GD Error: gd-png: fatal libpng error: bad parameters to zlib
    GD Warning: gd-png error: setjmp returns error condition 2

Just to make it more complicated, If you do not use mod_perl, or do
not use the mysql DBDriver then everything works OK:

MOD Perl, DB Driver Enabled
LoadModule perl_module	      libexec/apache24/mod_perl.so
    DBDriver mysql
<br> Did NOT Read Image

MOD Perl, DB Driver Disabled
LoadModule perl_module	      libexec/apache24/mod_perl.so
    #DBDriver mysql
<br> Read Image

No MOD Perl, DB Driver Enabled
#LoadModule perl_module        libexec/apache24/mod_perl.so
    DBDriver mysql
<br> Read Image

If you do not use mod_dbd, but use mod_auth_mysql, then it also fails:

Using mod_auth_mysql

#LoadModule authn_dbd_module libexec/apache24/mod_authn_dbd.so
#LoadModule authz_dbd_module libexec/apache24/mod_authz_dbd.so
#LoadModule dbd_module libexec/apache24/mod_dbd.so
LoadModule perl_module	      libexec/apache24/mod_perl.so
LoadModule mysql_auth_module  libexec/apache24/mod_auth_mysql.so
    DBDriver mysql
<br> Did NOT Read Image


To Reproduce this, attached are a set of scripts that will configure a FreeBSD
installation.
and run the tests which generated the fault indications.

1. Install the FreeBSD system. (I use VirtualBox and Virtual Machines)
   You will need the latests versions of the PORTS tree so you can
   skip installing the ports.	You may want to do this for FreeBSD 10.3
   and FreeBSD 9.3

2. Copy the step* and test103* files to the test system.

3. On the test system run the step* files:
   sh step1	 # will modify /etc/rc.conf and install pkg and ports tree
   sh step2	 # installs Apache, MySQL, GD, and support modules
   sh step3	 # configures, compiles and installs devel/apr1
		 # you need to select MySQL support
   sh step4	 # sets up a toy MySQL database for testing. See
		 # Enabling_and_Administring_authn_dbd for an explanation
   sh step5	 # modifies the Apache httpd.conf file and installs the
		 # test103.cgi script and test103.png file.
   sh step6	 # runs a set of tests on different Apache configurations.
		 # This is done by commenting out critical lines in the
		 # Apache httpd.conf file.


More information about the freebsd-apache mailing list