[Openmcl-devel] Problems using CCL through the CGI protocol

Gary Byers gb at clozure.com
Fri May 15 03:43:32 PDT 2009

On Fri, 15 May 2009, Douglas Brunner wrote:

> At this location (http://www.lispforum.com/viewtopic.php?f=2&t=342)
> there is a discussion about the difficulties I've had when trying to
> use CCL for CGI programming.

I read both pages of that thread and still don't know what version of
CCL you're running.  Someone in that thread said something about Ubuntu;
if that was you, it might be possible to conclude that you're running
under Linux.

Both pieces of information are often very useful; when in doubt about
whether to provide them, it's generally better to err on the side of
doing so: it's easier to ignore the information if it's not relevant
than to have to guess if it might be.

> We've mostly identified it as a problem with Apache, and a solution
> was found for my work computer; but now the exact same issue has
> popped up on my personal computer. I'm hoping to get to the bottom of
> the problem because I'd like to use this implementation.
> Note: the OS on both computers are the same, but the hardware is different.
> Compiling this program and saving it produces an error (Both listed
> below). I can't even save the program with a prepended kernel.
> :The Program
> (defun test()
>  (format t "Content-type: text/html~%~%")
>  (format t "this is a test")0)
> :The Error
>> Error: value NIL is not of the expected type REAL.
>> While executing: CCL::<-2, in process Initial(0).
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.
> 1 >

It's very hard to know what the problem is without knowing
anything about the execution context in which that error
occurred.  Generating a backtrace at the break loop prompt
(and including that output in a bug report) can provide helpful
context information.  Without that, all that anyone can do
is agree that NIL isn't of type REAL and shouldn't have been
passed as an argument to CCL::<-2 (which is the function that
implements the two-argument case of #'<), but it'd be more interesting
why something's calling that function with NIL as an argument.

> The other problem I have, is that just saving the image and passing it
> to the kernel also produces an error.

How is this different from "saving the program" which led to the
error above ?

> :The program
> (defun test()
>  (format t "Content-type: text/html~%~%")
>  (format t "this is a test")0)
> (ccl:save-application "app.image")
> :The error
> $ /home/doug/Software/ccl/ccl -I /home/doug/trunk/htdocs/app.image
> Couldn't load lisp heap image from /home/doug/trunk/htdocs/app.image

$ ls -l /home/doug/trunk/htdocs/app.image

show that the "app.image" file to be about the same size as the distributed
default image file (whose name I could refer to if I knew what version of
the lisp you were running and on what platform ?)  Does that show anything
else unusual about the file or its permissions ?

There are certainly other things that can go wrong (and the image loader
could afford to say something more helpful about them), but the terse
"Can't load lisp heap image ..." message almost always means one of:

1) the file doesn't exist
2) the file can't be opened for reading
3) the file can be opened for reading but doesn't contain the expected
    signature bytes that identify it as a heap image file.

Other things that could cause a failure to load the file - I/O errors,
memory-management things - will generally do a better job of describing
the failure.

More information about the Openmcl-devel mailing list