[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems when using the 'FOREIGN FUNCTION CALL INTERFACE'



Project: We are studying 'Information Science' at the 'University of Konstanz' and are currently working on our graduate work. In this work we aim to integrate a theorem prover written in 'C' in our 'CMU Common Lisp-Environment' (-> version 16b on SPARCstation/Sun 4 with 16/24 Mb memory) and in this term we intend to make exzessive use of the 'FOREIGN FUNCTION CALL INTERFACE' (-> calling external 'C'-Functions and accessing the environment of this 'C'-functions after they have done their work). At the moment we try to evaluate whether this aim of our work is feasable.

Problem-Description: All our tests we have done so far, base on your 'Step-by-Step Alien Example', presented in the 'CMU Common Lisp User's Manual' (revised version of Technical Report CMU-CS-87-156 from  March 11, 1992). 
Problems:
1.) function 'def-c-record' is not working as intended (-> 'Error in EVAL::LEAF-VALUE: the function DEF-C-RECORD is undefined.')
2.) function 'def-alien-routine' is not working when called with a list containing the LISP-name and the foreign name, like in the example ('-> Error in function COMMON-LISP::%SET-FDEFINITION. Malformed function name: "cfun".')
3.) function 'load-foreign' could not load the 'C' object file after having successful executed the Shell-Script 'load-foreign.csh', as demonstrated in your example (->  * (load-foreign "cfun.o" :base-file "/pro/hoehle/lib/CMUlisp/lisp")
;;; Running library:load-foreign.csh...
;;; Loading object file...
segv_handler: No mapping fault: 0x00000000



Error in function UNIX::SIGSEGV-HANDLER.
Segmentation Violation at #x71A8.)

The originally left Shell-Script was hereby started with the following environment:
'argv	(/tmp_mnt/pro/hoehle/lib/CMUlisp/lisp C00000 /tmp/tmp15991A /tmp/tmp15991B cfun.o -lc)
cwd	/tmp_mnt/stud/fink/test
echo	
home	/stud/fink
path	(/usr/openwin/bin/xview /usr/openwin/bin /usr/ucb /usr/bin /usr/etc /usr/local/bin . /stud/fink /stud/fink/bin /stud/fink/Otter/bin /pro/wis/bin /home/smalltalk/bin /usr/local/info /pack/publisher/bin /pack/publisher/bin/sun4 /pack/ioffice/bin)
shell	/bin/csh
status	0
term	sun-cmd
user	fink'

And finally, the setting of our Lisp-Environment:
'* *environment-list*

((:CMUCLLIB . "/pro/hoehle/lib/CMUlisp")
 (:CMUCL_EMPTYFILE . "/stud/fink/empty_lisp_mmap")
 (:TERMCAP . "sun-cmd:te=\\E[>4h:ti=\\E[>4l:tc=sun:")
 (:XAPPLRESDIR . "/usr/openwin/lib/X11/app-defaults")
 (:WMGR_ENV_PLACEHOLDER . "/dev/win3") (:WINGZ . "/pack/Wingz")
 (:WINDOW_PARENT . "/dev/win0") (:USER . "fink") (:TERM . "sun-cmd")
 (:SUNDESK . "/usr/sundesk") (:SHELL . "/bin/csh")
 (:PWD . "/tmp_mnt/stud/fink/test") (:PRINTER . "lwNTX_C201")
 (:PATH
  . "/usr/openwin/bin/xview:/usr/openwin/bin:/usr/ucb:/usr/bin:/usr/etc:/usr/local/bin:.:/stud/fink:/stud/fink/bin:/stud/fink/Otter/bin:/pro/wis/bin:/home/smalltalk/bin:/usr/local/info:/pack/publisher/bin:/pack/publisher/bin/sun4:/pack/ioffice/bin")
 (:OPENWINHOME . "/usr/openwin") (:NEWSSERVER . "2250380566.2000;stein")
 (:MORE . "-c") (:MANPATH . "/usr/openwin/share/man:/usr/man")
 (:LOGNAME . "fink") (:LD_LIBRARY_PATH . "/usr/openwin/lib")
 (:II_SYSTEM . "/apps/rdb") (:HOME . "/stud/fink")
 (:HELPPATH . "/usr/openwin/lib/help/de:/usr/openwin/lib/help")
 (:FRAMEBUFFER . "/dev/fb") (:FONTPATH . "/usr/openwin/lib/fonts")
 (:DISPLAY . ":0") (:DESKSET . "/wap/deskset"))`

Could you please help us in solving this problems (-> especially the last problem) in the next days, because otherwise we have to discard our intention as described above ?!

With regards, Josef and Matthias.