Re: Segfaulting perl

2006-10-18 Thread David King

For the archives:

I eventually found  and . It looks like  
a bug in p5-Crypt-SSLeay, and it not properly calling some OpenSSL  
routines, which causes perl to segfault. In fetchyahoo 2.10.6, it is  
on line 1435 of 2117, which reads:

$main_page = $ua->request($request);

$ua is a LWP::UserAgent object, and what's happening is that the  
request is redirecting to an SSL page, so even if you have SSL turned  
off it will end up making an SSL request.


I fixed it (very temporarily) by removing p5-Crypt-SSLeay (pkg_delete  
-f p5-Crypt-SSLeay). The UserAgent object sees that it can't do SSL  
without that package and follows the redirects but without SSL.


So obviously there is the drawback that SSL won't work, and also I  
have other packages that rely on that perl module (notably gnucash)  
that won't work with it not installed. That bug was filed with Debian  
a year ago (Bug#334938, Oct 20, 2005 ).



On 15 Oct 2006, at 13:10, David King wrote:

Just to make sure that no bad library dependancies were at work, I  
did a 'make buildworld installworld', and a 'portupgrade -frR  
fetchyahoo perl openssl', to no avail (and with the same backtrace  
generated by gdb as below).


Any ideas?

On 10 Oct 2006, at 11:05, David King wrote:

When trying to run fetchyahoo (from ports), perl dumps core. It  
appears to be dumping core in OpenSSL. I've tried recompiling/ 
reinstalling all ports related to fetchyahoo, perl, and openssl.  
This happens whether or not I enable SSL in fetchyahoo's  
configuration.


It gets as far as:

~% fetchyahoo
Logging in insecurely via plaintext as username on Tue Oct 10  
09:49:20 2006

zsh: segmentation fault (core dumped)  fetchyahoo

Perl and OpenSSL have been compiled with:

~% egrep -i '^(COPT|CFLAG)' /etc/make.conf
CFLAGS+=-O -pipe -mtune=i686 -g
COPTFLAGS=-O -pipe -mtune=i686 -g

Here's the output of GDB and a backtrace

Core was generated by `perl5.8.8'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/CORE/ 
libperl.so...done.

Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
Reading symbols from /lib/libm.so.4...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libutil.so.5...done.
Loaded symbols for /lib/libutil.so.5
Reading symbols from /usr/lib/libpthread.so.2...done.
Loaded symbols for /usr/lib/libpthread.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/IO/ 
IO.so...done.

Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/IO/IO.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/ 
Fcntl.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/ 
Fcntl.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/ 
auto/MIME/Base64/Base64.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
MIME/Base64/Base64.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Time/ 
HiRes/HiRes.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Time/HiRes/ 
HiRes.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Socket/ 
Socket.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Socket/ 
Socket.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Sys/ 
Hostname/Hostname.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Sys/ 
Hostname/Hostname.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/ 
auto/Compress/Zlib/Zlib.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Compress/Zlib/Zlib.so

Reading symbols from /lib/libz.so.3...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/ 
auto/HTML/Parser/Parser.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
HTML/Parser/Parser.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/ 
auto/Crypt/SSLeay/SSLeay.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Crypt/SSLeay/SSLeay.so

Reading symbols from /usr/local/lib/libssl.so.5...done.
Loaded symbols for /usr/local/lib/libssl.so.5
Reading symbols from /usr/local/lib/libcrypto.so.5...done.
Loaded symbols for /usr/local/lib/libcrypto.so.5
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x2839d420 in SSL_CTX_ctrl () from /usr/local/lib/libssl.so.5
[New LWP 100179]
(gdb) bt
#0  0x2839d420 in SSL_CTX_ctrl () from /usr/local/lib/libssl.so.5
#1  0x01c0 in ?? ()
#2  0x000d in ?? ()
#3  0x28325000 in ?? ()
#4  0x in ?? ()
#5  0x283683b4 in __JCR_

Re: Segfaulting perl

2006-10-15 Thread David King
Just to make sure that no bad library dependancies were at work, I  
did a 'make buildworld installworld', and a 'portupgrade -frR  
fetchyahoo perl openssl', to no avail (and with the same backtrace  
generated by gdb as below).


Any ideas?

On 10 Oct 2006, at 11:05, David King wrote:

When trying to run fetchyahoo (from ports), perl dumps core. It  
appears to be dumping core in OpenSSL. I've tried recompiling/ 
reinstalling all ports related to fetchyahoo, perl, and openssl.  
This happens whether or not I enable SSL in fetchyahoo's  
configuration.


It gets as far as:

~% fetchyahoo
Logging in insecurely via plaintext as username on Tue Oct 10  
09:49:20 2006

zsh: segmentation fault (core dumped)  fetchyahoo

Perl and OpenSSL have been compiled with:

~% egrep -i '^(COPT|CFLAG)' /etc/make.conf
CFLAGS+=-O -pipe -mtune=i686 -g
COPTFLAGS=-O -pipe -mtune=i686 -g

Here's the output of GDB and a backtrace

Core was generated by `perl5.8.8'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/CORE/ 
libperl.so...done.

Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
Reading symbols from /lib/libm.so.4...done.
Loaded symbols for /lib/libm.so.4
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /lib/libutil.so.5...done.
Loaded symbols for /lib/libutil.so.5
Reading symbols from /usr/lib/libpthread.so.2...done.
Loaded symbols for /usr/lib/libpthread.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/IO/ 
IO.so...done.

Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/IO/IO.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/ 
Fcntl.so...done.

Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Fcntl/Fcntl.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
MIME/Base64/Base64.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
MIME/Base64/Base64.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Time/ 
HiRes/HiRes.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Time/HiRes/ 
HiRes.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Socket/ 
Socket.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Socket/ 
Socket.so
Reading symbols from /usr/local/lib/perl5/5.8.8/mach/auto/Sys/ 
Hostname/Hostname.so...done.
Loaded symbols for /usr/local/lib/perl5/5.8.8/mach/auto/Sys/ 
Hostname/Hostname.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Compress/Zlib/Zlib.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Compress/Zlib/Zlib.so

Reading symbols from /lib/libz.so.3...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
HTML/Parser/Parser.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
HTML/Parser/Parser.so
Reading symbols from /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Crypt/SSLeay/SSLeay.so...done.
Loaded symbols for /usr/local/lib/perl5/site_perl/5.8.8/mach/auto/ 
Crypt/SSLeay/SSLeay.so

Reading symbols from /usr/local/lib/libssl.so.5...done.
Loaded symbols for /usr/local/lib/libssl.so.5
Reading symbols from /usr/local/lib/libcrypto.so.5...done.
Loaded symbols for /usr/local/lib/libcrypto.so.5
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x2839d420 in SSL_CTX_ctrl () from /usr/local/lib/libssl.so.5
[New LWP 100179]
(gdb) bt
#0  0x2839d420 in SSL_CTX_ctrl () from /usr/local/lib/libssl.so.5
#1  0x01c0 in ?? ()
#2  0x000d in ?? ()
#3  0x28325000 in ?? ()
#4  0x in ?? ()
#5  0x283683b4 in __JCR_LIST__ () from /usr/local/lib/perl5/ 
site_perl/5.8.8/mach/auto/Crypt/SSLeay/SSLeay.so

#6  0x0017 in ?? ()
#7  0x in ?? ()
#8  0x283608af in XS_Crypt__SSLeay__CTX_new (my_perl=0x8058000,  
cv=0x86b47b0) at SSLeay.xs:133
#9  0x2810fd9f in Perl_pp_entersub (my_perl=0x8058000) at pp_hot.c: 
2913

#10 0x280f22d9 in Perl_runops_debug (my_perl=0x8058000) at dump.c:1459
#11 0x2809e6b1 in S_run_body (my_perl=0x8058000, oldscope=4095) at  
perl.c:2366

#12 0x2809e222 in perl_run (my_perl=0x8058000) at perl.c:2283
#13 0x080492bc in main ()

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
osname=freebsd, osvers=6.1-release-p10, archname=i386-freebsd- 
thread-multi-64int
uname='freebsd melchoir.ketralnis.com 6.1-release-p10 freebsd  
6.1-release-p10 #5: mon oct 9 09:44:49 pdt 2006  
[EMAIL PROTECTED]:usrobjusrsrcsysmelchoir i386 '
config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/ 
perl5/5.8.8/mach -Dprivlib=/usr/local/lib/perl5/5.8.8 -Dman3dir=/ 
usr/local/lib/perl5/5.8.8/perl/man/man3 -Dman1dir=/usr/local/man/ 
man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.8/mach - 
Dsitelib=/usr/local/lib/perl5/site_perl/5.8.8