[racket-dev] wrong line marked as source of error?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Oct 19 06:44:31 EDT 2011

On Wed, Oct 19, 2011 at 3:36 AM, Marijn <hkBst at gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Robby,
>
> On 10/18/11 17:58, Robby Findler wrote:
>> On Tue, Oct 18, 2011 at 8:39 AM, Marijn <hkBst at gentoo.org> wrote:
>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>
>>> On 10/18/11 14:09, Robby Findler wrote:
>>>> Oh, and one more comment: did  you try clicking on the
>>>> left-hand little red icon? That shows you the part of the stack
>>>> that is in other files (if there is any to be shown).
>>>
>>> I did try that, but it didn't show anything outside my one file.
>>
>> At the moment, the more precise (possibly with missing chunks)
>> source location annotations override the others. You might get
>> more information if you disable debugging.
>>
>> I've just pushed an improvement to that window so it shows both
>> stacks (when they are both available). Hopefully that'll help in
>> the future.
>
> I see the additional information, but getting multiple pages of code
> pointed out as the source isn't very helpful.
> In this case the error occurs because I broke the contract of the
> editor-admin% method get-view by supplying a non-number in one of the
> boxes in which it expects return values. I don't understand your
> explanation of why it cannot find the line that produced the
> non-number input to +, or even the line with that addition outside my
> source file. From the user perspective it just looks like racket
> blames a semi-random line, which in this case is responsible for some
> of the construction of the objects, but hardly the real source of the
> error.

Yes, it needs to be better, I agree.

FWIW, the blame is intended to be with the call to '+' but our
primitives do not come with blame information (unlike, say, functions
provided with contract-out). The contract that you broke is apparently
not being checked, which leads to a contract being broken by get-view
(or something it calls).

Fixing this is more of a challenge. The fix I pushed merely helps us
figure out what is going on in situations like this (at least a little
bit more of a clue).

Robby



Posted on the dev mailing list.