# Webrick, ldap segfault on Linux

**URL:** <https://www.ruby-forum.com/t/webrick-ldap-segfault-on-linux/101616>\
**Category:** Ruby\
**Created:** [February 6, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/webrick-ldap-segfault-on-linux/101616 "2006-02-06T19:10:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BergerS\_Daniel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc8723/32.png) [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Post date:** [February 6, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/webrick-ldap-segfault-on-linux/101616/1 "2006-02-06T19:10:42Z")

</div>

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.8), 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 = “[ldapt.foo.com](http://ldapt.foo.com)”  
bool = true

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

  dn = "uid=#{cuid},ou=People,dc=foo,dc=bar,dc=com"

  begin
     Timeout.timeout(10){
        ldap = LDAP::Conn.new(ldap_server) # line 64
        ldap.simple_bind(dn, password)
        ldap.unbind
     }
  rescue Timeout::Error
     flash[:notice] = "Timed out"
     bool = false
  rescue LDAP::ResultError => err
     bool = 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”=\>“Login”, “action”=\>“login”,  
“controller”=\>“login”, “login”=\>{“cuid”=\>“djber  
ge”, “password”=\>“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
