php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16746 cgi php crash when running 'pear install Log-1.1.tgz'
Submitted: 2002-04-23 05:51 UTC Modified: 2002-04-30 17:34 UTC
From: klansman at arrakis dot dhis dot org Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.2.0 OS: FreeBSD 4.5
Private report: No CVE-ID: None
 [2002-04-23 05:51 UTC] klansman at arrakis dot dhis dot org
I use an apache webserver with the horde framework (written in php) and imp (webmail client).

Since php-4.2.0RC4 that horde+imp don't work. This behaviour is reported as an error:

[21-Apr-2002 22:03:56] PHP Warning:  Failed opening 'Log.php' for inclusion (include_path='.:/usr/local/services/php/lib/php:/var/services/web/common') in /var/services/web/horde/lib/Horde.php on line 141

obviously followed by:

[21-Apr-2002 22:03:56] PHP Fatal error:  Undefined class name 'log' in /var/services/web/horde/lib/Horde.php on line 151

I don't know much about php or PEAR: What i know is that prior to version 4.2.0RC4 it used to work fine. Also i checked under the php install ddirectory/lib/php/PEAR and there was a Log directory and a Log.php file in the "older" versions. Now (under 4.2.0RC4 and 4.2.0 that directory and file are no longer there. Also i checked the source directory and the files are there under the old (4.1.2) version but they are NOT there under 4.2.0. What happened?

Guess the problem doesn't lie on the configuration details, because in the recent versions, the files simply aren't there... Anyway, here it is:

--prefix=/usr/local/services/php-4.2.0 \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-gd-native-ttf \
--enable-mailparse \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--with-apxs2=/usr/local/services/apache-2.0.35/bin/apxs \
--with-openssl=/usr/local/libs/openssl \
--with-zlib=/usr/local/libs/zlib \
--with-bz2=/usr/local/libs/bzip2 \
--with-tsrm-pth=/usr/local/gnu/pth/bin/pth-config \
--with-gd=/usr/local/libs/gd \
--with-jpeg-dir=/usr/local/libs/jpeg \
--with-png-dir=/usr/local/libs/libpng \
--with-freetype-dir=/usr/local/libs/freetype \
--with-gettext=/usr/local/gnu/gettext \
--with-iconv=/usr/local/gnu/libiconv \
--with-imap=/usr/src/imap-2001a \
--with-mcrypt=/usr/local/libs/libmcrypt \
--with-mysql=/usr/local/services/mysql \
--with-zip=/usr/local/libs/zziplib

I checked pear.php.net/manual and there is the reference to the Log class, so i guess it wasn't replaced by something else...

I'm lost!

Can anyone help me?? please?

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-23 05:58 UTC] mj@php.net
Please get the Log class from http://pear.php.net/package-info.php?pacid=8 and place the copy in your PEAR directory.

- Martin
 [2002-04-29 07:05 UTC] klansman at arrakis dot dhis dot org
Ok, i got it, but now php gives a segmentation fault, core dumped.

What i did was to recompile php without the --with-apxs2 option in the configuration stage. Then with the cgi version i used the pear command to install the downloaded Log-1.1.tgz. 

'pear install /usr/src/Log-1.1.tgz'

I get a 'Segmentation Fault (core dumped)' and a 3.4MB php.core file in /usr/src.

I know that php.core can give you valuable information, but you must tell me first what can i do with it to send that information back to you.

I am sorry to insist on the 'bug' but when i got the segmentation fault from the php binary i thought this could be a bug (not the pear Log module, the segmentation fault).

Also i tried to simply copy the files in Log-1.1.tgz into /usr/local/services/php/lib/php but no success, horde still doesn't work.

Thank you for the help.
 [2002-04-29 07:21 UTC] mj@php.net
Could you perhaps try the latest PHP version from snaps.php.net and see if the problem persists?

- Martin
 [2002-04-29 09:13 UTC] klansman at arrakis dot dhis dot org
Hi!

I have just tried the latest available snap: php4-STABLE-200204290300

I encoutered some other problems:

1. The build process does not work with freebsd 4.5 byacc once i type gmake the script answers with the byacc command line. I tried another approach: installed bison and it was ok then.

2. when i try to install the cgi version the gmake install script replies with an error:

Making install in .
gmake[1]: Entering directory `/usr/src/php4-STABLE-200204290300'
gmake[1]: *** [install-sapi] Error 1
gmake[1]: Leaving directory `/usr/src/php4-STABLE-200204290300'
gmake: *** [install-recursive] Error 1

(i made a gmake clean and configured everything again between the apache module build and the cgi build)

Since i needed the php binary, i copied it into /usr/local/services/php/bin.

Tried 'pear install /usr/src/Log-1.1.tgz', same result: Segmentation Fault (core dumped)
Now the php.core is created not under /usr/src (where Log-1.1.tgz is) but in /usr/local/services/php/bin (where i called the pear script)

Please don't be confused about the directories i mention. The old 4.2.0 build was in it's own /usr/local/services/php-4.2.0 directory. /usr/local/services/php was just a symlink. When i compiled the 4.2.1-dev i simply changed the link to /usr/local/services/php-latest, so there is no way i was using the old php binary with the development version.

I still have that php.core... The answer to the latest comment is: unfortnately the problem persists. I am still unable to run horde.

I don't know if i have sent enough information; feel free to ask what is needed.

thank you (again).
 [2002-04-29 09:16 UTC] klansman at arrakis dot dhis dot org
(sorry, forgot to update the bug status to open)
 [2002-04-29 15:44 UTC] cox@php.net
This problem is not related to PEAR. Reclassified as Reproducible crash.

-- Tomas V.V.Cox

PS.- For the moment you could download the package, uncompress and install it by hand
 [2002-04-29 17:58 UTC] sniper@php.net
To properly diagnose this bug, we need a backtrace to see what is
happening behind the scenes. To find out how to generate a backtrace,
please read http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open".


 [2002-04-30 05:35 UTC] klansman at arrakis dot dhis dot org
After reading the backtrace explanation page, i recompiled the cgi php (with --enable-debug) just to be sure. Then i removed all the php.core that existed in the system and reproduced the crash.

root@arrakis:/usr/local/services/php/bin# ./pear install /usr/src/Log-1.1.tgz
Segmentation Fault (core dumped)

the core file was created under /usr/src

root@arrakis:/usr/local/services/php/bin# gdb ./php /usr/src/php.core
GNU gdb 4.18
Copyright 1998 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-unknown-freebsd"...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libpam.so.1...done.
Reading symbols from /usr/local/libs/zziplib-0.10.27/lib/libzzip-0.so.10...
done.
Reading symbols from /usr/local/libs/zlib/lib/libz.so...done.
Reading symbols from /usr/local/services/mysql-3.23.47/lib/mysql/libmysqlclient.so.10...done.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/local/libs/libmcrypt-2.4.22/lib/libmcrypt.so.6...
done.
Reading symbols from /usr/local/libs/libmcrypt-2.4.22/lib/libltdl.so.4...done.
Reading symbols from /usr/local/gnu/gettext-0.10.40/lib/libintl.so.1...done.
Reading symbols from /usr/local/gnu/libiconv-1.7/lib/libiconv.so.2...done.
Reading symbols from /usr/local/libs/freetype-2.0.8/lib/libfreetype.so.8...
done.
---Type <return> to continue, or q <return> to quit---
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/lib/libz.so.2...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  0x815b7cb in execute (op_array=0x0) at ./zend_execute.c:1602
1602                                                    EX(Ts)[EX(opline)->result.u.var].var.ptr->is_ref = 0;
(gdb) bt
#0  0x815b7cb in execute (op_array=0x0) at ./zend_execute.c:1602
(gdb)

That was it. end of instructions.

After another attempt of a manual install of the pear Log class, horde now works. Note that this did not happen when using 4.2.0, horde was not working after a manual installation of the pear Log class. So for the moment my horde problem is solved. It is a temporary fix, as i would like to use a release version with it and i cannot use 4.2.0 nor older versions because i am using apache 2.0.35.

If there is anything else you need, more information, more tests, a coffe maybe, please ask.

thank you for the help. hope you catch the bug soon!

Pedro.
 [2002-04-30 05:45 UTC] yohgaki@php.net
Are you sure /usr/src/php.core is the core file generaged from the php binary that is newly build with --enable-debug?

We cannot tell anything from your backtrace...
It seems you are feeding invalid core file to gdb most likely.

 [2002-04-30 13:54 UTC] klansman at arrakis dot dhis dot org
Hello again.

Before actually re-compiling everything from scratch to make sure it is compiled with debug symbols, i web to snaps.php.net to get the latest version. That is pear4-STABLE-200204300900.

I downloaded and compiled the package with the debug symbols. I was already getting ready to make a copy+paste of the events that would follow the next unsuccessfull attempt to use pear when suddently it worked. I guess the problem is fixed. Here is the log anyway

root@arrakis:/usr/local/services/php-3004/bin# date
Tue Apr 30 18:31:18 WEST 2002
root@arrakis:/usr/local/services/php-3004/bin# pwd
/usr/local/services/php-3004/bin
root@arrakis:/usr/local/services/php-3004/bin# ls -l
total 6312
-rwxr-xr-x  1 root  wheel     5975 Apr 30 18:09 pear*
-rwxr-xr-x  1 root  wheel     4344 Apr 30 18:09 pearize*
-rwxr-xr-x  1 root  wheel  6414440 Apr 30 18:08 php*
-rwxr-xr-x  1 root  wheel      565 Apr 30 18:09 php-config*
-rwxr-xr-x  1 root  wheel      593 Apr 30 18:09 phpextdist*
-rwxr-xr-x  1 root  wheel      736 Apr 30 18:09 phpize*
-rwxr-xr-x  1 root  wheel     5106 Apr 30 18:09 phptar*
root@arrakis:/usr/local/services/php-3004/bin# ./pear install /usr/src/Log-1.1.tgz
installed file /usr/local/services/php-3004/lib/php/Log.php
installed file /usr/local/services/php-3004/lib/php/Log/composite.php
installed file /usr/local/services/php-3004/lib/php/Log/console.php
installed file /usr/local/services/php-3004/lib/php/Log/file.php
installed file /usr/local/services/php-3004/lib/php/Log/mcal.php
installed file /usr/local/services/php-3004/lib/php/Log/observer.php
installed file /usr/local/services/php-3004/lib/php/Log/sql.php
installed file /usr/local/services/php-3004/lib/php/Log/syslog.php
install ok
./zend_execute.c(1727) :  Freeing 0x086653E4 (12 bytes), script=./pear
Last leak repeated 2 times
./zend_execute.c(1730) :  Freeing 0x086653A4 (15 bytes), script=./pear
zend_variables.c(106) : Actual location (location was relayed)
Last leak repeated 2 times
root@arrakis:/usr/local/services/php-3004/bin#

After that i compiled it again as an apache2 module and tested horde. Before that, make install script failed with error code 1. I tried to install the module by hand and restarted apache. horde worked.

Please mark this bug as 'closed' if you think it is really closed. Thank you for everything.
 [2002-04-30 17:34 UTC] sniper@php.net
Reopen if you get this same problem with PHP 4.2.1

 [2002-05-14 11:57 UTC] klansman at arrakis dot dhis dot org
This problem does not exist under the current version (4.2.1)

everything works fine.

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 08:01:28 2024 UTC