mattn / mruby-thread

48 stars 31 forks source link

segmentation fault after GC #27

Closed ksss closed 9 years ago

ksss commented 9 years ago
$ cat test.rb
#! /usr/bin/env ruby

Thread.new {
  loop{}
}
loop { GC.start }

$ ./bin/mruby test.rb
zsh: segmentation fault  ./bin/mruby test.rb
$ cat test.rb
#! /usr/bin/env ruby

Thread.new {
  GC.start
}

$ ./bin/mruby test.rb
Assertion failed: ((obj)->tt != MRB_TT_FREE), function mrb_gc_mark, file ksss/mruby/src/gc.c, line 593.
zsh: abort      ./bin/mruby test.rb

$ uname -v
Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64

$ clang --version
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

OSX mruby: https://github.com/mruby/mruby/commit/b48514bdcb3fa1d53eb7be9b68a769af3181d0c0 mruby-thread: https://github.com/mattn/mruby-thread/commit/e139cfed05bbcbd5a37ff46c9994933cdd926e3e