[Issue 6376] core.thread.thread_scanAll doesn't scan the stack due to ASLR on Mac OS X 10.7
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 26 03:14:57 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6376
kennytm at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Throwing exception or |core.thread.thread_scanAll
|assertion failure causes |doesn't scan the stack due
|segfault or memory error |to ASLR on Mac OS X 10.7
|due to ASLR on Mac OS X |
|10.7 |
--- Comment #8 from kennytm at gmail.com 2011-07-26 03:14:47 PDT ---
The classinfo corruption is because the Throwable object is finalized
prematurely. This is because the object is placed *on stack*, and the stack is
not marked by the GC (!) using core.thread.thread_scanAll. Updated title to
reflect the deeper cause.
Test case:
---------------
import core.stdc.stdio;
import core.thread;
void main() {
void scan(void* from, void* to) {
printf("%p -> %p\n", from, to);
}
size_t stackTop;
thread_scanAll(&scan, &stackTop);
}
---------------
With ASLR:
0x201fc0 -> 0x201fe4
Without ASLR:
0xbffff924 -> 0xc0000000
0x201fc0 -> 0x201fe4
Note that the stack is > 0xc000_0000 when ASLR is enabled.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list