Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 341629 - dev-lang/php-5.3.3-r1: crash when using ibase_trans with arguments
Summary: dev-lang/php-5.3.3-r1: crash when using ibase_trans with arguments
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL: http://de3.php.net/manual/en/function...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-18 12:48 UTC by Matthias Hanft
Modified: 2011-01-12 17:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Hanft 2010-10-18 12:48:06 UTC
When using ibase_trans in a PHP script, with the database link identifier as argument, Apache's child process crashes with "Illegal Instruction (4)".

Works flawlessly with older PHP version dev-lang/php-5.2.14.

Reproducible: Always

Steps to Reproduce:
Write a PHP script to access an Interbase/Firebird database, for example a customer database, as follows:

<?php
$db = ibase_connect("server:database", "user", "pass", "latin1", 0, 3);
$stmt='select * from CUSTOMERS where ID=?;';
$trans=ibase_trans(IBASE_DEFAULT, $db); // just ($db) doesn't work either
$prep=ibase_prepare($trans, $stmt);
$res=ibase_execute($prep, 101); // get customer # 101
if ($row=ibase_fetch_assoc($res)) // found
  echo $row['FIRSTNAME'];
ibase_free_result($res);
ibase_free_query($prep);
ibase_commit($trans);
ibase_close($db);
?>
Actual Results:  
[Mon Oct 18 14:28:01 2010] [notice] child pid 23752 exit signal Illegal instruction (4)

(Apache's error log file.)

Expected Results:  
Start a transaction on the given link identifier.

Possible workarounds:

1.) Omit any arguments. Then, ibase_trans just uses the last ibase_connect database. (Not usable in my case because I have many databases open and cannot guarantee that ibase_trans immediately follows ibase_connect of the same database.)

2.) Leave the transaction away and just use the link identifier for ibase_prepare:

<?php
$db = ibase_connect("server:database", "user", "pass", "latin1", 0, 3);
$stmt='select * from CUSTOMERS where ID=?;';
$prep=ibase_prepare($db, $stmt);
$res=ibase_execute($prep, 101); // get customer # 101
if ($row=ibase_fetch_assoc($res)) // found
  echo $row['FIRSTNAME'];
ibase_free_result($res);
ibase_free_query($prep);
ibase_close($db);
?>

This works, but I don't know what happens in the background regarding transactions (possibly an implicit auto-committed transaction when the script ends). But I'd rather use explicit transactions (and removing each and every transaction in all of my PHP scripts would cause rewriting tons of code).



Portage 2.1.8.3 (hardened/linux/x86/10.0, gcc-4.3.4, glibc-2.11.2-r0, 2.6.32-gentoo-r7 i686)
=================================================================
System uname: Linux-2.6.32-gentoo-r7-i686-Intel-R-_Pentium-R-_4_CPU_3.00GHz-with-gentoo-1.12.13
Timestamp of tree: Fri, 15 Oct 2010 10:15:02 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.4.6, 2.5.4-r4, 2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.4_p6-r1, 1.5-r1, 1.6.3-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       3.4.6-r2, 4.1.2, 4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA PUEL"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/fax /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.gentoo.mesh-solutions.com/gentoo/ http://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.intergenia.de"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://gentoo.osn.de/gentoo-portage"
USE="acl apache2 authdaemond bash-completion berkdb bzip2 capi cdr cgi cli community courier cracklib crypt ctype cups curl curlwrappers cxx doc dri dvd dvdr dvdread encode examples exif fam fbcon firebird ftp gd gdbm geoip gif gnutls gpm graphviz gs hardened iconv idn imap ipv6 jadetex jbig jpeg kpathsea latin1 ldap libcaca libssh2 lm_sensors lua mad mime modules mp3 mudflap mysql mysqli ncurses network network-cron nls nptl nptlonly odbc ogg openmp pam passwordsave pcntl pcre pdf pdo perl php pic pkcs11 png posix postfix ppds pppd python readline reflection rrdcgi samba sasl sensord session sharedext sharedmem slp soap sockets spl spoof-source ssl svg sysfs syslog sysvipc tcl tcpd tidy tiff tk tokenizer tools truetype urandom usb vdr vhosts vim-syntax vorbis wddx win32codecs x86 xml xmlrpc xorg xsl zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1       emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m       maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mbstring mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias xsl" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" FRITZCAPI_CARDS="fcpci" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php-5.2" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel       mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage      siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware     voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Matti Bickel (RETIRED) gentoo-dev 2010-12-22 23:01:44 UTC
First: sorry you had to wait that long.
Second: i gather you're using firebird, not interbase? I tried to reproduce this using firebird-2.0.3.12981.0-r6 and php-5.3.4.
Long story short: I can't. I've set up a db on /tmp/test.db and had sysdba/masterkey access it and query for RDB$RELATIONS via cli. Query returns fine, even with positional parameters for kicks.

Can you retry and reproduce this on php-5.3.4?
Thanks!
Comment 2 Matthias Hanft 2010-12-31 18:02:53 UTC
Had some trouble with upgrading to 5.3.4 at first (some blocking packages; problem with pecl-http as in bug 349245; and some more), but finally succeeded, and the error has gone away with 5.3.4. So it seems to be a temporary fault in 5.3.3-r1.
Thank you - and: Happy New Year! :-)
Comment 3 Matthias Hanft 2011-01-12 17:11:47 UTC
BTW: 5.3.5 still works.