Please sign in to comment.
Work around segfault in rb_ary_store during extension initialization,…
… bump version to 1.0.3 I've only seen this segfault when running Sequel's default rake task with home_run loaded on OpenBSD amd64. Even though rb_ary_push is given the correct arguments, a segfault still occurs in rb_ary_store. Unfortunately, it doesn't happen if you build ruby in debug mode, so I can't tell why it occurs. My best guess is it is due to an unforunate interaction between ruby and OpenBSD malloc which only happens on amd64 and only when memory happens to be laid out a certain way. This commit avoids the issue by using rb_ary_new4 and a temporary C array instead of using a blank ruby array and rb_ary_push to add items to it. I also tried increasing the integer passed to rb_ary_new2 as well as using rb_ary_new instead of rb_ary_new2, which seemed to reduce the frequency of the error, but not eliminate it completely.
- Loading branch information...
Showing with 20 additions and 12 deletions.