Segfault with DBD::Oracle 1.17 under mod_perl
Segfault with DBD::Oracle 1.17 under mod_perl
am 18.07.2006 22:28:38 von bmaust
------=_Part_31852_28040829.1153254518471
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
I built DBD::Oracle 1.17 on a RHEL AS4 machine using the Instant Client
libraries. I can use it and DBI 1.48 quite successfully to connect to our
Oracle 10 server via CGI or command-line perl.
The same code, however, segfaults with the stack trace attached below when
run in a mod_perl environment. Each thread connects to the database
succesfully (as verified by v$session), but dies whenever I call execute()
on a statement handle (prepare is ok).
I'm not really sure where to go from here. ldd doesn't list any unresolved
dependencies for libclntsh (see below), but at runtime it can't locate some
symbols? I didn't see any other reports of this in google, but there were
some mentions of segfaults if $ORACLE_HOME is not set. I don't have that in
my command-line environment (where SELECTs work), so I crossed that off my
list of potential problems.
stack dump from gdb attached to httpd:
#0 0x00784416 in do_lookup_x () from /lib/ld-linux.so.2
#1 0x00784822 in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
#2 0x00787be6 in fixup () from /lib/ld-linux.so.2
#3 0x00787b20 in _dl_runtime_resolve () from /lib/ld-linux.so.2
#4 0x064e4be6 in kpuexInitStmh () from /usr/lib/libclntsh.so.10.1
#5 0x064e52e9 in kpuexCallback () from /usr/lib/libclntsh.so.10.1
#6 0x06866e31 in ttcdrv () from /usr/lib/libclntsh.so.10.1
#7 0x0674e244 in nioqwa () from /usr/lib/libclntsh.so.10.1
#8 0x065bb27c in upirtrc () from /usr/lib/libclntsh.so.10.1
#9 0x06530b52 in kpurcsc () from /usr/lib/libclntsh.so.10.1
#10 0x064e6407 in kpuexecv8 () from /usr/lib/libclntsh.so.10.1
#11 0x064e8987 in kpuexec () from /usr/lib/libclntsh.so.10.1
#12 0x065bfe1e in OCIStmtExecute () from /usr/lib/libclntsh.so.10.1
#13 0x004bd44d in ora_describe () from
/home/bmaust/lib/auto/DBD/Oracle/Oracle.so
#14 0x004c0418 in ora_st_prepare () from
/home/bmaust/lib/auto/DBD/Oracle/Oracle.so
#15 0x004a91e9 in XS_DBD__Oracle__st__prepare () from
/home/bmaust/lib/auto/DBD/Oracle/Oracle.so
#16 0x01028a82 in Perl_pp_entersub () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#17 0x0100be8d in Perl_runops_debug () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#18 0x00fb6ae6 in Perl_get_cv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#19 0x00fbcc7e in Perl_call_sv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#20 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d781a8) at
DBI.xs:2674
#21 0x01028a82 in Perl_pp_entersub () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#22 0x0100be8d in Perl_runops_debug () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#23 0x00fb6ae6 in Perl_get_cv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#24 0x00fbcc7e in Perl_call_sv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#25 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d786f4) at
DBI.xs:2674
#26 0x01028a82 in Perl_pp_entersub () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#27 0x0100be8d in Perl_runops_debug () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#28 0x00fb6ae6 in Perl_get_cv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#29 0x00fbcea7 in Perl_call_sv () from
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
#30 0x00ac7cf4 in modperl_callback () from /etc/httpd/modules/mod_perl.so
#31 0x00ac84cb in modperl_callback_run_handlers () from
/etc/httpd/modules/mod_perl.so
#32 0x00ac878a in modperl_callback_per_dir () from
/etc/httpd/modules/mod_perl.so
#33 0x00ac3560 in modperl_response_finish () from
/etc/httpd/modules/mod_perl.so
#34 0x00ac3638 in modperl_response_handler () from
/etc/httpd/modules/mod_perl.so
#35 0x001969b7 in ap_run_handler () from /usr/sbin/httpd
#36 0x00196e23 in ap_invoke_handler () from /usr/sbin/httpd
#37 0x001938b5 in ap_process_request () from /usr/sbin/httpd
#38 0x0018e63f in _start () from /usr/sbin/httpd
#39 0x094da368 in ?? ()
#40 0x00000004 in ?? ()
#41 0x094da368 in ?? ()
#42 0x00adbd89 in modperl_process_connection_handler () from
/etc/httpd/modules/mod_perl.so
#43 0x001a1329 in ap_run_process_connection () from /usr/sbin/httpd
#44 0x001a1694 in ap_process_connection () from /usr/sbin/httpd
#45 0x00194901 in ap_graceful_stop_signalled () from /usr/sbin/httpd
#46 0x00194b44 in ap_graceful_stop_signalled () from /usr/sbin/httpd
#47 0x001952fa in ap_mpm_run () from /usr/sbin/httpd
#48 0x0019c34a in main () from /usr/sbin/httpd
$ ldd /usr/lib/libclntsh.so
libnnz10.so => /usr/lib/libnnz10.so (0x00111000)
libdl.so.2 => /lib/libdl.so.2 (0x00316000)
libm.so.6 => /lib/tls/libm.so.6 (0x004e7000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0031a000)
libnsl.so.1 => /lib/libnsl.so.1 (0x0032c000)
libc.so.6 => /lib/tls/libc.so.6 (0x00342000)
/lib/ld-linux.so.2 (0x0086f000)
--
Brandon
------=_Part_31852_28040829.1153254518471--
Re: Segfault with DBD::Oracle 1.17 under mod_perl
am 25.07.2006 22:43:07 von bmaust
------=_Part_79445_33062170.1153860187239
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
To follow up on this in case others encounter a similar problem, I
statically linked libclntsh.so into Oracle.so like so:
ld -shared -L/usr/local/lib libclntsh.so Oracle.o dbdimp.o oci8.o -o
blib/arch/auto/DBD/Oracle/Oracle.so
Using that, I can execute SQL statments under mod_perl without segmentation
faults.
--
Brandon
On 7/18/06, Brandon Maust wrote:
>
> Hi,
>
> I built DBD::Oracle 1.17 on a RHEL AS4 machine using the Instant Client
> libraries. I can use it and DBI 1.48 quite successfully to connect to our
> Oracle 10 server via CGI or command-line perl.
>
> The same code, however, segfaults with the stack trace attached below when
> run in a mod_perl environment. Each thread connects to the database
> succesfully (as verified by v$session), but dies whenever I call execute()
> on a statement handle (prepare is ok).
>
> I'm not really sure where to go from here. ldd doesn't list any
> unresolved dependencies for libclntsh (see below), but at runtime it can't
> locate some symbols? I didn't see any other reports of this in google, but
> there were some mentions of segfaults if $ORACLE_HOME is not set. I don't
> have that in my command-line environment (where SELECTs work), so I crossed
> that off my list of potential problems.
>
> stack dump from gdb attached to httpd:
> #0 0x00784416 in do_lookup_x () from /lib/ld-linux.so.2
> #1 0x00784822 in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
> #2 0x00787be6 in fixup () from /lib/ld-linux.so.2
> #3 0x00787b20 in _dl_runtime_resolve () from /lib/ld-linux.so.2
> #4 0x064e4be6 in kpuexInitStmh () from /usr/lib/libclntsh.so.10.1
> #5 0x064e52e9 in kpuexCallback () from /usr/lib/libclntsh.so.10.1
> #6 0x06866e31 in ttcdrv () from /usr/lib/libclntsh.so.10.1
> #7 0x0674e244 in nioqwa () from /usr/lib/libclntsh.so.10.1
> #8 0x065bb27c in upirtrc () from /usr/lib/libclntsh.so.10.1
> #9 0x06530b52 in kpurcsc () from /usr/lib/libclntsh.so.10.1
> #10 0x064e6407 in kpuexecv8 () from /usr/lib/libclntsh.so.10.1
> #11 0x064e8987 in kpuexec () from /usr/lib/libclntsh.so.10.1
> #12 0x065bfe1e in OCIStmtExecute () from /usr/lib/libclntsh.so.10.1
> #13 0x004bd44d in ora_describe () from
> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
> #14 0x004c0418 in ora_st_prepare () from
> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
> #15 0x004a91e9 in XS_DBD__Oracle__st__prepare () from
> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
> #16 0x01028a82 in Perl_pp_entersub () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #17 0x0100be8d in Perl_runops_debug () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #18 0x00fb6ae6 in Perl_get_cv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #19 0x00fbcc7e in Perl_call_sv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #20 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d781a8) at
> DBI.xs:2674
> #21 0x01028a82 in Perl_pp_entersub () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #22 0x0100be8d in Perl_runops_debug () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #23 0x00fb6ae6 in Perl_get_cv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #24 0x00fbcc7e in Perl_call_sv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #25 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d786f4) at
> DBI.xs:2674
> #26 0x01028a82 in Perl_pp_entersub () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #27 0x0100be8d in Perl_runops_debug () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #28 0x00fb6ae6 in Perl_get_cv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #29 0x00fbcea7 in Perl_call_sv () from
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
> #30 0x00ac7cf4 in modperl_callback () from /etc/httpd/modules/mod_perl.so
> #31 0x00ac84cb in modperl_callback_run_handlers () from
> /etc/httpd/modules/mod_perl.so
> #32 0x00ac878a in modperl_callback_per_dir () from
> /etc/httpd/modules/mod_perl.so
> #33 0x00ac3560 in modperl_response_finish () from
> /etc/httpd/modules/mod_perl.so
> #34 0x00ac3638 in modperl_response_handler () from
> /etc/httpd/modules/mod_perl.so
> #35 0x001969b7 in ap_run_handler () from /usr/sbin/httpd
> #36 0x00196e23 in ap_invoke_handler () from /usr/sbin/httpd
> #37 0x001938b5 in ap_process_request () from /usr/sbin/httpd
> #38 0x0018e63f in _start () from /usr/sbin/httpd
> #39 0x094da368 in ?? ()
> #40 0x00000004 in ?? ()
> #41 0x094da368 in ?? ()
> #42 0x00adbd89 in modperl_process_connection_handler () from
> /etc/httpd/modules/mod_perl.so
> #43 0x001a1329 in ap_run_process_connection () from /usr/sbin/httpd
> #44 0x001a1694 in ap_process_connection () from /usr/sbin/httpd
> #45 0x00194901 in ap_graceful_stop_signalled () from /usr/sbin/httpd
> #46 0x00194b44 in ap_graceful_stop_signalled () from /usr/sbin/httpd
> #47 0x001952fa in ap_mpm_run () from /usr/sbin/httpd
> #48 0x0019c34a in main () from /usr/sbin/httpd
>
> $ ldd /usr/lib/libclntsh.so
> libnnz10.so => /usr/lib/libnnz10.so (0x00111000)
> libdl.so.2 => /lib/libdl.so.2 (0x00316000)
> libm.so.6 => /lib/tls/libm.so.6 (0x004e7000)
> libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0031a000)
> libnsl.so.1 => /lib/libnsl.so.1 (0x0032c000)
> libc.so.6 => /lib/tls/libc.so.6 (0x00342000)
> /lib/ld-linux.so.2 (0x0086f000)
> --
> Brandon
>
------=_Part_79445_33062170.1153860187239--
Re: Segfault with DBD::Oracle 1.17 under mod_perl
am 26.07.2006 14:53:59 von scoles
Yes that would make sence as the Oracle has split up its library in the
instant client.
The Makefile lines 315 to 342 will take account of this and create this link
when compiling for Linix but I am not sure about RHEL
It will have to investigate this a little futher aznd find a box with
Mod_Perl and RHEL I can test on.
Chers
John Scoles
----- Original Message -----
From: "Brandon Maust"
To:
Sent: Tuesday, July 25, 2006 4:43 PM
Subject: Re: Segfault with DBD::Oracle 1.17 under mod_perl
> To follow up on this in case others encounter a similar problem, I
> statically linked libclntsh.so into Oracle.so like so:
> ld -shared -L/usr/local/lib libclntsh.so Oracle.o dbdimp.o oci8.o -o
> blib/arch/auto/DBD/Oracle/Oracle.so
>
> Using that, I can execute SQL statments under mod_perl without
> segmentation
> faults.
>
> --
> Brandon
>
> On 7/18/06, Brandon Maust wrote:
>>
>> Hi,
>>
>> I built DBD::Oracle 1.17 on a RHEL AS4 machine using the Instant Client
>> libraries. I can use it and DBI 1.48 quite successfully to connect to
>> our
>> Oracle 10 server via CGI or command-line perl.
>>
>> The same code, however, segfaults with the stack trace attached below
>> when
>> run in a mod_perl environment. Each thread connects to the database
>> succesfully (as verified by v$session), but dies whenever I call
>> execute()
>> on a statement handle (prepare is ok).
>>
>> I'm not really sure where to go from here. ldd doesn't list any
>> unresolved dependencies for libclntsh (see below), but at runtime it
>> can't
>> locate some symbols? I didn't see any other reports of this in google,
>> but
>> there were some mentions of segfaults if $ORACLE_HOME is not set. I
>> don't
>> have that in my command-line environment (where SELECTs work), so I
>> crossed
>> that off my list of potential problems.
>>
>> stack dump from gdb attached to httpd:
>> #0 0x00784416 in do_lookup_x () from /lib/ld-linux.so.2
>> #1 0x00784822 in _dl_lookup_symbol_x () from /lib/ld-linux.so.2
>> #2 0x00787be6 in fixup () from /lib/ld-linux.so.2
>> #3 0x00787b20 in _dl_runtime_resolve () from /lib/ld-linux.so.2
>> #4 0x064e4be6 in kpuexInitStmh () from /usr/lib/libclntsh.so.10.1
>> #5 0x064e52e9 in kpuexCallback () from /usr/lib/libclntsh.so.10.1
>> #6 0x06866e31 in ttcdrv () from /usr/lib/libclntsh.so.10.1
>> #7 0x0674e244 in nioqwa () from /usr/lib/libclntsh.so.10.1
>> #8 0x065bb27c in upirtrc () from /usr/lib/libclntsh.so.10.1
>> #9 0x06530b52 in kpurcsc () from /usr/lib/libclntsh.so.10.1
>> #10 0x064e6407 in kpuexecv8 () from /usr/lib/libclntsh.so.10.1
>> #11 0x064e8987 in kpuexec () from /usr/lib/libclntsh.so.10.1
>> #12 0x065bfe1e in OCIStmtExecute () from /usr/lib/libclntsh.so.10.1
>> #13 0x004bd44d in ora_describe () from
>> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
>> #14 0x004c0418 in ora_st_prepare () from
>> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
>> #15 0x004a91e9 in XS_DBD__Oracle__st__prepare () from
>> /home/bmaust/lib/auto/DBD/Oracle/Oracle.so
>> #16 0x01028a82 in Perl_pp_entersub () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #17 0x0100be8d in Perl_runops_debug () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #18 0x00fb6ae6 in Perl_get_cv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #19 0x00fbcc7e in Perl_call_sv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #20 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d781a8) at
>> DBI.xs:2674
>> #21 0x01028a82 in Perl_pp_entersub () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #22 0x0100be8d in Perl_runops_debug () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #23 0x00fb6ae6 in Perl_get_cv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #24 0x00fbcc7e in Perl_call_sv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #25 0x003e7a12 in XS_DBI_dispatch (my_perl=0x8648250, cv=0x8d786f4) at
>> DBI.xs:2674
>> #26 0x01028a82 in Perl_pp_entersub () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #27 0x0100be8d in Perl_runops_debug () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #28 0x00fb6ae6 in Perl_get_cv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #29 0x00fbcea7 in Perl_call_sv () from
>> /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so
>> #30 0x00ac7cf4 in modperl_callback () from /etc/httpd/modules/mod_perl.so
>> #31 0x00ac84cb in modperl_callback_run_handlers () from
>> /etc/httpd/modules/mod_perl.so
>> #32 0x00ac878a in modperl_callback_per_dir () from
>> /etc/httpd/modules/mod_perl.so
>> #33 0x00ac3560 in modperl_response_finish () from
>> /etc/httpd/modules/mod_perl.so
>> #34 0x00ac3638 in modperl_response_handler () from
>> /etc/httpd/modules/mod_perl.so
>> #35 0x001969b7 in ap_run_handler () from /usr/sbin/httpd
>> #36 0x00196e23 in ap_invoke_handler () from /usr/sbin/httpd
>> #37 0x001938b5 in ap_process_request () from /usr/sbin/httpd
>> #38 0x0018e63f in _start () from /usr/sbin/httpd
>> #39 0x094da368 in ?? ()
>> #40 0x00000004 in ?? ()
>> #41 0x094da368 in ?? ()
>> #42 0x00adbd89 in modperl_process_connection_handler () from
>> /etc/httpd/modules/mod_perl.so
>> #43 0x001a1329 in ap_run_process_connection () from /usr/sbin/httpd
>> #44 0x001a1694 in ap_process_connection () from /usr/sbin/httpd
>> #45 0x00194901 in ap_graceful_stop_signalled () from /usr/sbin/httpd
>> #46 0x00194b44 in ap_graceful_stop_signalled () from /usr/sbin/httpd
>> #47 0x001952fa in ap_mpm_run () from /usr/sbin/httpd
>> #48 0x0019c34a in main () from /usr/sbin/httpd
>>
>> $ ldd /usr/lib/libclntsh.so
>> libnnz10.so => /usr/lib/libnnz10.so (0x00111000)
>> libdl.so.2 => /lib/libdl.so.2 (0x00316000)
>> libm.so.6 => /lib/tls/libm.so.6 (0x004e7000)
>> libpthread.so.0 => /lib/tls/libpthread.so.0 (0x0031a000)
>> libnsl.so.1 => /lib/libnsl.so.1 (0x0032c000)
>> libc.so.6 => /lib/tls/libc.so.6 (0x00342000)
>> /lib/ld-linux.so.2 (0x0086f000)
>> --
>> Brandon
>>
>