Opened 9 years ago

Closed 9 years ago

#742 closed defect (fixed)

Opening foreign libraries on initial thread does not play nice with CFFI

Reported by: rongarret Owned by:
Priority: major Milestone:
Component: Foreign Function Interface Version: trunk
Keywords: Cc:


A recent change to open-shared-library runs the code on the initial thread. The result of this is that if anything goes wrong (like the library not being found) the error is dumped to the AltConsole?. This undermines CFFI's mechanism for finding shared libraries, which relies on open-shared-library being run within the dynamic context of a handler-case. It also seems like kind of a bad plan to dump an error to the AltConsole? for something as common as not funding a shared library.

Change History (1)

comment:1 Changed 9 years ago by gb

  • Resolution set to fixed
  • Status changed from new to closed

(In [14288]) l1-boot-2.lisp: In INITIALIZE-INTERACTIVE-STREAMS: ensure that *STDOUT*, *STDERR*, and

(if it's disjoint) *TERMINAL-OUTPUT* are auto-flushed.

linux-files.lisp: #+windows-target Define GET-LAST-WINDOWS-ERROR, so that #_GetLastError can be called from code that may have to run before the FFI is initialized. When prompting the user to type :Y, force output. (This may run on the housekeeping thread, so that output may not get autoflushed.)

l0-cfm-support.lisp: if GET-SHARED-LIBRARY fails, signal the error on the calling thread (even if the #_dlopen/whatever happens on the initial thread); fixes ticket:742

Note: See TracTickets for help on using tickets.