Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Segmentation Fault when trying to run require 'ruby_postal/expand' #11

Open
detournemint opened this issue Mar 16, 2018 · 3 comments

Comments

@detournemint
Copy link

detournemint commented Mar 16, 2018

Hi there,
I've installed libpostal via the instructions, i created a /data folder with full permissions open.
i have the ruby_postal gem installed and when trying to run in rails console

2.1.4 :001 > require 'ruby_postal/expand'
/home/greggh/.rvm/gems/ruby-2.1.4/gems/ruby_postal-1.0.0/lib/ruby_postal/cpostal/expand.so: [BUG] Segmentation fault at 0x00000000000004
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]

My data dir is 1.9 gb which is the only other cause i saw of a segfault error when I looked it up. (Issue #3 ) but no dice. I have 30gb of ram and 500 gb of disk space.

Any idea what's up or what I can try? It seems to be rails specific as running a file with just the import statement ruby test.rb works just fine

@albarrentine
Copy link
Contributor

Hey @greggawatt, which OS is this, and which version of libpostal? And is it running in a VM or container?

I just tested it out again with the latest version of libpostal on Mac with Ruby 2.2.4 and everything seemed to be working ok. 2.1 is covered by our build, although that's Ubuntu.

@detournemint
Copy link
Author

This is a vm running debian and i grabbed the latest version of libpostal today from github.
Do you have a rails project you can try it on or try rails runner test.rb with the following in test.rb:

require 'ruby_postal/expand'
puts Postal::Expand.expand_address('Quatre-vingt-douze Ave des Ave des Champs-Élysées')

so for the record ruby test.rb works
rails runner test.rb blows up
Rails 4.2

@albarrentine
Copy link
Contributor

No, sorry. I'm really not a Ruby/Rails person, and, being a data scientist, most of my work is in Python/NumPy or C (my only real knowledge of Ruby is how the language operates at the C level). If the basic script is working, it seems that either we're doing something in the C extension that's not kosher with Rails, or there may be a bug somewhere else. Afraid I don't have the time right now to look into it in much depth, but I would try searching for the general error of loading C extensions in that version of Rails and see if that turns up anything. If you find that there's a fault with this library, feel free to update here or send a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants