racket / gui

Other
63 stars 77 forks source link

make-gl-bitmap exposes ffi error (maybe specific to Mac OS) #136

Open LiberalArtist opened 5 years ago

LiberalArtist commented 5 years ago

This program:

#lang racket/base

(require racket/class racket/gui/base)

(make-gl-bitmap 10 10 (new gl-config%))

produces the following error message, both in DrRacket and at the command line:

memcpy: contract violation
  expected: cpointer?
  given: #<variable-code>
  argument position: 1st
  other arguments...:
   #<cpointer>
   40
  context...:
   /Applications/Racket v7.3/share/pkgs/gui-lib/mred/private/wx/cocoa/cgl.rkt:210:12: for-loop
   /Applications/Racket v7.3/share/pkgs/gui-lib/mred/private/wx/cocoa/cgl.rkt:187:8: surface-flush method in bitmap%
   /Applications/Racket v7.3/share/pkgs/gui-lib/mred/private/wx/cocoa/cgl.rkt:183:8: get-cairo-surface method in bitmap%
   /Applications/Racket v7.3/share/pkgs/gui-lib/mred/private/wx/cocoa/cgl.rkt:225:0: create-gl-bitmap
   "/Users/philip/Downloads/tmp-memcpy-error.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   perform-require!78

I've only tested this on Mac OS so far.

mflatt commented 5 years ago

That commit fixes some obvious problems and makes the crash go away on my machine, but I haven't paged this back in enough to remember how to check it properly.