# Racket crashes with "invalid memory reference"

**URL:** <https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206>\
**Category:** Questions & Answers\
**Created:** [August 10, 2023, 3:56am UTC](https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206 "2023-08-10T03:56:48Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![LiberalArtist](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/liberalartist/32/151_2.png) [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Post date:** [August 10, 2023, 6:32pm UTC](https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206/6 "2023-08-10T18:32:54Z")

</div>

> [@wurmli](#):
>
> I had found on Racket Blog to v8.4 how to change from expeditor to readline. The result looks like this:
> 
> ```scheme
> wurmli@cirrus7:~$ racket
> Welcome to Racket v8.9 [cs].
> > ,input readline
> > 
> wurmli@cirrus7:~$ racket
> Welcome to Racket v8.9 [cs].
> invalid memory reference. Some debugging context lost
> 
> ```
> 
> and the terminal has to be killed.

If it's useful, I looked into this a little with a Trixie podman container (from a Bookworm host). With just `libedit` installed, I got (having previously done `,input readline`):

```scheme
root@04bc7ba8ba59:/racket# ./bin/racket 
Welcome to Racket v8.9 [cs].
; Warning: no readline support (invalid memory reference. Some debugging context lost)
> 

```

I then did `raco pkg install readline-gpl` and `apt install libreadline8`, which got me to a worse state:

```scheme
root@04bc7ba8ba59:/racket# ./bin/racket 
Welcome to Racket v8.9 [cs].
invalid memory reference. Some debugging context lost

^C; user break [,bt for context]

^C; user break [,bt for context]
^C; user break [,bt for context]

,q
^[^[^[

^C; user break [,bt for context]
^C; user break [,bt for context]
^C; user break [,bt for context]

```

(And Ctrl-D didn't get me out of this.)

I'd thought about trying `racket-x86_64-linux-natipkg-3` because the Mac equivalents include libedit, but it looks like the Linux ones do not, and I definitely never advocate adding more to those packages other than as a last resort.

> [@wurmli](#):
>
> I run Debian testing and a custom install of Racket v8.9 - as Debian is stuck with v8.7.

FWIW, on Bookworm I get Racket by:

```scheme
sudo apt install guix
guix pull
guix install racket

```

(I maintain the Guix packaging of Racket.) We also have `racket-minimal`, `zuo`, and `chez-scheme-for-racket` (in addition to upstream `chez-scheme`) packaged.

I also expect, now that Bookworm has been released, David will probably update Racket in Debian testing soon, though if I were him I'd wait until after the imminent Racket 8.10 release. Generally he keeps the packaging in testing and backports very up-to-date. Sometimes he's landed updates in Debian before I;ve gotten them into Guix, even though Guix has a rolling release model.

> [@mflatt](#):
>
> I'm not sure at what point our distibrutions should require newer version of Linux. Meanwhile, the only solution I can offer is to build from source or use a snapshot that's built on a Ubuntu 20 or 22.04 as available via [https://snapshot.racket-lang.org/](https://snapshot.racket-lang.org/).

I don't have a principled answer, but, tangentially, this reminded me that I'd found in [Native library problem on package-build service · Issue #2 · libgit2-racket/libgit2 · GitHub](https://github.com/libgit2-racket/libgit2/issues/2) that your `mflatt/pkg-build-deps-min` Docker image is [still based on](https://github.com/racket/pkg-build/blob/71c379d2997049780186d104e5464780c28efb27/examples/docker/pkg-build-deps-min/Dockerfile) Ubuntu 16.04 Xenial, which is getting to be quite old indeed. At least when I wrote my [related notes](https://github.com/libgit2-racket/native-libs/blob/0c719ea327f30a1e5e7abc13ddfdd2ad1b065316/guix/old-stable-libc.scm#L22-L46), the Racket releases were building on the slightly newer Debian 9 Stretch (June 2017), which has been out of [LTS](https://wiki.debian.org/LTS/) support for a year and is only covered by the even-more-limited [ELTS](https://wiki.debian.org/LTS/Extended).

I saw in [What is the Racket roadmap? - #6 by mflatt](https://racket.discourse.group/t/what-is-the-racket-roadmap/2204/6) that you are planning to look at the `racket/draw` native libraries relatively soon. I don't have it all paged in, but I know I've had or heard about various issues and ideas at least somewhat related to native libraries; I can try to make a list relatively soon if something like that might be useful.

---

_[View the full topic](https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206)._
