php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11081 php crashes when using oci functions (8.1.7.0.1)
Submitted: 2001-05-24 07:14 UTC Modified: 2002-04-13 08:31 UTC
Votes:7
Avg. Score:5.0 ± 0.0
Reproduced:7 of 7 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (14.3%)
From: ronan dot salmon at staff dot ittralee dot ie Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0.5 OS: Red Hat Linux release 7.0 Kernel
Private report: No CVE-ID: None
 [2001-05-24 07:14 UTC] ronan dot salmon at staff dot ittralee dot ie
Hi,

Red Hat Linux release 7.0 (Guinness)
Kernel 2.4.2 on an i686
PHP 4.0.5
Oracle 8.1.7.0.1


I rebuild php with --enable-debug but it looks like that gdb can't ready the debug info.

php works fine if I don't use oci8 functions. And if I use oci8 functions, it just crashes.

Ronan

--------------------------------------------------------
php+oci8+right oracle login :
# gdb /usr/bin/php 
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-redhat-linux"...(no debugging symbols found)...
(gdb) set args oci8-test.php3
(gdb) run
Starting program: /usr/bin/php oci8-test.php3
(no debugging symbols found)...[New Thread 1024 (LWP 1677)]
X-Powered-By: PHP/4.0.5
Content-type: text/html

Looking good:-)Bye...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 1677)]
0x40877cbc in ?? ()
(gdb) 

----------------------------------------------------------
php+oci8+wrong oracle login :
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php oci8-test.php3
(no debugging symbols found)...[New Thread 1024 (LWP 1684)]
X-Powered-By: PHP/4.0.5
Content-type: text/html

<br>
<b>Warning</b>:  OCISessionBegin: ORA-01017: invalid username/password; logon denied
 in <b>oci8-test.php3</b> on line <b>10</b><br>
oci8-test.php3(10) : Warning - OCISessionBegin: ORA-01017: invalid username/password; logon denied

Looking good:-)Bye...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 1684)]
0x40877cbc in ?? ()
(gdb) 

---------------------------------------------------------
[/vweb/csweb/html]# more oci8-test.php3 
<?

putenv("ORACLE_HOME=/opt/oracle/Oralce-8.1.7.0.1");
putenv("TWO_TASK=/opt/oracle/Oralce-8.1.7.0.1/network/admin/tnsnames.ora");
putenv("TNS_ADMIN=/opt/oracle/Oralce-8.1.7.0.1/network/admin");
$user = "xxxxx";
$passwd = "xxxxx";
$strDB = "xxxxx";

$db = ocilogon($user, $passwd, $strDB);

if (! $db)
{
	$err = OCIError();
	if ($err[ "code" ] == "12545")
	{
		echo "target host or object does not exist\n";
		die();
	}
}

echo "Looking good:-)";
ocilogoff($conn);
echo "Bye...";

?>

----------------------------------------------------------
php4.spec :

%define version 4.0.5
%define so_version 4
%define release 1

Name: php
Summary: PHP: Hypertext Preprocessor
Group: Development/Languages
Version: %{version}
Release: %{release}
Copyright: The PHP license (see "LICENSE" file included in distribution)
Source: http://www.php.net/version4/downloads/php-%{version}.tar.gz
Icon: php4.gif
URL: http://www.php.net/
Packager: PHP Group <group@php.net>

BuildRoot: /var/tmp/php-%{version}

%define contentdir /var/www

%description
PHP is an HTML-embedded scripting language. Much of its syntax is
borrowed from C, Java and Perl with a couple of unique PHP-specific
features thrown in. The goal of the language is to allow web
developers to write dynamically generated pages quickly.

%package oci8
Group: Development/Languages
Prereq: php = %{version}-%{release}, perl
Obsoletes: mod_php3-oci8
Summary: A module for PHP applications that use Oracle 8i.

%description oci8
The php-oci8 package contains a dynamic shared object that will add OCI8
support to PHP.

%package ldap
Group: Development/Languages
Prereq: php = %{version}-%{release}, perl
Obsoletes: mod_php3-ldap
Summary: A module for PHP applications that use LDAP.
BuildPrereq: openldap-devel
Requires: openldap

%description ldap
The php-ldap package contains a dynamic shared object that will add LDAP
(Lightweight Directory Access Protocol) support to PHP. LDAP is a set
of protocols for accessing directory services over the Internet.
PHP is an HTML-embeddable scripting language.  If you need LDAP support
for PHP applications, you will need to install this package and the php
package.

%prep

%setup
set -x

./buildconf

%build
set krb5libs="-L/usr/kerberos/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
ssllibs="-lssl -lcrypto"
sasllibs="-lsasl $krb5libs $ssllibs"

CFLAGS="$RPM_OPT_FLAGS -fPIC"; export CFLAGS
LIBS="-lttf -lpng -ljpeg -lz"; export LIBS

compile() {
./configure \
	--prefix=%{_prefix} \
	--with-config-file-path=%{_sysconfdir} \
	--enable-debug \
	--enable-pic \
	--enable-shared \
	--enable-inline-optimization \
	$* \
	--with-exec-dir=%{_bindir} \
	--with-regex=system \
	--with-gettext \
	--with-gd \
	--with-jpeg-dir=%{_prefix} \
	--with-png \
	--with-zlib \
	--with-db2 \
	--with-db3 \
	--with-gdbm \
	--enable-debugger \
	--enable-magic-quotes \
	--enable-safe-mode \
	--enable-sockets \
	--enable-sysvsem \
	--enable-sysvshm \
	--enable-track-vars \
	--enable-yp \
	--enable-ftp \
	--enable-wddx \
	--without-mysql \
	--without-oracle \
	--without-oci8 \
	--enable-sigchild \
	--with-xml
make
}

# Build a standalone binary.
make distclean || :
compile --enable-force-cgi-redirect
cp php php_standalone

# Build a module.
make distclean
compile --with-apxs=%{_sbindir}/apxs

# Build individual PHP modules.
build_ext() {
%{__cc} -fPIC -shared $RPM_OPT_FLAGS -DHAVE_CONFIG_H \
	-DCOMPILE_DL_`echo $1 | tr '[a-z]' '[A-Z]'` \
	-DHAVE_`echo $1 | tr '[a-z]' '[A-Z]'` \
	-I. -I./TSRM -I./main -I`%{_sbindir}/apxs -q INCLUDEDIR` -I./Zend \
	-I/usr/include/freetype -I/usr/include/$1 \
	-I./ext/$1 -I./ext/$1/lib$1 \
	-I./ext/xml/expat/xmltok -I./ext/xml/expat/xmlparse \
	`grep ^CPPFLAGS Zend/Makefile | cut -f2- -d=` \
	$4 $2 -o $1.so -L.libs $3 -lc
}
build_ext ldap ext/ldap/ldap.c "-lldap -llber"
build_ext oci8 ext/oci8/oci8.c "-I/opt/oracle/Oralce-8.1.7.0.1/rdbms/demo -I/opt/oracle/Oralce-8.1.7.0.1/rdbms/public -L/opt/oracle/Oralce-8.1.7.0.1/lib -lclntsh"


%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}/{apache,php4}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd
mkdir -p $RPM_BUILD_ROOT%{contentdir}/icons
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -m 755 php_standalone $RPM_BUILD_ROOT%{_bindir}/php
install -m 755 .libs/libphp4.so $RPM_BUILD_ROOT%{_libdir}/apache/
strip -g $RPM_BUILD_ROOT%{_libdir}/apache/*
install -m 755 ldap.so $RPM_BUILD_ROOT%{_libdir}/php4/
install -m 755 oci8.so $RPM_BUILD_ROOT%{_libdir}/php4/
strip -g $RPM_BUILD_ROOT%{_libdir}/php4/*
install -m 644 php.ini-dist $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
install -m 644 *.gif $RPM_BUILD_ROOT%{contentdir}/icons/

# pear and development files
%{makeinstall} -C pear peardir=$RPM_BUILD_ROOT%{_datadir}/php
for file in php-config phpextdist phpize ; do
	perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_bindir}/${file}
done

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%triggerpostun -- php <= 3.0.15-1
perl -pi -e 's|^#LoadModule php3_module|LoadModule php3_module|g' \
	/etc/httpd/conf/httpd.conf
perl -pi -e 's|^#AddModule mod_php3.c|AddModule mod_php3.c|g' \
	/etc/httpd/conf/httpd.conf

%files
%defattr(-,root,root)
%config %{_sysconfdir}/php.ini
%{_bindir}/php
%{_datadir}/php
%{_libdir}/apache/libphp4.so

%files ldap
%defattr(-,root,root)
%{_libdir}/php4/ldap.so

%post ldap
%{__perl} -pi -e "s|^;extension=ldap.so|extension=ldap.so|" %{_sysconfdir}/php.ini

%preun ldap
if [ $1 = 0 -a -f %{_sysconfdir}/php.ini ] ; then
  %{__perl} -pi -e "s|^extension=ldap.so|;extension=ldap.so|" %{_sysconfdir}/php.ini
fi

%files oci8
%defattr(-,root,root)
%{_libdir}/php4/oci8.so

%post oci8
%{__perl} -pi -e "s|^;extension=oci8.so|extension=oci8.so|" %{_sysconfdir}/php.ini

%preun oci8
if [ $1 = 0 -a -f %{_sysconfdir}/php.ini ] ; then
  %{__perl} -pi -e "s|^extension=oci8.so|;extension=oci8.so|" %{_sysconfdir}/php.ini
fi

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-24 15:48 UTC] sniper@php.net
Is your Apache linked with libpthread?
Check the manual page:

http://www.php.net/oci8

There are instructions how to do it.
reopen this bug report if this doesn't help you.

--Jani

 [2001-05-28 10:10 UTC] ronan dot salmon at staff dot ittralee dot ie
Hi,

I'm not using apache yet because PHP doesn't work alone.
Check again how I test php.
I compiled php as standalone as well.

Ronan.
 [2001-05-30 07:42 UTC] ronan dot salmon at staff dot ittralee dot ie
It's the same probleme with PHP 4.0.4pl1

Ronan
 [2002-04-13 08:31 UTC] thies@php.net
please do not use PutEnv to set the oracle env-vars. this is know to cause trouble. set them via setenv (csh) or export (bash).

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 04:01:27 2024 UTC