[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

rb_protect in rb_f_fork?

From: ctm@... (Clifford T. Matthews)
Date: 2006-09-29 18:55:05 UTC
List: ruby-core #8958
Howdy,

I wrote some code that creates a continuation in a process, forks and
trys to call the continuation.  It fails with a "continuation called
across trap" Runtime error, due to--I believe--a combination of
rb_protect in rb_f_fork (process.c) and the test at the beginning of
rb_cont_call (eval.c).

A little Googling and attempting to read translations of Ruby-dev
(e.g., 25003) suggest that it used to be possible to get Ruby to dump
core by calling a continuation outside a trap in which the
continuation was defined.  I can see why that would be disallowed, but
as far as I can tell, that's not the same issue with calling a
continuation in a child that was created in the parent.

I've already verified that if I remove the test in rb_cont_call, I can
successfully call continuations in the child that were created in the
parent.  I haven't actually verified that getting rid of the
rb_protect call in fork will also allow such continuation use, but I
suspect it will.

I can live with the current behavior, and I hate to waste people's
time with silly questions, but I'm a curious guy.  What's the reason
for the rb_protect call in rb_f_fork?

-- 
Cliff Matthews <ctm@ardi.com>

In This Thread

Prev Next