Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

DBI throwing segmentation fault

by ksbehal (Acolyte)
on Nov 29, 2018 at 07:34 UTC ( [id://1226485]=perlquestion: print w/replies, xml ) Need Help??

ksbehal has asked for the wisdom of the Perl Monks concerning the following question:

I installed Perl DBI/ DBD::Oracle modules in Linux box, I also installed a Oracle instant client in the same box. But when I am executing DBI->connect(); with required parameters it is throwing "Segmentation fault". Please help and suggest way out!!

Replies are listed 'Best First'.
Re: DBI throwing segmentation fault
by marto (Cardinal) on Nov 29, 2018 at 08:13 UTC

    Did DBD::Oracle install without any problems? In your post you mention the instant client installation after the perl stuff, you had this installed before you built the perl stuff, right? From experience you often get more information when a segmentation fault occurs, please post exactly what is displayed. What do LD_LIBRARY_PATH and ORACLE_HOME contain?

      my code snippet which makes connection and the variables used in connection string is already having valid values defined

      %attr = ( PrintError => 1, RaiseError => 1, ); $driver= "Oracle"; $dsn = "DBI:$driver:sid=$db_name;host=$host"; eval { $dbh = DBI->connect($dsn, "$user", "$passwd", \%attr); };if($@){ print "ERROR with connection: $@\n"; } print "Hello"; o/p: [lroot@slc11zrg ~]# perl_5.22 db.pl HelloSegmentation fault

      Existing conf: Oracle Linux 7.x, Perl5.16 already installed Process I followed:-

      1. installed CPAN manually
      2. installed DBI make install says ok
      3. Installed Oracle instant client in the same linux box
      4. DBD::Oracle make install completed ok, but can see logs like "cant establish oracle connection"
      5. Installed other required modules
      my ENV variables in bash_profile:

      export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib export ORACLE_HOME=/usr/lib/oracle/12.2/client64/

      both paths are good and contain the Oracle instant client

      Please let me know If I can give any further inputs.

      Thanks,
      Kuldip

      2018-12-01 Athanasius added list and extra paragraph tags

        "perl_5.22 db.p" ... "Perl5.16", do you have multiple versions of perl installed?

        'but can see logs like "cant establish oracle connection"'

        You'll see these unless you set some environment variables before installing. See Re^3: DBI AND ORACLE 8 and the module documentation.

Re: DBI throwing segmentation fault
by thanos1983 (Parson) on Nov 29, 2018 at 08:40 UTC

    Hello ksbehal,

    Welcome to the Monastery. I was looking through the web regarding your problem and I found this article (Segmentation Fault (core dumped) while connecting to Oracle using DBD::Oracle):

    ...After having spent several useless hours trying to find an answer to this question on both Google and Metalink, and then trying to decipher stack trace output from core dump, it turns out that there was no setting in my .profile (in some cases, .bash_profile) file for LD_LIBRARY_PATH.

    Can you execute this on your LinuxOS terminal as fellow Monk marto is proposing:

    $ echo $LD_LIBRARY_PATH

    It should return the $ORACLE_HOME/lib directory. If it does not return anything you need to set the .profile (in some cases, .bash_profile) file for LD_LIBRARY_PATH.

    Let us know if this resolves your problem.

    Best Regards, Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!

      I have the LD_LIBRARY_PATH and ORACLE_HOME updated in .bash_profile already

      export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib export ORACLE_HOME=/usr/lib/oracle/12.2/client64/ [lroot@slc11zrg ~]# echo $LD_LIBRARY_PATH /usr/lib/oracle/12.2/client64/lib [lroot@slc11zrg ~]# echo $ORACLE_HOME /usr/lib/oracle/12.2/client64/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1226485]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-03-29 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found