stripe/stripe-ruby — Issue #15: http segfaults
Author: sbeckeriv
Created: 2012-02-19 17:54:10+00:00
State: open

I know stripe does not write the http class but I have been getting segfaults with rails(3.0.7 ruby 1.8.7 and 1.9.3-rc1 rvmed). This is in development mode with webrick. I might try another server locally to see if it helps. I have not had any issues til i save the plan. Code is based off of railscast video.

def save_with_payment(token)
if valid?
customer = Stripe::Customer.create(:description=> email, :plan=> 'pro', :card=> token)
self.stripe_customer_token = customer.id
save!
end
rescue Stripe::InvalidRequestError => e
logger.error "Stripe error while creating customer: #{e.message}"
errors.add :base, "There was a problem with your credit card."
false
end

/Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
ruby 1.9.3dev (2011-09-23 revision 33323) [x86_64-darwin10.8.0]

-- Control frame information -----------------------------------------------
c:0081 p:---- s:0456 b:0456 l:000455 d:000455 CFUNC :connect
c:0080 p:0011 s:0453 b:0453 l:0013e0 d:000452 BLOCK /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/net/http.rb:799
c:0079 p:0111 s:0451 b:0451 l:0018a0 d:0018a0 METHOD /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/timeout.rb:68
c:0078 p:0026 s:0439 b:0439 l:000438 d:000438 METHOD /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/timeout.rb:99
c:0077 p:0485 s:0433 b:0433 l:0013e0 d:0013e0 METHOD /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/net/http.rb:799
c:0076 p:0011 s:0425 b:0425 l:000424 d:000424 METHOD /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/net/http.rb:755
c:0075 p:0048 s:0422 b:0422 l:000421 d:000421 METHOD /Users/becker/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/1.9.1/net/http.rb:744
c:0074 p:0297 s:0419 b:0419 l:002570 d:002570 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/rest-client-1.6.1/lib/restclient/request.rb:166
c:0073 p:0075 s:0411 b:0411 l:000410 d:000410 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/rest-client-1.6.1/lib/restclient/request.rb:60
c:0072 p:0021 s:0406 b:0406 l:000405 d:000405 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/rest-client-1.6.1/lib/restclient/request.rb:31
c:0071 p:0021 s:0401 b:0401 l:000400 d:000400 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/stripe-1.6.0/lib/stripe.rb:570
c:0070 p:0568 s:0397 b:0397 l:000396 d:000396 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/stripe-1.6.0/lib/stripe.rb:532
c:0069 p:0037 s:0378 b:0378 l:000377 d:000377 METHOD /Users/becker/.rvm/gems/ruby-1.9.3-rc1@git/gems/stripe-1.6.0/lib/stripe.rb:105
c:0068 p:0051 s:0372 b:0372 l:000371 d:000371 METHOD /Users/becker/trash/github/git/app/models/user.rb:24