An error occurred in function GET-FRAME-FUNCTION:

"lcluke" <[email protected]> Sat, 26 Apr 2003 03:30:23 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
Well, I have ported the famous OpenGL gears demo by Brian Paul to 
Corman Lisp using the FFI and SDL. If you haven't seen this demo, it 
consists of three continuously rotating and intermeshing red, green 
and blue gears. In my case, I have added the ability to rotate the 
gears around the x/y axis by click-dragging the mouse. It works 
well, returning 72 frames a second on a Athlon 1900 with an old 
nVidia TNT graphics card, and around 1,800 frames a second on a dual 
Xeon 2.8Ghz and Radeon 9700 Pro gfx card.

However, I am receiving a couple of errors from CCL when I attempt 
to build an exe. A point worth mentioning is that I receive 
absolutely no errors when the program is run within CCL. The program 
doesn't crash and I have left it runnning without incident for hours.

I have tried building an executable using two different 
installations of CCL. The first was a fresh install of CCL 2.01 with 
none of the recent patches applied. This configuration actually 
gives the fewest errors, with GET-FRAME-FUNCTION being reported 
around 10% of the time and PROCESS-EACH-HEAP-BLOCK reported around 
5% of the time. The rest of the time, the executable is actually 
built successfully. I am using (SAVE-
APPLICATION "opengl-gears.exe" 'opengl-example-1 :static t).

The second configuration is CCL 2.01 with all the recent patches 
applied. In this case I can't build an executable at all. I have 
tried under Windows XP Home and XP Server. Also, when the build 
fails with the GET-FRAME-FUNCTION error, a subsequent call to (SAVE-
APPLICATION "opengl-gears.exe" 'opengl-example-1 :static t) returns 
the following error...

;; Creating application opengl-gears.exe
;;; An error occurred in function SAVE-IMAGE:
;;; Error: Could not open file opengl-gears.exe for writing

... however, subsequent calls to (SAVE-APPLICATION) using CCL 2.01 
with NO patches applied actually succeed, and the exe is build 
seccessfully.

I am using FFI, however I'm not sure how a simple exe build could
trigger an error if none of the code is actually executed - right ? 
(Is a (ct:malloc) executed in an exe build?).

The code is relatively lengthly.. around 630 lines for the actual 
gears application without the SDL and OpenGL FFI definitions. Too 
big to post here.

Anyone know what could be causing this?

Here are the stack dumps....

/*****************************************************
The following two errors are prior to the CCL 2.01
patches being applied.
*****************************************************/

;; Creating application opengl-gears.exe
;;; An error occurred in function GET-FRAME-FUNCTION:
;;; Error: #<Memory-Access-Violation-Error #xC61030>
;;; Entering Corman Lisp debug loop. 

(db:dump-error-stack)


(INVOKE-DEBUGGER #<Memory-Access-Violation-Error #xC61030>)
(ERROR MEMORY-ACCESS-VIOLATION-ERROR "A system error of type ~A 
occurred" MEMORY-ACCESS-VIOLATION-ERROR)
(COMMON-LISP::%THROW-SYSTEM-EXCEPTION :EXCEPTION-ACCESS-VIOLATION)
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(DEBUG::GET-FRAME-FUNCTION 27)
(DEBUG::DEBUG-MAX-LEVEL)
(COMMON-LISP::DEBUGGER)
(INVOKE-DEBUGGER The kernel function (passed to PROCESS-EACH-HEAP-
BLOCK) allocated a heap object)
(ERROR "The kernel function (passed to PROCESS-EACH-HEAP-BLOCK) 
allocated a heap object")
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%STRINGNODE)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(SAVE-IMAGE)
(SAVE-APPLICATION "opengl-gears.exe" (OPENGL-EXAMPLE-1) :STATIC T)
(#< COMPILED-FUNCTION: #x13180C0 >)
(FUNCALL #< COMPILED-FUNCTION: #x13180C0 >)
(EVAL (SAVE-APPLICATION "opengl-gears.exe" 'OPENGL-EXAMPLE-1 :STATIC 
T))
(TOP-LEVEL)
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(LOAD-IMAGE)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
NIL


;; Creating application opengl-gears.exe
;;; An error occurred in function SAVE-IMAGE:
;;; Error: The kernel function (passed to PROCESS-EACH-HEAP-BLOCK) 
allocated a heap object
;;; Entering Corman Lisp debug loop. 

(db:dump-error-stack)

(INVOKE-DEBUGGER The kernel function (passed to PROCESS-EACH-HEAP-
BLOCK) allocated a heap object)
(ERROR "The kernel function (passed to PROCESS-EACH-HEAP-BLOCK) 
allocated a heap object")
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%STRINGNODE)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(SAVE-IMAGE)
(SAVE-APPLICATION "opengl-gears.exe" (OPENGL-EXAMPLE-1) :STATIC T)
(#< COMPILED-FUNCTION: #x1317EF0 >)
(FUNCALL #< COMPILED-FUNCTION: #x1317EF0 >)
(EVAL (SAVE-APPLICATION "opengl-gears.exe" 'OPENGL-EXAMPLE-1 :STATIC 
T))
(COMMON-LISP::DEBUGGER)
(INVOKE-DEBUGGER #<Memory-Access-Violation-Error #x1318310>)
(ERROR MEMORY-ACCESS-VIOLATION-ERROR "A system error of type ~A 
occurred" MEMORY-ACCESS-VIOLATION-ERROR)
(COMMON-LISP::%THROW-SYSTEM-EXCEPTION :EXCEPTION-ACCESS-VIOLATION)
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(DEBUG::GET-FRAME-FUNCTION 27)
(DEBUG::DEBUG-MAX-LEVEL)
(COMMON-LISP::DEBUGGER)
(INVOKE-DEBUGGER The kernel function (passed to PROCESS-EACH-HEAP-
BLOCK) allocated a heap object)
(ERROR "The kernel function (passed to PROCESS-EACH-HEAP-BLOCK) 
allocated a heap object")
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%STRINGNODE)
NIL


/*****************************************************
This error, after all the patches are applied
*****************************************************/

;;; Returning to top level loop.
;; Creating application opengl-gears.exe
;;; An error occurred in function GET-FRAME-FUNCTION:
;;; Error: #<Memory-Access-Violation-Error #xCCA5B0>

(db:dump-error-stack)

(INVOKE-DEBUGGER #<Memory-Access-Violation-Error #xCCA5B0>)
(ERROR MEMORY-ACCESS-VIOLATION-ERROR "A system error of type ~A 
occurred" MEMORY-ACCESS-VIOLATION-ERROR)
(COMMON-LISP::%THROW-SYSTEM-EXCEPTION :EXCEPTION-ACCESS-VIOLATION)
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(DEBUG::GET-FRAME-FUNCTION 24)
(DEBUG::DEBUG-MAX-LEVEL)
(COMMON-LISP::DEBUGGER)
(INVOKE-DEBUGGER Could not open file opengl-gears.exe for writing)
(ERROR "Could not open file ~A for writing" "opengl-gears.exe")
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%STRINGNODE)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
(SAVE-IMAGE)
(SAVE-APPLICATION "opengl-gears.exe" (OPENGL-EXAMPLE-1) :STATIC T)
(#< COMPILED-FUNCTION: #xCA33D8 >)
(FUNCALL #< COMPILED-FUNCTION: #xCA33D8 >)
(EVAL (SAVE-APPLICATION "opengl-gears.exe" 'OPENGL-EXAMPLE-1 :STATIC 
T))
(TOP-LEVEL)
(FUNCALL)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(LOAD-IMAGE)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%HEAP_FAULT_HANDLER)
(COMMON-LISP::%LOAD-LOCAL-HEAP)
NIL



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/W7NydA/hdqFAA/bW3JAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/