[racket-dev] online check syntax deadlock: can you help?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Sep 1 08:34:42 EDT 2011

At Wed, 31 Aug 2011 23:00:25 -0700, John Clements wrote:
> On Aug 31, 2011, at 5:08 PM, Robby Findler wrote:
> > I've been seeing for some time now a deadlock in online check syntax.
> > That is, after a while it just gets stuck and fails to complete the
> > online check syntax. Typically what you see is the little blue dot
> > come on but the cpu load drop to zero without any check syntax arrows
> > ever showing up.
> > 
> > Matthew and I have fixed a few things that could lead to these
> > symptoms and I've just now pushed a change to compiler/cm to add some
> > more informative logging.
> > 
> > So: if you have the energy, can you please run DrRacket like this:
> > 
> >  racket -W info -l- drracket
> This doesn't work at all for me on the Mac, and highlights a problem that I've 
> had at other times with racket & GUI frames: none of the keyboard input goes 
> to the window.
> Specifically, here's the sequence of events:
> 1) run racket -W info -l- drracket
> 2) See splash window come up, *underneath* terminal window and not given focus.
> 3) See DrRacket frame come up, again without focus.
> 4) Click on DrRacket frame, it gets focus and I see the cursor blinking.
> 5) Type a few characters -- they don't show up in DrRacket. Instead, they go 
> to the terminal window.
> Furthermore, there's no DrRacket menu bar, and no DrRacket icon in the cmd-tab 
> list.
> 6) Go back to terminal window, use ctrl-\ to blow it away.
> Is that expected? It looks like the OS is preventing 
> not-full-fledged-app-things from opening windows and handling input. This is 
> OS 10.6,8.

The code that is supposed to make the process a full-fledged app is
line at line 81 of "collects/mred/private/cocoa/queue.rkt":

 ;; In case we were started in an executable without a bundle,
 ;; explicitly register with the dock so the application can receive
 ;; keyboard events.
 (define-cstruct _ProcessSerialNumber
   ([highLongOfPSN _ulong]
    [lowLongOfPSN _ulong]))
 (define kCurrentProcess 2)
 (define kProcessTransformToForegroundApplication 1)
 (define-appserv TransformProcessType (_fun _ProcessSerialNumber-pointer
                                            -> _OSStatus))
 (void (TransformProcessType (make-ProcessSerialNumber 0 kCurrentProcess)

Note that the code ignores the result of `TransformProcessType', which
is a bad idea. If you remove the `void' wrapper, what number result
gets printed on your machine?

Posted on the dev mailing list.