From owner-freebsd-current@freebsd.org Sat Oct 24 23:07:52 2015 Return-Path: Delivered-To: freebsd-current@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 810A1A1E4CB for ; Sat, 24 Oct 2015 23:07:52 +0000 (UTC) (envelope-from gabdelmalik@mail.uniridge.com.au) Received: from mail.uniridge.com.au (ec2-54-206-17-100.ap-southeast-2.compute.amazonaws.com [54.206.17.100]) by mx1.freebsd.org (Postfix) with ESMTP id E9B941586; Sat, 24 Oct 2015 23:07:51 +0000 (UTC) (envelope-from gabdelmalik@mail.uniridge.com.au) Received: by mail.uniridge.com.au (Postfix, from userid 1007) id 7E4004A6F; Sun, 25 Oct 2015 10:07:50 +1100 (EST) Date: Sun, 25 Oct 2015 10:07:50 +1100 From: George Abdelmalik To: David Chisnall Cc: Ian Lepore , freebsd-current@freebsd.org Subject: Re: dtc(1): reproducible segmentation fault Message-ID: <20151024230750.GB5266@barney.uniridge.com.au> References: <562A3FE5.8020809@uniridge.com.au> <1445618437.91534.13.camel@freebsd.org> <2D772151-85F9-4D80-8074-58CD11FFF778@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-Mailman-Approved-At: Sun, 25 Oct 2015 08:33:42 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Oct 2015 23:07:52 -0000 On Sat, Oct 24, 2015 at 02:11:36PM +0100, David Chisnall wrote: > On 24 Oct 2015, at 11:07, David Chisnall wrote: > > > > On 23 Oct 2015, at 17:40, Ian Lepore wrote: > >> > >> Don't cc me. I looked at the in-tree dtc code once and decided it's > >> too flawed to try to maintain, and it supports only a subset of the > >> full dts syntax. That's why we switched back to using the gnu dtc for > >> buildkernel. But I just discovered that for some reason gnu is not the > >> copy of dtc that gets installed, it's just the one that gets used > >> during a buildkernel. > > > > Please assign the bug to me. > > Actually, it looks as if this is one of the (many) bugs in dtc that I fixed in a bunch of changes that I made (and didn?t get around to committing) last Christmas (https://github.com/davidchisnall/dtc). Patrick Wildt tested the version that I was working on with a load of things from the GPL dtc test suite and they all passed. I?m now running a make universe with the new version, and I?ll commit if there are no problems. > > David > Hi David, You've beaten me to it with the fix before I could lodge the bug report :) In your repo I've seen that the mmap(2) call now takes the MAP_PRIVATE flag. I applied that change locally to my source tree and that has fixed the problem. I've since re-read the mmap(2) man page to find out how that change could be influential... [EINVAL] None of MAP_ANON, MAP_PRIVATE, MAP_SHARED, or MAP_STACK was specified. At least one of these flags must be included. Although obvious to me now, I missed it on my previous reads. Thanks for your assistance. I look forward to your coming set of changes. In my view DTC is an important tool and I would be willing contribute effort to making it feature parity with the GPL version if that is lacking. Keep up the valuable work, George.