Issue #10154 has been reported by Addison Bean.

----------------------------------------
Bug #10154: Ruby Segmentation Fault
https://bugs.ruby-lang.org/issues/10154

* Author: Addison Bean
* Status: Open
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
I was working with the Gosu gem, and I started making a game with it. Half the time when I quit the game, Ruby crashes and gives me this error:

~~~
./start: [BUG] Segmentation fault at 0x00000000000010
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0002 E:001a98 TOP    [FINISH]


-- C level backtrace information -------------------------------------------
0   ruby                                0x000000010db68d36 rb_vm_bugreport + 134
1   ruby                                0x000000010da1f423 report_bug + 307
2   ruby                                0x000000010da1f2e4 rb_bug + 180
3   ruby                                0x000000010daebf79 sigsegv + 153
4   libsystem_platform.dylib            0x00007fff8a8425aa _sigtramp + 26
5   libobjc.A.dylib                     0x00007fff919cc62a _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 454
6   ???                                 0x0000000000000000 0x0 + 0

-- Other runtime information -----------------------------------------------

* Loaded script: ./start

* Loaded features:

    0 enumerator.so
    1 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/enc/encdb.bundle
    2 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/enc/trans/transdb.bundle
    3 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/rbconfig.rb
    4 thread.rb
    5 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/thread.bundle
    6 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/compatibility.rb
    7 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb
    8 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/deprecate.rb
    9 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/errors.rb
   10 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/version.rb
   11 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/requirement.rb
   12 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/platform.rb
   13 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb
   14 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb
   15 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/util/stringio.rb
   16 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb
   17 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/exceptions.rb
   18 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
   19 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/2.1.0/monitor.rb
   20 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb
   21 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems.rb
   22 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/path_support.rb
   23 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb
   24 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/gosu-0.7.50/gosu.bundle
   25 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/gosu-0.7.50/lib/gosu/swig_patches.rb
   26 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/gosu-0.7.50/lib/gosu/patches.rb
   27 /Users/addisonbean/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/gosu-0.7.50/lib/gosu.rb
   28 /Users/addisonbean/git/idkyet/game/lib/player.rb
   29 /Users/addisonbean/git/idkyet/game/lib/windows.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

Abort trap: 6
~~~

The game is here: https://github.com/willchangename/game
You run `./start` and exit by pressing enter on "Start" then press the escape key.

I'm sorry, but I have no idea what I causing this. I'm using Ruby 2.1.2, on OS X 1.9.4

I attached the crash log file for more information

---Files--------------------------------
ruby_2014-08-19-194047_Addison-Beans-MacBook-Pro.crash (39.1 KB)


-- 
https://bugs.ruby-lang.org/