typhoeus/ethon

Curl 7.71 NullPointerError (Arch Linux)

Opened this issue · 2 comments

I get this error with the latest libcurl (v7.71):

     FFI::NullPointerError:
       invalid memory read at address=0x0000000000000000
     # /home/reed/.gem/ruby/2.6.0/gems/ffi-1.12.2/lib/ffi/pointer.rb:55:in `get_string'
     # /home/reed/.gem/ruby/2.6.0/gems/ffi-1.12.2/lib/ffi/pointer.rb:55:in `read_string'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy.rb:285:in `escape'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/queryable.rb:35:in `block (2 levels) in to_s'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/queryable.rb:35:in `map'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/queryable.rb:35:in `block in to_s'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/queryable.rb:31:in `map'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/queryable.rb:31:in `to_s'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/http/postable.rb:24:in `set_form'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/http/actionable.rb:101:in `setup'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/http/post.rb:16:in `setup'
     # /home/reed/.gem/ruby/2.6.0/gems/ethon-0.10.1/lib/ethon/easy/http.rb:39:in `http_request'
     # /home/reed/.gem/ruby/2.6.0/gems/typhoeus-1.3.0/lib/typhoeus/easy_factory.rb:81:in `get'
     # /home/reed/.gem/ruby/2.6.0/gems/typhoeus-1.3.0/lib/typhoeus/request.rb:130:in `url'

Downgrading to v7.70 fixes it. Anyone else experience this?

Reproduced with libcurl 7.72.0 and 7.71.0

Thought it's worth sharing, I'm experiencing the same with typheus 1.4.0, ffi 1.13.1 &ethon-0.12.0. Even downgrading any of those libraries don't fix the problem.

So far the results of my investigations is that the error happens if an empty string "" gets passed to ffi in lib/ffi/pointer.rb:55
:

In my case the value for pair at line 31 in lib/ethon/easy/queryable.rbhttps://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L31 is as follows

[:deleteAuthorizable, ""]

The only way how I can get it to work is to use non empty strings, which isn't possible for me :(.