bytevector-uncompress: internal error uncompressing

39 views
Skip to first unread message

Jack Hill

unread,
Mar 15, 2021, 12:50:01 AM3/15/21
to racket...@googlegroups.com
Hi Racket!

I'm working on troubleshooting a bug [0] in GNU Guix's recently upgraded
Racket package to 8.0 (and to the CS implementation!). Unfortunately, new
to this version of our racket package, the graphical applications
(drracket, gracket, slideshow, etc) fail to launch with the following
error:

```
$bytevector-uncompress: internal error uncompressing #"\0\0\0\0chez\310\224\206:\r()#\201\256R-d\205\233\24\363\5\20\201P\6A\v\300\0\16\f\6\31\2\f\6\f&H\275\0\1\0\362\bA\377e\0\1\0C\6A\21\3\v\300\0\201\265!\f\6\n\0\a\1\35\0\1+\0\360\27\201\375\300\0\0\0\17\205\210Z\0\0M\215\245\b\4\0\0M9fH\17\206fZ\0\0I\2...
context...:
body of "/gnu/store/bbnhjamch9125c412bl7ybf28a0jxrkd-racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
body of "/gnu/store/bbnhjamch9125c412bl7ybf28a0jxrkd-racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt"
```

I have not tried to require other modules the depend on FFI. Clearly
something is not quite right about Guix's Racket package. I'd like to fix
it, but, unfortunately, I'm not quite sure what could have gone wrong.
Have you seen this error before? Where might I look to discovery what is
wrong?

[0] https://issues.guix.gnu.org/47064

Best,
Jack

Philip McGrath

unread,
Mar 15, 2021, 5:38:21 PM3/15/21
to Jack Hill, racket...@googlegroups.com, 47...@debbugs.gnu.org

Jack, thanks for the pointer: I hadn't noticed this earlier.

On 3/15/21 12:49 AM, Jack Hill wrote:
```
$bytevector-uncompress: internal error uncompressing #"\0\0\0\0chez\310\224\206:\r()#\201\256R-d\205\233\24\363\5\20\201P\6A\v\300\0\16\f\6\31\2\f\6\f&H\275\0\1\0\362\bA\377e\0\1\0C\6A\21\3\v\300\0\201\265!\f\6\n\0\a\1\35\0\1+\0\360\27\201\375\300\0\0\0\17\205\210Z\0\0M\215\245\b\4\0\0M9fH\17\206fZ\0\0I\2...
  context...:
   body of "/gnu/store/bbnhjamch9125c412bl7ybf28a0jxrkd-racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/gtk/utils.rkt"
   body of "/gnu/store/bbnhjamch9125c412bl7ybf28a0jxrkd-racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt"
```

This appears to be an error uncompressing Racket's compiled code—whether generated by the Racket layer or the Chez Scheme layer, I'm not sure. The stack trace is pointing to the module `mred/private/wx/gtk/utils`, which is here: https://github.com/racket/gui/blob/master/gui-lib/mred/private/wx/gtk/utils.rkt

At first glance, the most unusual-looking thing about that module is the use of `(only-in '#%foreign ctype-c->scheme)` … but it could also be something else altogether. I'll try to investigate further, but thoughts from others would be very welcome!

-Philip

Philip McGrath

unread,
Mar 15, 2021, 6:26:33 PM3/15/21
to Jack Hill, racket...@googlegroups.com, 47...@debbugs.gnu.org
I can reproduce the error with just:
```
$ racket -l mred/private/wx/gtk/utils
```

Philip McGrath

unread,
Mar 15, 2021, 6:38:39 PM3/15/21
to Jack Hill, racket...@googlegroups.com, 47...@debbugs.gnu.org
Aha! Running:

guix environment --ad-hoc --no-grafts racket -- drracket

launches DrRacket just fine.

My guess is that Racket CS is compressing string literals in compiled
code. Currently, Guix patches Racket source files to include the
absolute paths to foreign libraries in the store as string literals.
There are a bunch of grafts for GTK and such: if I'm right, Guix somehow
mangles the compiled code while attempting to apply the grafts.

I already thought this strategy was a bad idea. If it is really the
problem, I should be able to patch it fairly quickly: I've already been
experimenting along these lines.

-Philip

Philip McGrath

unread,
Mar 15, 2021, 11:01:12 PM3/15/21
to jackhill, racket...@googlegroups.com, 47...@debbugs.gnu.org
I've submitted a patch at https://issues.guix.gnu.org/47180 that I hope
will resolve this issue.

-Philip
Reply all
Reply to author
Forward
0 new messages