Date: Sat, 17 Oct 2015 16:57:00 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: Sean Bruno <sbruno@freebsd.org>, freebsd-mips@freebsd.org Subject: Re: strange error building print/texinfo Message-ID: <56221B6C.1060406@grosbein.net> In-Reply-To: <56217396.1050509@freebsd.org> References: <56212F5F.3020603@rdtc.ru> <56217396.1050509@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 17.10.2015 05:00, Sean Bruno wrote: > I just built print/texinfo with the lastes qemu-user-static without an > issue: > http://tasty.ysv.freebsd.org/build.html?mastername=11mips-default&build= > 2015-10-16_18h26m15s I've digged it: install(1) calls mmap() inside its copy() function: /* * Mmap and write if less than 8M (the limit is so we don't totally * trash memory on big files. This is really a minor hack, but it * wins some CPU back. */ done_copy = 0; if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, from_fd, (off_t)0)) != MAP_FAILED) { nw = write(to_fd, p, size); mmap() returns NULL in my case, not MAP_FAILD. There is no check for NULL and write() returns EFAULT for attempt to write to NULL.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56221B6C.1060406>