
firgures 1–9 which are lo rez images are blank for me but 10 and 11, which are line art (plots) are fine

problem seems to have happened in 2018 https://discussions.apple.com/thread/8628664

also https://discussions.apple.com/thread/7659306 (I have not tried the ‘solution’ comment as lower comments indicate it didnt work)


I just uploaded a version that works; I viewed the PDF from http://www.ccs.neu.edu/home/stamourv/papers/optimization-coaching.pdf in microsoft Edge on windows 10, the printed with the ‘Microsoft Print to PDF’ driver.

@stamourv

@stephen

That’s very strange. pdfjs in FF on MacOS just worked fine for me…

In general, though, MacOS’s native pdf rendering has not been great IME.

I recommend PDF Expert.

@wdobias has joined the channel

I’m trying to run a profile for a build on my filesystem. I ran raco setup --mode errortrace polyglot
after clearing the .zo
files as instructed. Then, I wrote this script.
#lang racket/base
(require errortrace
polyglot
"./cli/shared.rkt")
(when (instrumenting-enabled)
(profiling-enabled #t))
(clear-profile-results)
(define-values (directory project build!)
(init-from-user-path (build-path "/home/sage/Code/sgcom")))
(build!)
(output-profile-results #t #t)
I’m guessing as per the docs warning, this crashes as below since I required errortrace
. If I use (require errortrace/errortrace-lib)
instead, the program runs, but the profile data is empty. How am I supposed to modify this program to get expected results?
; /usr/share/racket/pkgs/errortrace-lib/errortrace/private/utils.rkt:26:18: #%require: unbound identifier;
; also, no #%app syntax transformer is bound
; at: #%require
; in: (#%require (for-meta 0 errortrace/errortrace-key))
EDIT: Brevity + add context

You could run the script as racket -l errortrace -t <script>
, or do require errortrace
but load the program to profile via dynamic-require
instead of require
. I’d write the latter.

In trying my interpretation of both options, I hit the same error #%require: unbound identifier
.
My files now look like this:
subject.rkt
: I reproduce the error when running racket -l errortrace -t subject.rkt
#lang racket/base
(require polyglot
"./cli/shared.rkt")
(define-values (directory project build!)
(init-from-user-path (build-path "/home/sage/Code/sgcom")))
(build!)
profiler.rkt
: I’ve been running this using as racket profiler.rkt
#lang racket/base
(require errortrace)
(when (instrumenting-enabled)
(profiling-enabled #t))
(clear-profile-results)
(dynamic-require (build-path "./subject.rkt") #f)
(output-profile-results #t #t)

Did I misinterpret something?

It might help to note that build!
makes heavy use of dynamic-require
under the hood, if that’s relevant.

I tried raco setup --mode errortrace
, and I see that it doesn’t really work. There are various problems with the --mode
idea, and I guess it hasn’t been practical enough for anyone to try lately. In your case, you probably have multiple processing cores, and --mode
turns out to be ignored when raco setup
runs in parallel-build mode. DrRacket should be able manage compilation with errortrace ok, so that’s one way to go. Outside of DrRacket, I normally just throw away compiled code and load from source for profiling, so maybe that will work better for you. I’m not sure about the #%require
problem, though. Does your code use eval
? Or does racket -l errortrace -l racket/base -t subject.rkt
change anything?

I’ll try loading from source now. Running the modified racket
command had no change in behavior and I do not use eval
.

I almost never use DrRacket, but I’ll lean on it if I don’t make much progress from here. You are correct in that I have multiple cores.

After running git clean -fdX
to blow away all compiled
directories, racket -l errortrace -l racket/base -t subject.rkt
still produces the same error.

More details:
• I am still on Racket 7.4 • subject.rkt
sits inside polyglot
’s source code on my file system I’m going to try again, but using DrRacket on ~7.6~ 7.5 such that the definitions window holds the source of profiler.rkt
and subject.rkt
is somewhere else. Please comment if I should change my approach, since this will take me about 10–15 min

In DrRacket you’d set the language to enable profiling (in “Choose Language -> Show Details -> Debugging and profiling”) and just run subject.rkt
. DrRacket should then display profiling information.

@mflatt: Okay, got some progress. Here’s what I did.
- Uninstalled Racket 7.4
- Installed Racket 7.5 (3m)
- Reinstalled
polyglot
from directory source usingraco pkg install --link
- Ran
git clean -fdX
to delete allcompiled
directories and thus.zo
files inpolyglot
and two local dependencies also installed with--link
(That turned out to not be relevant; I checked) - Moved
profiler.rkt
andsubject.rkt
to~/Code/sgcom
and updated their paths to match - Opened
subject.rkt
in DrRacket - Changed
(build!)
to(void (build!))
to reduce noise in output - “Choose Language -> Show Details -> Debugging and profiling”
- Clicked
Debug Run
, thenGo
- “View -> Show Profile”
Unfortunately the profiler results don’t give me paths to know where for-loop
or << unknown >>
are (see attached screenshot), so I tried to go back to running profiler.rkt
. That still reliably reproduces the #%require
error after much wrestling. I wonder if that’s related to https://github.com/racket/errortrace/pull/17?
Really all I need at this point is to see the paths mentioned in each profile line item. Can I turn that on in the GUI? I don’t see an option for it in the preferences dialog or the language selection dialog.

That pull request probably explains why it’s #%require
instead of require
, but then the question is still: who is calling eval
? Does the stack trace with the #%require
error message provide any hints?

@deactivateduser60718 Robby suggests adjusting https://github.com/racket/drracket/blob/master/drracket/drracket/private/debug.rkt#L2371 to recognize path values, or just use (format "~a" src)
as a fallback to catch everything.

Yes I think that that’s a bug in drr