[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35313] [Ruby 1.9-Bug#4373] http.rb:677: [BUG] Segmentation fault

From: Christian Fazzini <redmine@...>
Date: 2011-02-19 13:57:25 UTC
List: ruby-core #35313
Issue #4373 has been updated by Christian Fazzini.

File Gemfile added

Ok, I have pinpointed the problem. I do not need to move /opt. To diagnose this, I created a new rails app. I have included the gem file. In there you will see that it includes the twitter gem. HOWEVER, I've commented line 9: gem 'pg'. Which I will explain why, later on.

The following now works, through these steps:

sudo mv /opt /opt_old
< <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

rvm install 1.9.2
Installing Ruby from source to: /Users/Chris/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...

ruby-1.9.2-p136 - #fetching 
ruby-1.9.2-p136 - #downloading ruby-1.9.2-p136, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8612k  100 8612k    0     0  36861      0  0:03:59  0:03:59 --:--:-- 26126
ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /Users/Chris/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #extracted to /Users/Chris/.rvm/src/ruby-1.9.2-p136
ruby-1.9.2-p136 - #configuring 
ruby-1.9.2-p136 - #compiling 
ruby-1.9.2-p136 - #installing 
ruby-1.9.2-p136 - Updating #rubygems to the latest.
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p136...
Retrieving rubygems-1.5.2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  286k  100  286k    0     0  34987      0  0:00:08  0:00:08 --:--:-- 60846
Extracting rubygems-1.5.2 ...
Installing rubygems for /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
Installation of rubygems completed successfully.
ruby-1.9.2-p136 - Updating #rubygems to the latest.
Removing old Rubygems files...
Installing rubygems dedicated to ruby-1.9.2-p136...
Installing rubygems for /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
Installation of rubygems completed successfully.
ruby-1.9.2-p136 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.2-p136 - #importing default gemsets (/Users/Chris/.rvm/gemsets/)
Install of ruby-1.9.2-p136 - #complete 

rvm use 1.9.2
Using /Users/Chris/.rvm/gems/ruby-1.9.2-p136

ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]

cd Sites/blog
 bundle install
/Library/Ruby/Site/1.8/rubygems.rb:861:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
	from /Library/Ruby/Site/1.8/rubygems.rb:255:in `activate'
	from /Library/Ruby/Site/1.8/rubygems.rb:1204:in `gem'
	from /usr/bin/bundle:18

gem install bundler
Fetching: bundler-1.0.10.gem (100%)
Successfully installed bundler-1.0.10
1 gem installed
Installing ri documentation for bundler-1.0.10...
Installing RDoc documentation for bundler-1.0.10...

bundle install
Fetching http://github.com/jnunemaker/twitter.git
remote: Counting objects: 5780, done.
remote: Compressing objects: 100% (2157/2157), done.
remote: Total 5780 (delta 3834), reused 5267 (delta 3469)
Receiving objects: 100% (5780/5780), 1.68 MiB | 185 KiB/s, done.
Resolving deltas: 100% (3834/3834), done.
Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Installing abstract (1.0.0) 
Installing activesupport (3.0.3) 
Installing builder (2.1.2) 
Installing i18n (0.5.0) 
Installing activemodel (3.0.3) 
Installing erubis (2.6.6) 
Installing rack (1.2.1) 
Installing rack-mount (0.6.13) 
Installing rack-test (0.5.7) 
Installing tzinfo (0.3.24) 
Installing actionpack (3.0.3) 
Installing mime-types (1.16) 
Installing polyglot (0.3.1) 
Installing treetop (1.4.9) 
Installing mail (2.2.15) 
Installing actionmailer (3.0.3) 
Installing arel (2.0.7) 
Installing activerecord (3.0.3) 
Installing activeresource (3.0.3) 
Installing addressable (2.2.4) 
Using bundler (1.0.10) 
Installing multipart-post (1.1.0) 
Installing faraday (0.5.4) 
Installing faraday_middleware (0.3.2) 
Installing hashie (1.0.0) 
Installing multi_json (0.0.5) 
Installing multi_xml (0.2.1) 
Installing thor (0.14.6) 
Installing railties (3.0.3) 
Installing rails (3.0.3) 
Installing simple_oauth (0.1.4) 
Using twitter (1.1.2) from http://github.com/jnunemaker/twitter.git (at master) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

ruby -r twitter -e 'puts Twitter.user("sferik").location'
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- twitter (LoadError)
	from <internal:lib/rubygems/custom_require>:29:in `require'

gem install twitter
Fetching: twitter-1.1.2.gem (100%)
Successfully installed twitter-1.1.2
1 gem installed
Installing ri documentation for twitter-1.1.2...
Installing RDoc documentation for twitter-1.1.2...

ruby -r twitter -e 'puts Twitter.user("sferik").location'
San Francisco

rails c
ruby-1.9.2-p136 :001 > Twitter.user("sferik").location
 => "San Francisco" 

---------------

In the gem file, if I uncomment line 9: gem 'twitter' and then do bundle install. In console, running ruby -r twitter -e 'puts Twitter.user("sferik").location' still works. 

However when I go into rails console, Twitter.user("sferik").location returns the segfault error.

I suspect that it has something to do with the way I installed PostgreSql, via macports. You will notice, when I do: sudo port uninstall openssl, it says:

Warning: port definitions are more than two weeks old, consider using selfupdate
--->  Unable to uninstall/deactivate openssl @1.0.0c_0, the following ports depend on it:
--->  	postgresql83 @8.3.13_0
--->  	python27 @2.7.1_1
Error: Target org.macports.uninstall returned: Please uninstall the ports that depend on openssl first.
Log for openssl is at: /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_openssl_1.0.0c_0/main.log
Warning: Failed to execute portfile from registry for openssl @1.0.0c_0
--->  Unable to uninstall/deactivate openssl @1.0.0c_0, the following ports depend on it:
--->  	postgresql83 @8.3.13_0
--->  	python27 @2.7.1_1
Error: port uninstall failed: Please uninstall the ports that depend on openssl first.

I believe that the problem occurs because:
- Rails includes the pg gem, which is using the openssl version of macports and not the OSX default openssl. 

The next approach I will take, is to uninstall postgresql and openssl through macports and reinstall postgresql to be configured to use OSX default openssl. I don't know if I can install postgresql to use OSX default openssl, but I will give it a shot and report my findings here.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/4373

----------------------------------------
http://redmine.ruby-lang.org

Attachments (1)

Gemfile (824 Bytes, application/octet-stream)

In This Thread