php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18032 Configurescript problems, my result in Segfault
Submitted: 2002-06-27 19:54 UTC Modified: 2003-05-06 18:23 UTC
From: vhoel99 at grm dot hia dot no Assigned: sniper (profile)
Status: Closed Package: Reproducible crash
PHP Version: 4.2.1 OS: Linux 2.4.17
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vhoel99 at grm dot hia dot no
New email:
PHP Version: OS:

 

 [2002-06-27 19:54 UTC] vhoel99 at grm dot hia dot no
If I configure PHP this way, with GD support but no pgsql, it works:
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local \
  --with-apxs=/usr/local/apache/bin/apxs \
  --enable-exif \
  --enable-track-vars \
  --enable-magic-quotes \
  --enable-ftp \
  --with-gd \
  --with-zlib \
  --with-jpeg-dir="/usr" \
  --with-png-dir="/usr" \
  --with-zlib-dir="/usr" \
  --with-ttf \
  --with-freetype-dir="/usr/local" \
  --with-openssl="/usr/local" \
  --with-mysql=/usr/local

If I add pgsql, I get a segfault as soon as I start Apache.

If I add pgsql, but remove GD, everything works. Config like this:
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local \
  --with-apxs=/usr/local/apache/bin/apxs \
  --enable-exif \
  --enable-track-vars \
  --enable-magic-quotes \
  --enable-ftp \
  --with-openssl="/usr/local" \
  --with-mysql=/usr/local \
  --with-pgsql

If I mess up with my GD-config, like this:
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
./configure --prefix=/usr/local \
  --with-apxs=/usr/local/apache/bin/apxs \
  --enable-exif \
  --enable-track-vars \
  --enable-magic-quotes \
  --enable-ftp \
  --with-gd \

  --with-jpeg-dir="/usr" \

  --with-openssl="/usr/local" \
  --with-mysql=/usr/local \
  --with-pgsql

.. I get this error:
<cut>
checking for GD support... yes
checking whether to enable truetype string function in GD... no
checking for the location of libjpeg... yes
checking for jpeg_read_header in -ljpeg... yes
checking for the location of libpng... no
If configure fails try --with-png-dir=<DIR> and --with-zlib-dir=<DIR>
checking for the location of libXpm... no
If configure fails try --with-xpm-dir=<DIR>
checking for freetype(2)... no
If configure fails try --with-freetype-dir=<DIR>
checking for FreeType 1.x support... no
checking for T1lib support... no
checking for gdImageString16 in -lgd... no
checking for gdImagePaletteCopy in -lgd... no
checking for gdImageCreateFromPng in -lgd... no
checking for gdImageCreateFromGif in -lgd... no
checking for gdImageGif in -lgd... no
checking for gdImageWBMP in -lgd... no
checking for gdImageCreateFromJpeg in -lgd... no
checking for gdImageCreateFromXpm in -lgd... no
checking for gdImageCreateFromGd2 in -lgd... no
checking for gdImageCreateTrueColor in -lgd... no
checking for gdImageSetTile in -lgd... no
checking for gdImageSetBrush in -lgd... no
checking for gdImageStringTTF in -lgd... no
checking for gdImageStringFT in -lgd... no
checking for gdImageStringFTEx in -lgd... no
checking for gdImageColorClosestHWB in -lgd... no
checking for gdImageColorResolve in -lgd... no
checking for gdImageGifCtx in -lgd... no
<cut>
checking for mysql_close in -lmysqlclient... no
checking for mysql_errno in -lmysqlclient... no
configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.
<cut>

This may seem ok, but why does he say no on the mysql_close and mysql_errno??

Because if I run it properly (like at the top), this is the output:
<cut>
checking for GD support... yes
checking whether to enable truetype string function in GD... no
checking for the location of libjpeg... yes
checking for jpeg_read_header in -ljpeg... yes
checking for the location of libpng... yes
checking for png_write_image in -lpng... yes
checking for the location of libXpm... no
If configure fails try --with-xpm-dir=<DIR>
checking for freetype(2)... yes
checking for FreeType 1.x support... yes
no - FreeType 2.x is to be used instead
checking for T1lib support... no
checking for gdImageString16 in -lgd... yes
checking for gdImagePaletteCopy in -lgd... yes
checking for gdImageCreateFromPng in -lgd... yes
checking for gdImageCreateFromGif in -lgd... no
checking for gdImageGif in -lgd... no
checking for gdImageWBMP in -lgd... yes
checking for gdImageCreateFromJpeg in -lgd... yes
checking for gdImageCreateFromXpm in -lgd... yes
checking for gdImageCreateFromGd2 in -lgd... yes
checking for gdImageCreateTrueColor in -lgd... yes
checking for gdImageSetTile in -lgd... yes
checking for gdImageSetBrush in -lgd... yes
checking for gdImageStringTTF in -lgd... yes
checking for gdImageStringFT in -lgd... yes
checking for gdImageStringFTEx in -lgd... no
checking for gdImageColorClosestHWB in -lgd... yes
checking for gdImageColorResolve in -lgd... yes
checking for gdImageGifCtx in -lgd... no
<cut>
checking for mysql_close in -lmysqlclient... yes
checking for MySQL UNIX socket... /tmp/mysql.sock
<cut>

So I have to choose if I want gd or pgsql, not both.
And if I mess up my gd-config, it comlains about my MySQL :-)

I hope this can be fixed.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-27 20:00 UTC] sniper@php.net
Please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz
 [2002-06-28 10:43 UTC] vhoel99 at grm dot hia dot no
The system is a standard Slackware 7.1 with an self-compiled Apache.

As far as I know, this bug came into PHP version 4.2.0, and are still in the snapshot dated 200206280600.
 [2002-06-28 10:44 UTC] vhoel99 at grm dot hia dot no
The system is a standard Slackware 7.1 with an self-compiled Apache.

As far as I know, this bug(s) came into PHP version 4.2.0, and are still in the snapshot dated 200206280600.
 [2002-06-28 11:28 UTC] sander@php.net
Can you generate a backtrace of the crash that happens when you compile with pgsql and gd so we can see what's going on?
What versions of pgsql and gd are you using?
Also, mysql (apparently) needs zlib, and therefore it's completely logical that configure complains about mysql & zlib when it can't find zlib. 
 [2002-06-28 13:47 UTC] vhoel99 at grm dot hia dot no
First of all, I am not that familiar with Core-dumps, GDB and Backtracing. So if I have done anything wrong; I am sorry, but please tell me what to do.

I did recompile Apache with "--without-execstrip", and PHP with "--enable-debug".

Then I compiled with both gd (2.0.1) and pgsql (7.2),
started gdb (gdb ./httpd) and the rest you see under:

<cut> 
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-slackware-linux"...
(gdb) run
Starting program: /usr/local/apache/bin/./httpd 
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.

Program received signal SIGSEGV, Segmentation fault.
0x401166d4 in strcmp () from /lib/libc.so.6
(gdb) bt
#0  0x401166d4 in strcmp () from /lib/libc.so.6
#1  0x4042213d in ?? ()
Cannot access memory at address 0x1
<cut>

Now to the zlib and mysql issue. Here is my config:
./configure --prefix=/usr/local \  --with-apxs=/usr/local/apache/bin/apxs \
--enable-exif \
--enable-track-vars \
--enable-magic-quotes \
--enable-ftp \
--with-openssl="/usr/local" \
--with-mysql=/usr/local \
--with-pgsql \
--enable-debug

You mean this should fail, because I try to use mysql, but does not specify to use Zlib, nor where zlib is located.

Here is (a part of) the output:
<cut>
Configuring extensions
checking if the location of ZLIB install directory is defined... no
checking for ZLIB support... no
<cut>
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... /tmp/mysql.sock
<cut>
checking for mysql_close in -lmysqlclient... yes
<cut>

As you can see, the configure script does not agree with you on the Zlib/MySQL issue :)

I hope this was helpful. If not, just tell me what to do.
 [2002-06-28 22:31 UTC] sniper@php.net
The first configure line of yours (in your initial report) works? But it segfaults when starting apache?

You could try this:

# cd /usr/src/apache_1.3.xx
# make clean
# LIBS=-lpthread ./config.status
# make
# make install

And then make sure your httpd is linked with pthread:

ldd /usr/local/apache/bin/httpd

The list should contain libpthread

 [2002-07-02 14:45 UTC] vhoel99 at grm dot hia dot no
I did what you suggested, and it is now linked. I get same error:

ldd /usr/local/apache/bin/httpd 
        libpthread.so.0 => /lib/libpthread.so.0 (0x40018000)
        libm.so.6 => /lib/libm.so.6 (0x4002a000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40046000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x40073000)
        libdb.so.3 => /lib/libdb.so.3 (0x40088000)
        libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x400c2000)
        libdl.so.2 => /lib/libdl.so.2 (0x400c9000)
        libc.so.6 => /lib/libc.so.6 (0x400cd000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

(gdb) run                       
Starting program: /usr/local/apache/bin/httpd 
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
                                
Program received signal SIGSEGV, Segmentation fault.
0x401286d4 in strcmp () from /lib/libc.so.6
(gdb) bt                        
#0  0x401286d4 in strcmp () from /lib/libc.so.6
#1  0x4041d13d in ?? ()         
Cannot access memory at address 0x1
 [2002-07-02 17:27 UTC] sniper@php.net
Try 'run -X' in gdb..should give better backtrace..

 [2002-07-02 19:44 UTC] sniper@php.net
assigning this to myself..

 [2002-07-03 19:08 UTC] sniper@php.net
Any news about this? (how did the tests without openssl work?)

 [2002-07-04 08:46 UTC] vhoel99 at grm dot hia dot no
If I do _not_ include OpenSSL support it works with both GD and Pgsql.
 [2002-07-11 16:50 UTC] sniper@php.net
You should make sure that pgsql is compiled/linked with
the same openssl libs as PHP is. Make sure you don't have
two versions of ssl libraries installed in your system, for example under /usr.



 [2002-09-11 11:27 UTC] sniper@php.net
no feedback.

 [2003-05-06 17:51 UTC] maryan2k at yahoo dot com
install the zlib from the .tar.gz package .. it has a dunno.. smth from the rpms.. and the zlib directory will be /usr/local/lib .. at least on my machine that is .. rh 9.0 system. hope this works for u too
 [2003-05-06 18:23 UTC] vhoel99 at grm dot hia dot no
It seems like it was OpenSSL problem. It was solved by downloading a new OpenSSL, and recompile OpenSSL first, then PostgreSQL and finally PHP.
I am, however, not sure exactly what was wrong.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC