Project

General

Profile

Actions

Bug #4983

closed

Fiberのガードページの設定が間違ってる

Added by kosaki (Motohiro KOSAKI) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
trunk
Backport:
[ruby-dev:44043]

Description

以下の関数でスタックのアロケーションとガードページの設定をしていますが、ガードページがPROT_READ|PROT_WRITEなのは
なにかの間違いだと思います。あとで直しておきます。

static VALUE*
fiber_machine_stack_alloc(size_t size)
{
VALUE ptr;
(snip)
}
else {
void page;
STACK_GROW_DIR_DETECTION;
ptr = (VALUE
)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
if (ptr == (VALUE
)(SIGNED_VALUE)-1) {
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
}
page = ptr + STACK_DIR_UPPER((size - RB_PAGE_SIZE) / sizeof(VALUE), 0);
if (mprotect(page, RB_PAGE_SIZE, PROT_READ | PROT_WRITE) < 0) { // ここ!
rb_raise(rb_eFiberError, "mprotect failed");


Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #3781: FIBER_USE_NATIVE が有効だと落ちるスクリプトがあるClosedauthorNari (Narihiro Nakamura)09/02/2010Actions
Related to Ruby master - Bug #1813: Threading seg fault (1.9.1-p129 Linux/Mac)Closedkosaki (Motohiro KOSAKI)07/24/2009Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0