Closed sorawee closed 1 year ago
More info: it looks like DrRacket's stack-checkpoint
expects cms
to contain vectors, and when "debugging" is on, something would make cms
contain vectors (I don't know what "something" is).
But normally, cms
would contain lists, and everywhere else also expects a list.
Consider:
#lang errortrace racket
(require errortrace/errortrace-key)
(continuation-mark-set->list
(exn-continuation-marks
(with-handlers ([exn:fail? values])
(error "a")))
errortrace-key)
In DrRacket, with debugging being on, it results in:
'(#(3-unsaved-editor 8 4 159 11)
#(3-unsaved-editor 7 2 119 52)
#(3-unsaved-editor 6 1 93 79)
#(3-unsaved-editor 5 0 63 126))
However, in (1) DrRacket with debugging being off and (2) plain Racket, it results in:
'(((error "a") 3-unsaved-editor 8 4 159 11)
((with-handlers ((exn:fail? values)) (error "a")) 3-unsaved-editor 7 2 119 52)
((exn-continuation-marks (with-handlers ((exn:fail? values)) (error "a"))) 3-unsaved-editor 6 1 93 79)
((continuation-mark-set->list
(exn-continuation-marks (with-handlers ((exn:fail? values)) (error "a")))
errortrace-key)
3-unsaved-editor
5
0
63
126))
@rfindler can I submit a PR to revert https://github.com/racket/drracket/commit/f4c495b27e5db5e9b5ef40c878514f3eb21ecbc2? It causes this bug. Do you recall why you made the change?
What is the error message that you got? It looks right to me, but perhaps I missed something.
Oh, that's true! I do see that. Just the text in the REPL however, isn't great:
Welcome to DrRacket, version 8.6.0.1--2022-07-08(346a6c4e/d) [cs].
Language: errortrace racket/base, with debugging; memory limit: 128 MB.
. . +: contract violation
expected: number?
given: #f
errortrace...:
The stuff after the line "errortrace" is gone.
My understanding is that it's a heuristic by DrRacket to suppress the textual stacktrace (and instead show them in the stacktrace dialog). You would know it better than I do :-). In any case, my thought is that improving that could be separate from this bug fix.
I guess I just need to track down what's going on as I just found it plain confusing!
IIRC, it's specifically exn:fail
that has this trimming. exn
would not be trimmed. From a quick grep it's probably https://github.com/racket/drracket/blob/master/drracket/drracket/private/debug.rkt#L421
Oh, I think that's something else. DrRacket makes the ellipsis-based lines clickable, hiding their content until clicked. But there is no actual content in this one, as far as I can tell.
I'm pretty sure the ...
button would have worked fine if there's no
Interactions disabled: errortrace/lang/body does not support a REPL (no #%top-interaction)
I tried:
#lang racket
(raise-argument-error 'a "a" 0 2 3)
This generates:
a: contract violation
expected: a
given: 2
argument position: 1st
other arguments...:
and the ...
button works as expected.
Now, create file.rkt
with:
#lang racket
(provide (except-out (all-from-out racket)
#%top-interaction))
and change the first program to:
#lang s-exp "file.rkt"
(raise-argument-error 'a "a" 0 2 3)
Suddenly, the ...
button no longer works!
We should definitely make ...
work when
Interactions disabled: errortrace/lang/body does not support a REPL (no #%top-interaction)
appears, but #lang errortrace
should also support the REPL. This is done in https://github.com/racket/errortrace/pull/34
@rfindler I think you didn't mean to push https://github.com/racket/drracket/commit/15a3c0610e49404d5b24b5993be90a7ed22b890e to the master branch. That commit depends on the errortrace change, which is still not pushed yet.
Oh, sorry! That was a mistake. I've reverted it for now. I want to run all the tests (and do the docs on the errortrace side) first.
With "debugging" being on, running
results in:
With "debugging" being off, running
results in: