Skip to content

The connect, ping, disconnect trio result in SEGV #185

@ancientwizard

Description

@ancientwizard

I have a PERL script that reproduces this SEGV issue. Strictly speaking the SEGV still happens if the ping step is skipped.

Also I have C program that has roughly the same trio but it does not cause SEGV's. It's not definitive but suggests the issue isn't with the OS or Oracle instant client but with Perl or the DBD:Oracle. This C program has been compiled in the office on RHEL8 & RHEL9. It runs as expected without error as long as you have an Oracle DB and a login

You may need to change the Make file depending how you install oracle instantclient; I used Oracle 23.7.
$ export ORA_SCHEMA=TESTUSER
$ export ORACLE_HOME=/usr/lib/oracle/23/client64
$ export ORA_DBNAME=ORA19C (my server is 19c so it is at work also)
$ export ORACLE_SID=orcl
$ export ORA_PASSWD=BLAHBLAH
$ make
$ ./db-thread -t 5
segv-debug-c.tar.gz
UPDATE: this "C" program has an instability however it's my fault (and CoPilot) I have an updated version that corrects an oversight and I have found it to be rock solid. I have a repo in my space with the fix.

The Perl script is provided below. It has been used with all final versions of Perl from 5.30.3 to 5.40.2; same SEGV results. RHEL8/9. At home I'm using CentOS and Ubuntu.

Confession & Issues

  • I don't normally run the tests that are built into this module; not for many years
  • My apps test set is HUGE and if something is hinky with any feature it uses; it's not likely to be missed.
  • I figured it might be time to rethink this position. I ran into some issues.
  • The tests all assume an EMPTY/BLANK password. My DB is 19c and even with the help of AI I was unable to create an account with an empty password.
  • While it's possible to create it with a password of " " (single space) login was still impossible.
  • I was forced to put a password on the account and update the test scripting to use a hard coded password. It's not like the account is going be used in PRODUCTION or be given any additional GRANTS it won't need. It's just my test rig at home running VM's
  • The tests should make noise telling the reader A) what vars to set B) what hard coded password to use. OR the recipe to make Oracle submit for the test user alone. I suspect it written somewhere, I didn't easily find it so I read the code. Even the AI guessed wrong.
  • a couple of the built-in test scripts barf out redefined Perl functions; if it's expected its just noise and could hide something important. I see they are in DBI :( otherwise I would have disabled the warning.

This Seems Ugly

t/rt85886.t ............... 1/2 
#   Failed test 'ivok'
#   at t/rt85886.t line 49.
SV = PV(0x5876a916e9c0) at 0x5876a9318ab0
  REFCNT = 1
  FLAGS = (POK,pPOK)
  PV = 0x5876a9330ee0 "1"\0
  CUR = 1
  LEN = 16
# Looks like you failed 1 test of 2.
t/rt85886.t ............... Dubious, test returned 1 (wstat 256, 0x100)

- And if run enough times your own test SEGV's

t/15threads.t           (Wstat: 139 (Signal: SEGV, dumped core) Tests: 0 Failed: 0)
  Non-zero wait status: 139
  Parse errors: No plan found in TAP output

- And this is random

t/16cached.t .............. Can't call method "prepare" on an undefined value at /banktools/trustguardian/git/DBD-Oracle-AW/t/cache2.pl line 21.
t/16cached.t .............. 1/? 
#   Failed test 'clean termination with multiple cached connections'
#   at t/16cached.t line 26.
# Looks like you failed 1 test of 1.
t/16cached.t .............. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions