racket / racket/drracket

DrRacket GUI for plai/gc2/mutator crashes

Open
#94 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

DrRacket GUI that displays the heap for plai/gc2/mutator language seems to run out of memory when the heap has sufficiently large number of floats, but the mutator program itself doesn't stop executing and causes DrRacket to display a ton of out of memory window.

screen shot 2017-02-21 at 11 15 29 am

An example mutator that causes this error is shown below.

#lang plai/gc2/mutator

(allocator-setup "mark-and-sweep.rkt" 500) ; This is a standard mark-and-sweep gc collector as described in https://www.eecs.northwestern.edu/~robby/courses/321-2015-winter/lecture12.pdf

(define guess 0)

(define (sqrt x) ; dumb way
  (set! guess x)
  (sqrt-rec (/ x 2) x))

(define (sqrt-rec guess x)
  (if (close? guess x)
      guess
      (begin
        (set! guess (improve guess x))
        (sqrt-rec guess x))))

(define (average x y)
  (/ (+ x y) 2))

(define (square x)
  (* x x))

(define (abs x)
  (if (< x 0)
      (- 0 x)
      x))

(define (improve guess x)
  (average guess (/ x guess)))

(define (close? guess x)
  (< (abs (- (square guess) x)) 0.001))

(define (run num)
  (if (= 0 num)
      0
      (begin (sqrt 1000000)
             (run (- num 1)))))

(define a (run 100))

Closing the heap window doesn't cause DrRacket to crash, so the problem seems to be with the rendering of heap window.

Contributor guide

No contributing guide indexed for this repository

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 reproducing the supplied #lang plai/gc2/mutator example with the mark-and-sweep collector and a heap size of 500, then inspect the heap window rendering path. Done means the heap display no longer exhausts memory or produces repeated out-of-memory dialogs while the mutator continues running.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.