Port-amiga archive

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

Re: More toolchain issues



On Mon, Sep 28, 2009 at 02:28:34AM +0200, Michael van Elst wrote:
> 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.

Ok. That's a bug in libc. See port-m68k/37631 for some history.
The fix finally introduced end of 2007 is broken.

Here is the system call stub:

_SYSCALL(__mmap,mmap)
#ifdef  __SVR4_ABI__
        movl    %d0,%a0
#endif
        rts

When mmap sets errno the _SYSCALL macro will return through
a private CERROR exit which knows nothing about returning
pointer values in %a0. Even worse, CERROR junks the %a0 contents.


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


Home | Main Index | Thread Index | Old Index