Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: More toolchain issues



On Sun, Sep 27, 2009 at 11:10:57PM +0200, Frank Wille wrote:

> > Yes, I can reproduce this. malloc() returns a pointer but
> > accessing the first byte of the allocated area already
> > results in a segfault.
> 
> Ok. So the problem can easily be reproduced with the following small source:

Allocating 80MB "should" fail. If you look at the process map it is obvious:

00002000      8K read/exec         /home/guest/a.out
00004000   1008K read/write          [ anon ]
08004000     48K read/exec         /libexec/ld.elf_so
08010000     16K read/write          [ anon ]
08014000      8K read/exec           [ uvm_aobj ]
08016000     32K read/write          [ anon ]
0801E000    872K read/exec         /lib/libc.so.12.170
080F8000     40K read/write        /lib/libc.so.12.170
08102000     64K read/write          [ anon ]
0C000000  30720K                     [ stack ]
0DE00000   1920K read/write          [ stack ]
0DFE0000    128K read/write          [ stack ]

Memory is allocated below the stack which only leaves ~64MB.

jemalloc uses mmap() to allocate memory. When I test an equivalent
mmap() it succeeds but a ktruss reports an ENOMEM error and the
pointer returned by mmap() causes a segfault when accessed.


Greetings,
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index