Bug in pict3d leads to crash in DrRacket

There has been a bug with pict3d for some time now.

Already posted the problem a couple of times on the racket discord. Hopefully someone here can fix it

Thanks for the bump. Perhaps unsurprisingly, I'm unable to reproduce this bug on macOS. Are there other linux desktop users that can test this?

1 Like

Please, could anyone else with linux ( or another os besides mac os ) try to replicate the bug?

I see the bug as well. The current-pict3d-legacy? parameter does not change the results.

This appears to be a pretty fundamental issue in racket/draw. The following program crashes for me (on 8.17):

#lang racket
(require racket/gui/base)

(define canvas (new canvas% [parent (new frame% [label ""])] [style '(gl)]))
(send (send canvas get-dc) get-gl-context)

For me, too:

philip@bastet:/tmp$ cat sam.rkt 
#lang racket
(require racket/gui/base)

(define canvas (new canvas% [parent (new frame% [label ""])] [style '(gl)]))
(send (send canvas get-dc) get-gl-context)
philip@bastet:/tmp$ racket sam.rkt 

(process:410960): Gtk-WARNING **: 16:25:02.222: Locale not supported by C library.
        Using the fallback 'C' locale.
Gtk-Message: 16:25:02.312: Failed to load module "colorreload-gtk-module"
Gtk-Message: 16:25:02.312: Failed to load module "window-decorations-gtk-module"
invalid memory reference.  Some debugging context lost
  context...:
   /gnu/store/z0qlv55n78aajs2f6r5jcq1rfcwrdlrb-racket-vm-cs-8.17/opt/racket-vm/collects/racket/private/more-scheme.rkt:266:2: call-with-exception-handler
   /gnu/store/z0qlv55n78aajs2f6r5jcq1rfcwrdlrb-racket-vm-cs-8.17/opt/racket-vm/collects/racket/private/promise.rkt:104:0: force/generic
   /gnu/store/1c5x53nqspxpsqqipvzzf99wpas532qb-racket-8.17/lib/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:352:0: make-gtk-drawable-gl-context
   /gnu/store/1c5x53nqspxpsqqipvzzf99wpas532qb-racket-8.17/lib/racket/pkgs/gui-lib/mred/private/wx/gtk/gl-context.rkt:465:0: make-gtk-widget-gl-context
   /gnu/store/1c5x53nqspxpsqqipvzzf99wpas532qb-racket-8.17/lib/racket/pkgs/gui-lib/mred/private/wx/gtk/dc.rkt:190:4: get-gl-context method in dc%
   .../private/arrow-higher-order.rkt:379:33
   body of "/tmp/sam.rkt"

(The Gtk locale and module-loading messages are probably due to my local setup, but the rest shouldn't be.)

This code is not crashing for me on Linux. I'm running Mint 20, which is fairly old, and Racket from git(only 2 commits behind).

Are you suggesting pict3d is bugged because of an error with racket/draw?

Yes, I do not think the bug is in pict3d.