[Ecls-list] Embedding ECL (Newbie)

Geoff Cant nem at lisp.geek.nz
Mon Jan 23 19:36:01 UTC 2006


Hmm, after fiddling with the c code for a bit I ended up with the  
attached.

The Lisp_Init function called by quake also calls the init_QUAKE  
function (which initialises the contents of quake.lisp?). That seems  
to stop some of the massive recursive crashes. I added the (setf  
*terminal-io* (make-broadcast-stream)) call to quake.lisp, but didn't  
notice much difference in crashing; any time I try to eval a form  
with an error, the program will crash.

Example (format nil "Test."):
Lisp: going to eval (+ 1 1).
ECL>> 2
Lisp: going to eval (format nil "Test.").
Program received signal:  "EXC_BAD_ACCESS".
(gdb) bt
#0  string_eq (x=0x7ad090, y=0x25) at /Users/nem/lisp/work/ecls/src/c/ 
string.d:238
#1  0x01288064 in ecl_search_hash (key=0x7ad090, hashtable=0x77af00)  
at /Users/nem/lisp/work/ecls/src/c/hash.d:280
#2  0x01288518 in gethash_safe (key=0x7ad090, hashtable=0x77af00,  
def=0x0) at /Users/nem/lisp/work/ecls/src/c/hash.d:308
#3  0x0128bf68 in intern (name=0x7ad090, p=0x778f40,  
intern_flag=0xbffff0ec) at /Users/nem/lisp/work/ecls/src/c/package.d:304
#4  0x012a3114 in read_object_with_delimiter (in=0x2027280,  
delimiter=41) at /Users/nem/lisp/work/ecls/src/c/read.d:296
#5  0x012a3190 in do_read_delimited_list (d=41, in=0x2027280,  
proper_list=0) at /Users/nem/lisp/work/ecls/src/c/read.d:1369
#6  0x012a34e4 in left_parenthesis_reader (in=0x2027280,  
character=0x25) at /Users/nem/lisp/work/ecls/src/c/read.d:475
#7  0x0128dde4 in cl_funcall (narg=8101680, function=0x7b9f30) at / 
Users/nem/lisp/work/ecls/src/c/eval.d:216
#8  0x012a2a94 in read_object_with_delimiter (in=0x2027280,  
delimiter=-1) at /Users/nem/lisp/work/ecls/src/c/read.d:118
#9  0x012a45d8 in si_string_to_object (x=0x2065fc0) at /Users/nem/ 
lisp/work/ecls/src/c/read.d:1814
#10 0x0002b10c in Lisp_Eval_Cmd ()
#11 0x00002e18 in Cbuf_Execute ()
#12 0x0001d2e4 in SV_Frame ()
#13 0x0002a91c in main ()

Am I missing some memory management housekeeping or something else?

A while ago Erik Winkels tried something similar in quake2 - is that  
source available somewhere?

Cheers,
--Geoff
ps: sorry for the attachment spam, please let me know if there's a  
tutorial I should be reading to figure all this stuff out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl_lisp.c
Type: application/octet-stream
Size: 3752 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quakelisp.h
Type: application/octet-stream
Size: 219 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quake.lisp
Type: application/octet-stream
Size: 2194 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compile-eclquake.lisp
Type: application/octet-stream
Size: 805 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2145 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060123/f6696324/attachment.sig>


More information about the ecl-devel mailing list