dtc(1): reproducible segmentation fault

George Abdelmalik gabdelmalik at uniridge.com.au
Sat Oct 24 23:07:52 UTC 2015


On Sat, Oct 24, 2015 at 02:11:36PM +0100, David Chisnall wrote:
> On 24 Oct 2015, at 11:07, David Chisnall <theraven at FreeBSD.org> wrote:
> > 
> > On 23 Oct 2015, at 17:40, Ian Lepore <ian at FreeBSD.org> 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.


More information about the freebsd-current mailing list