From owner-freebsd-mips@freebsd.org Sat Oct 17 09:57:27 2015 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD2FA161A2 for ; Sat, 17 Oct 2015 09:57:27 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 22A5C1576; Sat, 17 Oct 2015 09:57:26 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221]) by hz.grosbein.net (8.14.9/8.14.9) with ESMTP id t9H9v9OM066073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 17 Oct 2015 11:57:12 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: sbruno@freebsd.org Received: from eg.sd.rdtc.ru (eugen@localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTP id t9H9v0Ad092201; Sat, 17 Oct 2015 16:57:01 +0700 (KRAT) (envelope-from eugen@grosbein.net) Subject: Re: strange error building print/texinfo To: Sean Bruno , freebsd-mips@freebsd.org References: <56212F5F.3020603@rdtc.ru> <56217396.1050509@freebsd.org> From: Eugene Grosbein Message-ID: <56221B6C.1060406@grosbein.net> Date: Sat, 17 Oct 2015 16:57:00 +0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <56217396.1050509@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM autolearn=no version=3.3.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on hz.grosbein.net X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2015 09:57:27 -0000 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.