# Segmentation fault on Windows

**URL:** <https://rubytalk.org/t/segmentation-fault-on-windows/48248>\
**Category:** ruby-talk\
**Created:** [11 August 2008 10:19 UTC](https://rubytalk.org/t/segmentation-fault-on-windows/48248 "2008-08-11T10:19:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jyo\_Ni](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jyo\_Ni](https://rubytalk.org/u/Jyo_Ni)\
**Post date:** [11 August 2008 10:19 UTC](https://rubytalk.org/t/segmentation-fault-on-windows/48248/1 "2008-08-11T10:19:01Z")

</div>

Hi,

When I try to run the following program I get a segmentation fault:  
require 'rubygems'  
require 'json'  
require 'net/http'  
def testrsv()  
&nbsp;&nbsp;&nbsp;base\_url =  
"[http://10.221.112.10:8080/reserve-online/reservations?status=emailed&format=json](http://10.221.112.10:8080/reserve-online/reservations?status=emailed&format=json)"  
&nbsp;&nbsp;&nbsp;url = "#{base\_url}"  
&nbsp;&nbsp;&nbsp;resp = Net::HTTP.get\_response(URI.parse(base\_url))  
&nbsp;&nbsp;&nbsp;data = resp.body  
&nbsp;&nbsp;&nbsp;# data structure - a hash  
&nbsp;&nbsp;&nbsp;result = JSON.parse(data)  
&nbsp;&nbsp;&nbsp;# if the hash has 'Error' as a key, we raise an error  
&nbsp;&nbsp;&nbsp;result['reservations']['reservation'].each { |result|  
&nbsp;&nbsp;&nbsp;print "#{result['ean']} =\> #{result['status']}\n"  
&nbsp;&nbsp;&nbsp;}

end

C:/Users/SudJyo/AppData/Local/Temp/rb276D.tmp:21: [BUG] Segmentation  
fault  
ruby 1.8.6 (2007-09-24) [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.

Can anyone help me finding the cause of this issue?  
Thanks,  
Jyo

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [11 August 2008 17:19 UTC](https://rubytalk.org/t/segmentation-fault-on-windows/48248/2 "2008-08-11T17:19:46Z")

</div>

which ruby version and compiler are you using for json?

Jyo Ni wrote:

> **···**
>
> > Hi,
> > 
> > When I try to run the following program I get a segmentation fault:  
> > require 'rubygems'  
> > require 'json'
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
