Forum: Ruby Segfault in JSON - windows VISTA

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matthew Rudy J. (Guest)
on 2007-07-12 22:36
I've been struggling for the past few hours with a segfault coming out
of JSON.

this is from the gem "json (1.1.1)" and "json (1.0.3)"

I was originally running the ruby 1.8.6 one-click-installer,
but reverted to 1.8.4 a moment ago, to see if it fixed the problem.

I've also tried varying the version of the JSON gem.

hmm...I can't see how to fix this.
any ideas.

I guess maybe I should just revert back to WinXP,
it was working in 1.8.4 on XP MCE

MatthewRudy

==========================================================================
the output from my rails console running json 1.1.1
==========================================================================
c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>ruby
script/console
Loading development environment.
>> require 'json'
=> []
>> exit

c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>ruby
script/console
Loading development environment.
>> require 'json'
=> []
>> JSON.parse(JSON.unparse(:stuff => "nuff"))
=> {"stuff"=>"nuff"}
>> exit
c:/ruby/lib/ruby/1.8/irb/workspace.rb:81: [BUG] Segmentation fault
ruby 1.8.4 (2006-04-14) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

==========================================================================
the output from my irb running json 1.0.7
==========================================================================
c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> gem 'json'
=> true
irb(main):003:0> require 'json'
=> true
irb(main):004:0> exit

c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> gem 'json'
=> true
irb(main):003:0> require 'json'
=> true
irb(main):004:0> JSON.parse(JSON.unparse(:stuff => "nuff"))
=> {"stuff"=>"nuff"}
irb(main):005:0> exit
c:/ruby/bin/irb.bat:20: [BUG] Segmentation fault
ruby 1.8.4 (2006-04-14) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.
Matthew Rudy J. (Guest)
on 2007-07-12 22:40
I correct myself,
that was with json 1.0.3.

btw, I'm running this from command prompt - running it "as
administrator"

Matthew R. wrote:

> ==========================================================================
> the output from my irb running json 1.0.7
> ==========================================================================
> c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>irb
> irb(main):001:0> require 'rubygems'
> => false
> irb(main):002:0> gem 'json'
> => true
> irb(main):003:0> require 'json'
> => true
> irb(main):004:0> exit
>
> c:\code\RubyOnRailsApps\MidasSubscriptions\trunk\main>irb
> irb(main):001:0> require 'rubygems'
> => false
> irb(main):002:0> gem 'json'
> => true
> irb(main):003:0> require 'json'
> => true
> irb(main):004:0> JSON.parse(JSON.unparse(:stuff => "nuff"))
> => {"stuff"=>"nuff"}
> irb(main):005:0> exit
> c:/ruby/bin/irb.bat:20: [BUG] Segmentation fault
> ruby 1.8.4 (2006-04-14) [i386-mswin32]
>
>
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
Matthew Rudy J. (Guest)
on 2007-07-12 23:02
ok I've managed to get it to work by using the "json_pure" gem instead.
but it's annoying
:s
This topic is locked and can not be replied to.