Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Webrick, ldap segfault on Linux

Reply
Thread Tools

Webrick, ldap segfault on Linux

 
 
Berger, Daniel
Guest
Posts: n/a
 
      02-06-2006
Hi all,

Although this is happening in a Rails app, this is mainly a Ruby issue.
I hit this issue on Solaris 10 with 1.8.2 but it went away with 1.8.4.
However, when I moved the app over to a Linux box (kernel 2.6., it
reared its ugly head again, even when using Ruby 1.8.4. I tried using a
Ruby built with and without --enable-pthread. Didn't make a difference
either way.

/app/models/user.rb:64: [BUG] Segmentation fault
ruby 1.8.4 (2005-12-24) [i686-linux]

Aborted

# user.rb (from /app/models)
require "ldap"
require "timeout"

class User < A
...
def self.login(cuid, password)
ldap_server =3D "ldapt.foo.com"
bool =3D true

if ENV["RAILS_ENV"].downcase =3D=3D "production"
ldap_server =3D "ldap.foo.com"
end

dn =3D "uid=3D#{cuid},ou=3DPeople,dc=3Dfoo,dc=3Dbar,dc=3D com"

begin
Timeout.timeout(10){
ldap =3D LDAP::Conn.new(ldap_server) # line 64
ldap.simple_bind(dn, password)
ldap.unbind
}
rescue Timeout::Error
flash[:notice] =3D "Timed out"
bool =3D false
rescue LDAP::ResultError =3D> err
bool =3D false
end

return bool
end
end

The development log shows nothing special for the last entry:

Processing LoginController#login (for 1.2.3.4 at 2006-02-06 11:39:23)
[POST]
Parameters: {"commit"=3D>"Login", "action"=3D>"login",
"controller"=3D>"login", "login"=3D>{"cuid"=3D>"djber
ge", "password"=3D>"XXX"}}

Anyone else hit this? I can't find the core file, otherwise I would
attach it. I could probably generate one on my desktop Solaris box with
Ruby 1.8.2 and post it if that would help. Let me know.

Regards,

Dan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
invoking a segfault within a segfault handler - is this undefinedbehavior? Andrey Vul C Programming 8 07-30-2010 02:14 PM
python-ldap/win32 or python/ldap/win32 rcmn Python 1 11-06-2006 11:47 PM
Need to wrtie LDAP class to *answer* LDAP queries. junk1@davidbevan.co.uk Java 1 02-21-2006 09:59 PM
[ANN] Ruby/LDAP 0.9.1: LDAP API (RFC1823) library. Ian Macdonald Ruby 0 03-15-2005 11:23 PM
using LDAP Controls in ruby-ldap Jason Wold Ruby 5 11-07-2004 03:35 AM



Advertisments