Newbie question about Alien interface in CMUCL
Hi,
I am interested in using LISP for an analysis routine that I am writting.
I normally use a package called ROOT (used in the High Energy Physics
community and written in C++) to store and read my data. I am trying to
read each event, and then do my analysis. To read the events I have made
some small wrapper functions in C which initializes ROOT and another which
will read any event. the event record is being passed from ROOT to LISP
using 3 globally declared structures. So my code looks like:
struct foo_ {
.......
Quote:
} foo;
foo * root_init() {
.....;
return &foo;
Quote:
}
void getentry(int i) {
.......
Quote:
}
*******************************************************************
(def-alien-type nil
(struct foo
.......)))
(def-alien-routine root_init
.....)))
(def-alien-routine getentry
.....)))
(defun startprocessing ()
(root_init)
(dotime (j 500)
(getentry j)))
the program works flawlessly till the second garbage collection, at which
point it gives an error like:
*** Break *** segmentation violation
Error in function UNIX::SIGABRT-HANDLER: SIGABRT at #x4007C801.
This error always happens during garbage collection. I have used (ext:gc)
twice and seen it to crash during the second time. ROOT malloc's lots of
buffers and other stuff internally. It is not possible for me to declare
all the buffers and stuff as def-alien-variable in LISP.
My question is: During garbage collection, does LISP overwrite globally
declared variables in the foreign library that I am loading for the ROOT
code?
Thanx in advance for any help.
Cheers,
Diptansu