[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Segmentation Fault in httpclient 2.1.0

Mark Slater

8/3/2007 8:54:00 PM

I've written a ruby script that connects to a web service running
within our intranet via Soap4r. I developed the script on a Mac (OS
10.4.10, ruby 1.8.6 patch 0, soap4r 1.5.7, httpclient 2.1.0, net-ssh
1.1.2) and I have no problems on my machine. However when we deploy
the script to the production environment (a linux box with the same
ruby version and gems as I have on my development machine), we get
random segmentation faults:

/usr/local/lib/ruby/gems/1.8/gems/httpclient-2.1.0/lib/httpclient.rb:378
: [BUG] Segmentation fault
ruby 1.8.6 (2007-03-13) [i686-linux]

Aborted
-bash-2.05b$ echo $?
134

Here's the code where the seg fault occurs:
353 def load_cacerts
354 file = File.join(File.dirname(__FILE__), 'httpclient',
'cacert.p7s')
355 if File.exist?(file)
356 require 'openssl'
357 dist_cert =<<__DIST_CERT__
...
377__DIST_CERT__
378 p7 = OpenSSL::PKCS7.read_smime(File.open(file) { |f| f.read })

The last line is where things die.

Has anyone else seen this problem? What version of OpenSSL should we
be running for compatibility with Ruby's OpenSSL library?

Any suggests on how to fix this would be much appreciated, since we
can't roll these scripts out with these errors.

Thank you,

Mark

2 Answers

NAKAMURA, Hiroshi

8/4/2007 2:06:00 PM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Mark Slater wrote:
> Has anyone else seen this problem? What version of OpenSSL should we be
> running for compatibility with Ruby's OpenSSL library?

You need to use the openssl version that matches with the openssl header
files which are used when the ruby was compiled. Check the environment.

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRrSHuR9L2jg5EEGlAQLfiAf/ZhuZDFRIR/uMxVO7O2wuZkJ/e1VsAeSE
3vd9I6n4KpIMlUFX5B8pi+A73HOJPB5N0ZlrY/y0OdbrGzOegLSqga5G9iWiOWWw
RjXuLPh0GIRKkr5TL7SxVLXEyiWoC9gy3Rg/SPrJfAuBWQvcu3kpo4k6A3vxwZZF
fQgozabeM9iGhLfXz4lqTkXlXD6/+HcNcJSpvGB/SK9bfvdLdqLsmt2r43+Yvn7H
YXq7i82d1CAMYl6vXD0mD76SFV83FbA1XaiGkkdxGbnKt3gmnAzjX29t3j5k4crD
gPaBto73cr34Jp7JQvwcYM0GuWM/Rh6mTZKO39X4jpY5iL+rX0RpLw==
=PUTF
-----END PGP SIGNATURE-----

Mark Slater

8/15/2007 1:21:00 AM

0

That doesn't seem to be the problem. We've found that with OpenSSL
0.9.7, we get random segmentation faults. If we upgrade to 0.9.8,
they go away. In each case, we've rebuilt ruby so the headers always
matched the library.

Mark

On Aug 4, 2007, at 7:06 AM, NAKAMURA, Hiroshi wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Mark Slater wrote:
>> Has anyone else seen this problem? What version of OpenSSL should
>> we be
>> running for compatibility with Ruby's OpenSSL library?
>
> You need to use the openssl version that matches with the openssl
> header
> files which are used when the ruby was compiled. Check the
> environment.
>
> Regards,
> // NaHi
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.1 (Cygwin)
>
> iQEVAwUBRrSHuR9L2jg5EEGlAQLfiAf/ZhuZDFRIR/uMxVO7O2wuZkJ/e1VsAeSE
> 3vd9I6n4KpIMlUFX5B8pi+A73HOJPB5N0ZlrY/y0OdbrGzOegLSqga5G9iWiOWWw
> RjXuLPh0GIRKkr5TL7SxVLXEyiWoC9gy3Rg/SPrJfAuBWQvcu3kpo4k6A3vxwZZF
> fQgozabeM9iGhLfXz4lqTkXlXD6/+HcNcJSpvGB/SK9bfvdLdqLsmt2r43+Yvn7H
> YXq7i82d1CAMYl6vXD0mD76SFV83FbA1XaiGkkdxGbnKt3gmnAzjX29t3j5k4crD
> gPaBto73cr34Jp7JQvwcYM0GuWM/Rh6mTZKO39X4jpY5iL+rX0RpLw==
> =PUTF
> -----END PGP SIGNATURE-----
>