Project

General

Profile

Actions

Bug #11438

open

native_thread_init_stack() get machine.stack_start unequal to thread's stack start address, x86 win32

Added by rickerliang (l ly) over 9 years ago. Updated 8 months ago.

Status:
Assigned
Assignee:
Target version:
-
[ruby-core:<unknown>]
Tags:

Description

In function native_thread_init_stack() use VirtualQuery to get thread's stack start address.But some situation(ruby embbed in other application and initial it on the fly),native_thread_init_stack() will be called at low stack address and VirtualQuery return memory info BaseAddress + RegionSize < thread stack base(teb.StackBase).
In this situation,subsequently call stack_check() at high stack address will cause stack_overflow exception,because esp > machine.stack_start:
(teb.StackLimit < machine.stack_start < esp < teb.StackBase)
but actually it is not stack overflow at this time.
Use teb.StackBase instead of VirtualQuery get thread stack base is a more reliable solution.

Actions #1

Updated by hsbt (Hiroshi SHIBATA) 8 months ago

  • Status changed from Open to Assigned
Actions

Also available in: Atom PDF

Like0
Like0