I just activated Devise' :confirmable option in my User model. As Devise
tries to send out the confirmation-link email I get a segmentation-fault
error in Ruby's SMTP library:

... lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault

My config/environments/development.rb file has the following:

config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }

My /config/initializers/setup_mail.rb file:

ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "mydomain.com",
:user_name => "[redacted]",
:password => "[redacted]",
:authentication => "plain",
:enable_starttls_auto => true
}
ActionMailer::Base.default_url_options[:host] = "localhost:3000"

The relevant code in smtp.rb are these two methods:

def ssl_socket(socket, context)
OpenSSL::SSL::SSLSocket.new socket, context
end

def tlsconnect(s)
verified = false
s = ssl_socket(s, @ssl_context)
logging "TLS connection started"
s.sync_close = true
s.connect # THIS IS LINE 583
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
verified = true
s
ensure
s.close unless verified
end

I've tried setting :enable_starttls_auto to false. I don't get a segmentation fault, but no mail goes out either. I can get a session going with the gmail smtp host via the command line. I'm running on the latest version of Mac OS.

Never had to debug a segmentation fault before. Pretty intimidating. Any thoughts, ideas, approaches?



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/u3_xUrLe3nsJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Colin Law at Jan 28, 2012 at 8:40 am

    On 27 January 2012 23:14, Don wrote:
    I just activated Devise' :confirmable option in my User model.  As Devise
    tries to send out the confirmation-link email I get a segmentation-fault
    error in Ruby's SMTP library:

    ... lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault
    If you are using ruby 1.9.1 then upgrade to 1.9.2 (or 1.9.3 though
    maybe it is still a bit new) or go back to 1.8.7
    1.9.1 did not play well with Rails

    Colin

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Don at Jan 28, 2012 at 6:15 pm

    tries to send out the confirmation-link email I get a segmentation-fault
    error in Ruby's SMTP library:

    ... lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault
    If you are using ruby 1.9.1 then upgrade to 1.9.2 (or 1.9.3 though
    maybe it is still a bit new) or go back to 1.8.7
    1.9.1 did not play well with Rails
    OK I'm confused. The segmentation fault indicates it is happening in the
    ruby 1.9.1 version of the SMTP library (see quoted text.) However, when I
    go to my project and enter the Rails console, I get this:

    irb(main):001:0> RUBY_VERSION

    => "1.9.3"

    And when I go the project directory I get this:

    story_project # ruby --version

    ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

    The full path on the segmentation fault is:

    /Users/don/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583:
    [BUG] Segmentation fault
    What is the deal here? Why is Ruby 1.9.3 running code from 1.9.1? Is this
    common? Did RVM mess this up some how?

    Perplexing!??

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/S8zz7O9n9UAJ.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Paul at Jan 29, 2012 at 5:41 pm
    First, the 1.9.1 is "normal". That's always the folder it uses.

    Second, are you having this problem?
    http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/
    On Sat, Jan 28, 2012 at 1:14 PM, Don wrote:
    tries to send out the confirmation-link email I get a segmentation-fault
    error in Ruby's SMTP library:

    ... lib/ruby/1.9.1/net/smtp.rb:583: [BUG] Segmentation fault
    If you are using ruby 1.9.1 then upgrade to 1.9.2 (or 1.9.3 though
    maybe it is still a bit new) or go back to 1.8.7
    1.9.1 did not play well with Rails
    OK I'm confused.  The segmentation fault indicates it is happening in the
    ruby 1.9.1 version of the SMTP library (see quoted text.)  However, when I
    go to my project and enter the Rails console, I get this:

    irb(main):001:0> RUBY_VERSION

    => "1.9.3"

    And when I go the project directory I get this:

    story_project #   ruby --version

    ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

    The full path on the segmentation fault is:

    /Users/don/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/smtp.rb:583:
    [BUG] Segmentation fault

    What is the deal here?  Why is Ruby 1.9.3 running code from 1.9.1?  Is this
    common?  Did RVM mess this up some how?

    Perplexing!??
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 27, '12 at 11:14p
activeJan 29, '12 at 5:41p
posts4
users3
websiterubyonrails.org
irc#RubyOnRails

3 users in discussion

Don: 2 posts Colin Law: 1 post Paul: 1 post

People

Translate

site design / logo © 2022 Grokbase