Project

General

Profile

Actions

Feature #3762

closed

c++ exceptions result in segfault when raised in rb_thread_blocking_region callback

Added by deepfryed (Bharanee Rathna) over 14 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:31936]

Description

=begin
http://gist.github.com/556829

This works under ruby1.9.1 but segfaults on 1.9.2 - any insights or suggestions would be much appreciated.

Thanks
=end

Actions #1

Updated by normalperson (Eric Wong) over 14 years ago

=begin
Bharanee Rathna wrote:

Backport #3762: c++ exceptions result in segfault when raised in rb_thread_blocking_region callback
http://redmine.ruby-lang.org/issues/show/3762

Author: Bharanee Rathna
Status: Open, Priority: Normal

http://gist.github.com/556829

This works under ruby1.9.1 but segfaults on 1.9.2 - any insights or
suggestions would be much appreciated.

rb_thread_blocking_region in 1.9.1 is less robust and you can probably
get away with mistakes like this as a result.

Instead, you should catch inside blocking_function (or write a wrapper
function to catch and pass that wrapper to TBR instead).

--
Eric Wong

=end

Actions #2

Updated by nobu (Nobuyoshi Nakada) over 14 years ago

  • Category set to ext
  • Status changed from Open to Rejected

=begin
You can't break from blocking functions with C++ exception.
Ruby's exception mechanism which is implemented based on setjmp/longjmp is not compatible with C++'s one.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0