# Segfault in JSON - windows VISTA

**URL:** <https://www.ruby-forum.com/t/segfault-in-json-windows-vista/109256>\
**Category:** Ruby\
**Created:** [July 12, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/segfault-in-json-windows-vista/109256 "2007-07-12T20:36:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 12, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/segfault-in-json-windows-vista/109256/1 "2007-07-12T20:36:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 12, 2007, 8:40pm UTC](https://www.ruby-forum.com/t/segfault-in-json-windows-vista/109256/2 "2007-07-12T20:40:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mjacobs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e274bd/32.png) [@mjacobs](https://www.ruby-forum.com/u/mjacobs)\
**Post date:** [July 12, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/segfault-in-json-windows-vista/109256/3 "2007-07-12T21:02:01Z")

</div>

ok I’ve managed to get it to work by using the “json\_pure” gem instead.  
but it’s annoying  
:s
