Re: binary search debugging of compilers

gah4 <gah4@u.washington.edu>
Wed, 17 May 2023 15:23:51 -0700 (PDT)

          From comp.compilers

Related articles
[8 earlier articles]
Re: binary search debugging of compilers 864-117-4973@kylheku.com (Kaz Kylheku) (2023-05-15)
Re: binary search debugging of compilers gah4@u.washington.edu (gah4) (2023-05-16)
Re: binary search debugging of compilers rsc@swtch.com (Russ Cox) (2023-05-17)
Re: binary search debugging of compilers cameron.mcinally@nyu.edu (Cameron McInally) (2023-05-17)
Re: binary search debugging of compilers 864-117-4973@kylheku.com (Kaz Kylheku) (2023-05-17)
Re: binary search debugging of compilers 864-117-4973@kylheku.com (Kaz Kylheku) (2023-05-17)
Re: binary search debugging of compilers gah4@u.washington.edu (gah4) (2023-05-17)
Re: binary search debugging of compilers spibou@gmail.com (Spiros Bousbouras) (2023-05-18)
Re: binary search debugging of compilers rsc@swtch.com (Russ Cox) (2023-05-18)
Re: binary search debugging of compilers 864-117-4973@kylheku.com (Kaz Kylheku) (2023-05-19)
Re: binary search debugging of compilers 864-117-4973@kylheku.com (Kaz Kylheku) (2023-05-19)
binary search debugging of compilers cclick0@gmail.com (Cliff Click) (2023-05-19)
binary search debugging of compilers tekk.nolagi@gmail.com (Max B) (2023-05-19)
[4 later articles]
| List of all articles for this month |
From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Wed, 17 May 2023 15:23:51 -0700 (PDT)
Organization: Compilers Central
References: 23-05-003 23-05-005 23-05-006 23-05-008 23-05-011 23-05-012 23-05-015
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="14570"; mail-complaints-to="abuse@iecc.com"
Keywords: debug, tools
Posted-Date: 18 May 2023 13:00:08 EDT
In-Reply-To: 23-05-015

On Wednesday, May 17, 2023 at 12:08:27 PM UTC-7, Kaz Kylheku wrote:
> On 2023-05-17, gah4 <ga...@u.washington.edu> wrote:
> > On Monday, May 15, 2023 at 6:54:08 PM UTC-7, Kaz Kylheku wrote:
> >
> > (snip)
> >
> >> Say we have a basket of apples with a rotten smell emanating from it.
> >> We can subdivide it, and smell one half and the other. If both halves
> >> smell, we know we have two or more rotten apples and they ended up
> >> in different halves. This doesn't matter. We just pick one half and
> >> keep subdividing.


> > But the algorithm described, at least as I remember it, doesn't test both
> > halves.


> If the problem reproducews with the half you're testing, you assume
> the misprocessed function is in that half. (There could be a bad
> function in the other half also, and you could test that, but it's
> unnecessary.)
>
> If the problem deosn't reproduce in the half you're testing, you
> assume the misprocessed functions lie in the other half, and
> recurse on that half instead.


I was mostly noting it, as the apple test was written to test
both halves.


> The algorithm will work even if every single function is miscompiled.
> (And will take the same logarithmic number of steps, since we cut
> in half no matter what.)


> It will arbitrarily narrow it down to one, showing that even if the
> compiler change is enabled for just one function, there is a problem.
> That function can be investigated. Then maybe then the fix solve the
> issue for the five hundred other broken functions, too.


As to the problem of debugging by miscompiled code, this reminds
me of stories of debugging compilers by feeding them cards from
the card recycling bin. It seems that cards were especially high grade
paper and so worth keeping separate for recycling. I never actually
saw anyone do that, though.


In my younger days, some said that I was especially good at finding
compiler errors. Maybe not as good now. I would try things that were
allowed, but others might not have thought about doing.


Only one I remember now, is a C compiler that miscompiled the ++
operator on a double variable. Allowed in C, but maybe not often used.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.