mmap on emulated i386
Konstantin Belousov
kostikbel at gmail.com
Wed Sep 18 06:17:13 UTC 2013
On Tue, Sep 17, 2013 at 07:01:16PM -0700, Rui Paulo wrote:
> Hi,
>
> I'm trying to figure out why the following fails when compiled on amd64 with -m32:
>
> mmap(NULL, 0x70000, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PRIVATE, -1, 0);
>
> It returns EINVAL. I looked around everywhere but I couldn't find where the EINVAL is coming from. The length argument doesn't really make any difference. At this point I'm thinking it's a bug...
What is the version of your system, including the userspace ? -m32 only
works on HEAD. Do you have r255657/r255658 in your kernel ?
Please provide kdump of the ktraced execution of your test program, as
well as the test program itself.
N.B. The following worked fine for me, both in 64 and 32 bit binary.
#include <sys/mman.h>
#include <err.h>
#include <stdlib.h>
int
main(void)
{
char *p;
p = mmap(NULL, 0x70000, PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_ANON | MAP_PRIVATE, -1, 0);
if (p == MAP_FAILED)
err(1, "mmap");
return (0);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20130918/091b4912/attachment.sig>
More information about the freebsd-hackers
mailing list