racket / racket/gui

Random GUI error during (new message% ...)

Open
#117 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

DrRacket 7, running on Windows 10 version 1803

I've been working on a GUI program that needs to show a table of data, the columns of which change according to checkbox selections. The checkboxes are arranged in several groups, each of which has "All" and "None" buttons to allow quick checking and clearing of all buttons in that group.

If I stress the program a bit by punching checkboxes and buttons more or less randomly, it eventually fails.

I was able to come up with a smaller, self-contained program that exhibits the same behavior. I've attached it to this message.

failure.rkt.txt

Running it from the command line with errortrace gives the most information.

$ racket -l errortrace -t failure.rkt
ptr-ref: contract violation
  expected: (and/c cpointer? (not/c (lambda (p) (pointer-equal? p #f))))
  given: #f
  argument position: 1st
  other arguments...:
   #<ctype:scheme>
  errortrace...:
   C:\Users\danm\Documents\Racket\NMSRecipes\failure.rkt:124:6: (new message% (parent column) (label (number->string item)))
   C:\Users\danm\Documents\Racket\NMSRecipes\failure.rkt:123:4: (for ((item column-data)) (new message% (parent column) (label (number->string ....))))
   C:\Users\danm\Documents\Racket\NMSRecipes\failure.rkt:130:4: (make-column (format "Column ~a" i) (list-ref column-data i))
   C:\Users\danm\Documents\Racket\NMSRecipes\failure.rkt:129:2: (for ((i selected-indexes)) (make-column (format "Column ~a" i) (list-ref column-data i)))

Sometimes it can take a while to get the error; it's quite random. Clicking the All and None buttons repeatedly will eventually cause it.

I'm usually running it in DrRacket, but I've also tried it as a standalone executable, with the same result.

The DrRacket IDE isn't quite right after this happens, either. The program will fail (with the same error) immediately, if I can even restart it. Sometimes a separate black window opens, showing a similar error. The IDE usually cannot be exited normally. Most of the text editing functions still work, though.

An earlier variant of the test program called show-selected-columns directly instead of via queue-callback. It seems like the error is a little easier to produce that way.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the attached failure.rkt.txt with racket -l errortrace -t failure.rkt and inspect the reported lines 123–124, where new message% is called. Compare the queue-callback version with the earlier direct show-selected-columns variant. Done means repeated All and None clicks no longer produce the reported ptr-ref contract violation or leave the GUI unusable.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.