[Openmcl-devel] a problem with the callback stack

alex crain alexcrain at mail.widgetworks.com
Sat Jan 15 22:55:29 PST 2005

So I write a little callback:

(define-objc-method ((:<NSS>ize :window-will-resize (:id window)
				:to-size (:<NSS>ize size))

and it crashes when I run it. So I trace it, and I get:

CALLING -[HemlockWindowController windowWillResize:toSize:]
SELF = [:ID] #<A Mac Pointer #xBFFFE550>
_CMD = [:<SEL>] #<HEMLOCK-WINDOW-CONTROLLER <HemlockWindowController: 
0x853495a0> (#x853495A0)>
WINDOW = [:DOUBLE-FLOAT] -5.351074039314703D-229
SIZE = [:<NSS>size width=601.0 height=423.0]

Everything is shifted by 4 bytes. DEFCALLBACK-BODY looks right ... 
here's what it uses to take apart the stack...

((SELF (%GET-PTR #:G7303 (+ 0 0)))
  (_CMD (%GET-PTR #:G7303 (+ 4 0)))
  (WINDOW (%GET-PTR #:G7303 (+ 8 0)))
  (SIZE (%INC-PTR #:G7303 (+ 16 0))))

There's something in the first 4 bytes of the stack frame. Anybody know 
what it is?

(Everything else works fine, BTW - it's just this one callback)

More information about the Openmcl-devel mailing list