racket / racket/racket

Bug with futures and debugging and profiling

Open
#5,576 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Racket
Stars
5.2k
Forks
698
Avg merge
18h 34m
Merged PRs (30d)
5

Description

What version of Racket are you using?
9.3 [cs] inside DrRacket

I also get an error in 9.2

What program did you run?

#lang racket ;in DrRacket with debugging & profiling

(define f-one
  (future
   (lambda ()
     (let-values ([(end) (expt 2 10000)])
       (cons 1 null)))))

(define f-two
  (future (lambda () 2)))

(touch f-one)

What should have happened?

Show (1). (Or perhaps an out of memory error???).

If you got an error message, please include it here.

-: contract violation
  expected: number?
  given: #<void>

Please include any other relevant details

To get the error I must run it in DrRacket with debugging and profiling. It raises the error like 99% of the time. Most of the code can be eliminated, but it only raises the error like half of the time. My guess the problem is in blocking and unblocking.

This is a minimized version of the example posted by @joskoot in https://racket.discourse.group/t/futures-not-running-parallely/4366

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 with the minimized Racket program in the issue and reproduce it in DrRacket with debugging and profiling enabled. Investigate the futures blocking and unblocking behavior around touch, then verify that the program reliably produces (1) without the number? contract violation; the report notes no specific files or tests.

Written by the indexing model from the issue text.

Assessment

Domain
devtools, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.