Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.3K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 466 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
SIGSEGV on Instantclient 12.2+ (18.5, 19.6) with OCI8-2.2.0
Comments
-
Hi.
- It doesn't matter, if i set env vars before PHP or inside php script - result is always the same - sigsegv.
- LD_LIBRARY_PATH is ok and this is also managed by ld config files (/etc/ld.so.conf.d). Also ldd is correct on oci8.so
- Yes, that's expected and mentioned SQL is intentionally wrong (since X doesn't exists in dual)
- Do you use the same exact script? (foreach ($bax as $param => &$value) <-- note & before $value
I know, that DB OCI programmable interface have not so much controls due to the nature of this interface, but i would definitely not expect crash of the client - in any way.
Regards,
Stanislav
-
The same exact script doesn't sigsegv on 12.1 and older client. And yes, it returns ORA-00904.
Regards,
Stanislav
-
If you want, you can edit and use :
SELECT count(*) FROM dual WHERE (:p_per_id IS NULL OR :p_per_id = :p_per_id) AND :p_right_level_code = 'RA'
this will trigger SIGSEGV and is correct SQL.
-
I can also reproduce using php-cli with in-line env vars :
bash-4.4# ORACLE_HOME=/u01/app/oracle/client ORACLE_BASE=/u01/app/oracle NLS_LANG=AMERICAN_AMERICA.AL32UTF8 TNS_ADMIN=/u01/app/oracle/client/network/admin LD_LIBRARY_PATH=/u01/app/oracle/client/lib:/usr/lib:/lib php /www_base/testcase.php
Aborted (core dumped)
(putenv in php testcase script fully commented)
-
I tried on OL8.
dnf install -y php-xml php-devel php-cli php php-mbstring php-gd php-common php-pear php-json php-process
dnf install -y oracle-instantclient-release-el8
dnf install -y oracle-instantclient-basic oracle-instantclient-devel
echo "instantclient,/usr/lib/oracle/21/client64/lib" | pecl install oci8-2.2.0
Created the oci8 config file, as shown:
# cat /etc/php.d/99-oci8.ini
extension=oci8.so
oci8.connection_class=W3POOL
;oci8.events=on
oci8.statement_cache_size = 250
oci8.persistent_timeout = 3600
oci8.ping_interval = 10
-------------------------------------------------------------------------------
I used the script:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
$connection = oci_connect('cj', 'cj', 'mdt/orclpdb1:pooled', 'AL32UTF8');
$per_id = null;
$sql = "SELECT count(*) FROM dual WHERE (:p_per_id IS NULL OR :p_per_id = :p_per_id) AND :p_right_level_code = 'RA'";
$bax = array(
'p_per_id' => $per_id
,'p_right_level_code' => 'RA'
);
if ($connection === false) {
$m = oci_error($connection);
trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR);
}
$ociStatement = oci_parse($connection, $sql);
if ($ociStatement === false) {
$m = oci_error($connection);
trigger_error('Could not parse statement: '. $m['message'], E_USER_ERROR);
}
foreach ($bax as $param => &$value) {
if (!oci_bind_by_name($ociStatement, $param, $value, -1, SQLT_CHR )) {
$m = oci_error($ociStatement);
trigger_error('Could not bind a parameter: '. $m['message'], E_USER_ERROR);
}
}
if (!oci_execute($ociStatement, OCI_NO_AUTO_COMMIT)) {
$m = oci_error($ociStatement);
trigger_error('Could not execute statement: '. $m['message'], E_USER_ERROR);
}
oci_fetch_all($ociStatement, $r);
var_dump($r);
print("End\n")
?>
-------------------------------------------------------------------------------
Ran the script:
php t.php
array(1) {
["COUNT(*)"]=>
array(1) {
[0]=>
string(1) "1"
}
}
End
I tried both a 19.3 DB and a 21c DB.
At this stage, you need to continue working on it. You need to share enough info about your environment so I can spot what is going on. (E.g. to check that you don't have ORACLE_HOME set when you are using Instant Client). You have to 'prove' it to me by showing me.
At the same time, work on the test script and triple-check any possible weak point even if you 'know' it is not a problem: eliminate DRCP. Unroll the bind loop to eliminate the reference use; change the bind to let the type default; see if it is an issue with repeated use of the bind name, etc. etc.