[Ecls-list] Problem with DLL loading and "locked" mode

Goffioul Michael goffioul at imec.be
Mon Oct 24 02:07:11 UTC 2005


Hi,

While trying to run the CFFI tests suite when compiled, I found a problem
I don't know how to avoid it. Basically, it's related to the GC of dynamically
loaded modules. Such a module is "locked" when a foreign symbol is referenced
in it. However a problem occur when the module is collected *before* any
symbol is referenced. This is a problem when you use :DEFAULT as module
name, because in that case the module is not reloaded. For example:


	(ffi:load-foreign-library "libtest") -> loads libtest.dll
	...<do something lenghty>... -> module "libtest" is GC'ed
	(si:find-foreign-symbol "my_sym" :default :pointer-void 0) -> this fails

However, you would expect the last statement to succeed as you loaded the
module correctly.

This situation occurs in CFFI where the foreign function definition does not
refer to any module, but the module should have been loaded into memory
through a load-foreign-library call.

Michael.




More information about the ecl-devel mailing list