php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6798 IFX queries fail, SQLCODE -480 (dup. descriptors)
Submitted: 2000-09-18 00:40 UTC Modified: 2001-10-23 11:29 UTC
From: jim at ark dot org Assigned:
Status: Closed Package: Informix related
PHP Version: 4.0.2 OS: Solaris 2.5.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jim at ark dot org
New email:
PHP Version: OS:

 

 [2000-09-18 00:40 UTC] jim at ark dot org
Setup: PHP 4.0.2 running under Netscape Enterprise 3.6SP1 on a Solaris 2.5.1/SPARC server.  Informix-SE v7.23.UC9, Informix ESQL/C 7.24.UC7.

My $INFORMIXDIR/etc/sqlhosts entry for the database looks like this:
foo_se       seipcpip            foo           sqlexec
(which works under other langs)
There are no non-default ifx.* entries in my php.ini file.

After connecting to database foo, the first sql query fails consistently every other time, with SQLCODE -480.  I get the following error:
<b>Warning</b>:  Allocate desciptor <descrpb> fails (E [SQLSTATE=IX 000  SQLCODE=-480]) in <b>/web/shtml/development/esd/unempins/emps.php</b> on line <b>275</b><br>
Invalid query SELECT * FROM emps WHERE esdid=123456789

and the script quits.  I looked up -480 and it means that a duplicate descriptor already exists.  I'm closing all my db connections so I don't know why this is happening (I did read the prior bug report about when Zend really releases the resource).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-20 02:47 UTC] danny@php.net
Is this the NSAPI version ?
Is the thread-safe code enabled ?

Descriptor names are generated from a global or thread  
variable depending on the compilation options.

It looks like you are using a thread-enabled php version with a non-thread enabled Informix build (esql -thread option).

The Apache module and the CGI version are the only ones I can test.

Please give me some more inforation, like your configure script.

Danny
---
 [2000-09-20 04:27 UTC] jim at ark dot org
Yes, this is the NSAPI version.  I haven't done anything w/threads.  Here's the configure line I use:
[root@ina php-4.0.2]# ./configure --with-nsapi=/web --with-pdflib --with-cybercash=/ina/mck-3.2.0.4-solaris-sparc --with-gdbm --with-dom=/usr/local --with-fdftk --enable-ftp --with-gd=../gd-1.8.3 --with-ttf --with-imap --with-informix=/usr/local/informix --with-mysql=/usr/local/mysql --with-esoob=/usr/local/easysoft/oob/client --enable-wddx --enable-trans-sid

Should I be adding one of the tsrm options?

If you relevant parts of config.log, I can add those as well.
 [2000-09-21 02:22 UTC] danny@php.net
I had a look at the nsapi.c source, and it needs "ZTS" defined, so I think --with-nsapi enables threads.

The Informix driver has never been tested with threads.

The code is supposed to be thread-safe, but you need to add
the -thread compiler flag to the esql command to link in 
the Informix thread-safe libraries.

Best way to test this would be to edit the configure script 
I guess.

Even then, I don't know if different threads within the same process are allowed the use of the same descriptor 
names. The driver currently has a "globals" area per thread when compiled with ZTS, so that each thread has it's own 
counters for generating the cursor names, descriptor names etc..., so that all threads will end up with the same 
sequence of genereated names.

With the Apache module, each instance of PHP4 resides within a different Unix process, so that name clashes are not possible.

I could use process-global variables instead for this, but 
then I would have to protect them with critical sections
or mutexes. This way the names would be unique within the 
same process regardless of the number of threads at the 
expense of some overhead.
I don't know what the PHP4 way of doing mutexes is, as I
have never needed this before, I will have to investigate
this.

Danny
---

 

 [2000-11-01 12:14 UTC] sniper@php.net
I guess this one should be 'assigned' not 'feedback' ?

--Jani
 [2001-10-23 11:29 UTC] sniper@php.net
This is should be fixed in CVS.
Try the latest CVS snapshot from http://snaps.php.net/
and reopen this bug report if you get the same
problems.

--Jani

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 12:01:26 2019 UTC