# How to debug segmentation faults

**URL:** <https://www.ruby-forum.com/t/how-to-debug-segmentation-faults/77416>\
**Category:** Ruby\
**Created:** [November 27, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/how-to-debug-segmentation-faults/77416 "2006-11-27T20:09:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazmatt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b2d939/32.png) [@hazmatt](https://www.ruby-forum.com/u/hazmatt)\
**Post date:** [November 27, 2006, 8:09pm UTC](https://www.ruby-forum.com/t/how-to-debug-segmentation-faults/77416/1 "2006-11-27T20:09:37Z")

</div>

Hi,

I am pretty new to Ruby although have a lot of experience in other  
programming languages. I’m working on a project using Ruby and the  
OpenGL extensions that come with it (version 1.8.5). The error is not  
very detailed:

Vivarium.rb:118: [BUG] Segmentation fault  
ruby 1.8.5 (2006-08-25) [i386-mswin32]

That line is GLUT::MainLoop()

This doesn’t really help as that’s essentially the entry point for any  
OpenGL program, meaning the problem could be anywhere.

What’s the best way to debug this to get further information I’ve tried  
ruby -rdebug but I could get very far with that. I would start trying to  
run/step through the program and get warnings about includes that I’m  
not even directly referencing and can’t seem to get to the breakpoint I  
want. I could use some help on that too if anyone is familiar with the  
built in debugger.

Any help on this would be appreciated.

Thanks  
Matt
