perlsegmentation-faultexitoracleclientdbd

Perl DBI + DBD::Oracle crashes at exit on newer glibc versions


I'm encountering a crash at exit(0) in a simple Perl script using DBI with DBD::Oracle, specifically when running on newer versions of glibc.

Here’s a minimal script to reproduce the issue:

use DBI;

my $db_string = "dbi:Oracle:host=your_host;sid=your_sid";
my $user      = "your_user";
my $passwd    = "your_password";

my $dbh = DBI->connect($db_string, $user, $passwd, {
    RaiseError => 0,
    PrintError => 0,
});

if (!$dbh) {
    warn "DB connect failed: $DBI::errstr\n";
    exit(1);
}

my $sth = $dbh->prepare("SELECT 1 FROM dual");
$sth->execute();
$sth->finish();

# $dbh->{InactiveDestroy} = 1;  

$dbh->disconnect();

# Crash happens here
exit(0);

Observations:

  1. If I uncomment $dbh->{InactiveDestroy} = 1;, the crash still happens.

  2. The crash occurs only on systems with newer glibc versions.

  3. I suspect it's related to cleanup/finalization logic inside
    DBD::Oracle.

  4. The issue likely stems from how Oracle’s shared libraries interact
    with glibc and Perl destructors, not specific versions alone.

Questions:

Has anyone else experienced this? Is this a known issue with DBD::Oracle and glibc? Any recommended workarounds or patches? Environment:

Perl version: 5.32 DBD::Oracle version: 1.80/90 Oracle Instant Client: 19.19, 23.7 OS: RHEL 9.5 9.5 (Plow) Discovered a glibc version difference between stable and crashing hosts: Crashing: glibc-2.34-125.el9_5.8.x86_64 Stable: glibc-2.34-125.el9_5.1.x86_64

Any pointers or insights are appreciated!


Solution

  • There is a bug with glibc glibc-2.34-125.el9_5.8 and DBD::Oracle, upgrading to a later version like the 9.6 beta: glibc-2.34-168.el9.x86_64 or downgrading to a previous version will fix this.

    See Also: https://github.com/perl5-dbi/DBD-Oracle/issues/189