Closed jbclements closed 3 years ago
continuation-mark-set->context
seems to be returning srclocs with relative paths in them. When I follow the steps you list, I see this prefix of the list:
(("condition->exn" . #f) ("do-raise" . #f) ("dynamic-wind" . #f) (#f . #(struct:srcloc #<path:tmp.rkt> 3 0 15 22)) ....
(this is with a printf right after the call in stack-checkpoint.rkt
.)
There are absolute paths when running from racket
, tho:
$ racket
Welcome to Racket v7.8.0.10 [cs].
> (define exn (with-handlers ([exn:fail? values]) (dynamic-require `(file "/tmp/tmp.rkt") #f)))
> (continuation-mark-set->context (exn-continuation-marks exn))
(list
'("condition->exn" . #f)
'("do-raise" . #f)
'("dynamic-wind" . #f)
(cons #f (srcloc #<path:/tmp/tmp.rkt> 3 0 15 22))
'("call-with-values" . #f)
.......
I'm guessing... the srcloc structs are built at "read-syntax" time, when DrR hands the buffer's content over? Would that be the path that's passed as the optional first argument to read-syntax? Just thinking out loud...
It looks like CS code deserialization (from background expansion in this case) doesn't fall back to current-directory
as it should when current-load-relative-directory
is #f
. I'll push a repair.
Thanks for deducing that this was CS. I knew I was going to forget to mention that.
This bug seems to be back. Specifically, I'm running "version 7.9.0.10--2020-12-03(-/f) [cs]." and I can follow the original steps to observe the same broken behavior. FWIW, I do see this commit ( @8f08a9e ) in my git log.
I suspect racket/racket@f07c2fea71b726 is related to this bug. The program in the above issue prints a relative path at f07c2fea71b726 while it prints an absolute path at f07c2fea71b726~1.
@shhyou Yep - same problem, different library, allowed to happen again due to a missing test. Thanks for tracking that down, and I'll work on a repair.
Running without debugging annotations on certain saved files produce a red x that, when clicked, tries to splice the name of the current file onto the DrRacket process's current directory; if this doesn't exist, it signals an internal error and also creates a new tab that's in a strange in-between state; its title changes to "Untitled" when you switch to it.
Steps to reproduce:
1) Open DrR, open new buffer. 2) Change language level details to set to "no debugging or profiling" 3) Paste this text into the definitions window:
4) Save the file in a directory other than DrRacket's current directory (say, /tmp/tmp.rkt). 5) Click 'run'. 6) See the (expected, correct) error message "tmp.rkt:3:0: /: division by zero". 7) Click on the red source-location "x". 8) See this internal error text:
Note that the name of the file "tmp.rkt" was attached to DrRacket's current directory Note also that there's now another tab open.