Subject: [clisp-list] Reporting ffi broken

From: Peter Wood <[email-masked]>
Date: Thu Mar 28 02:21:11 2002

Hi

If anyone can tell me I am wrong, I promise to eat my hat, and be
happy about it.

If you want some background for this read the thread 'def-call-in
problem'.  I have tried the sort example (example 29.5) in impnotes,
with the only change being:

;--------------- 
(defpackage "FFI-TEST" (:use "LISP" "FFI")) 
(in-package "FFI-TEST") 
;-------------- 
;instead of:
(use-package "FFI")
;-----------------

And I get the same error message as described in the other thread.  I
am using a 'full' directory renamed 'base' so I didn't get the
sigsegv.

I have tried my own module on Clisp all the way back to 2.24 
( clisp-2000-03-06.tar.bz2) and get the error message about
*terminal-io* and a sigsegv if I am using clisp's base directory.

Has anyone ever actually used def-call-in?  Is anyone using it now?
What Clisp version are you building with?  If you have a working example
with 'def-call-in' might I be allowed to see it, so I can discover
what I am doing wrong?

I have tried stepping (si) through this with gdb and the first
indication I can find that something is wrong is when a stream_read
causes this:

0x08051783      1492                    *object_ptr = stream_read(&STACK_0,NIL,NIL); # Objekt lesen
(gdb) 

*** - The value of *TERMINAL-IO* was not a stream: #<CLOSED TERMINAL-STREAM>. It has been changed to #<IO TERMINAL-STREAM>.0x0805e1f6 in interpret_bytecode_ (closure=0x2036fccd, codeptr=0x203357b8, 
    byteptr_in=0x203357ca "ÇP\nk\003*\024m\004\0010\005Q&\006\031i\001\002/\a\031\001N\001") at eval.d:7524
7524                finish_entry_frame_1(CATCH,returner, goto catch_return; );

Up to this point, the stream_read was succeeding.

I have only used gdb very superficially before, so I am struggling to
think of what I can do.  Can anyone suggest what I should do in gdb...

Please.

Regards,
Peter

---

From: Peter Wood <[email-masked]>
Date: Fri Mar 29 21:36:08 2002

Hi,

Thanks for your reply.

On Fri, Mar 29, 2002 at 08:19:19PM -0500, Todd Sabin wrote:
> Peter Wood <[email-masked]> writes:
> 
> clg-0.51 uses def-c-call-in, and I've gotten it to build (required
> some patches) and run ok with clisp-2.27, including callbacks.  Have
> you tried def-c-call-in?  Your example code with def-call-in didn't
> specify a language; maybe the default isn't what you expect?  (Don't
> really know, just guessing...)
> 
> 
> Todd
> 

I get the same result when I use def-c-call-in.  However, if you could
build clg with 2.27, I must be doing something wrong, since it uses
def-c-call-in.

If you have nothing against it, would you send me the patches you used
to get it to build.

Thanks again,

Peter

---

From: Peter Wood <[email-masked]>
Date: Sun Mar 31 21:36:02 2002

> really know, just guessing...)

Hi, I'm beginning to think this may be a linux issue.  What OS were
you using?

Regards,
Peter