[cl-debian] Bug#433814: cl-uffi: Silently fails to load non-existent .so files

Package: cl-uffi Version: 1.5.18-2 Severity: normal Tags: patch On CMUCL, the uffi:load-foreign-library function attempts to use sys::load-object-file to load .so files (rather than falling back to alien:load-foreign as it does for other types). However, unlike alien:load-foreign, sys::load-object-file reports errors (e.g., failure to find the library in question) by returning nil. UFFI ignores this return value (resumably assuming that it would signal an error), and assumes it succeeded. The following patch fixes the problem for me. --- /usr/share/common-lisp/source/uffi/src/libraries.lisp 2006-09-03 03:31:58.000000000 +0100 +++ /tmp/mwooding/libraries.lisp 2007-07-19 17:12:39.000000000 +0100 @@ -96,7 +96,9 @@ #+cmu (let ((type (pathname-type (parse-namestring filename)))) (if (string-equal type "so") - (sys::load-object-file filename) + (multiple-value-bind (workp whinge) + (sys::load-object-file filename) + (unless workp (error "~A" whinge))) (alien:load-foreign filename :libraries (convert-supporting-libraries-to-string This bug makes attempts to load clsql-uffi fail, reporting inability to find the symbol atol64. -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.18-4-686 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Versions of packages cl-uffi depends on: ii common-lisp-controller 6.10 This is a Common Lisp source and c Versions of packages cl-uffi recommends: pn cl-uffi-tests <none> (no description available) -- no debconf information

Mark Wooding wrote:
On CMUCL, the uffi:load-foreign-library function attempts to use sys::load-object-file to load .so files (rather than falling back to alien:load-foreign as it does for other types). However, unlike alien:load-foreign, sys::load-object-file reports errors (e.g., failure to find the library in question) by returning nil. UFFI ignores this return value (resumably assuming that it would signal an error), and assumes it succeeded.
The specification for load-foreign-library (http://uffi.b9.com/manual/load-foreign-library.html) states that the function will return NIL if the library was not able to be loaded. Thus, the current code correctly follows the specification for this particular case. Kevin

Actually, rereading the load-foreign-library code, the function does not follow its spec. It always returns T, that should be fixed. -- Kevin Rosenberg kevin@hypershots.com

Your message dated Sun, 22 Jul 2007 19:17:07 +0000 with message-id <E1ICgvT-0002R5-0n@ries.debian.org> and subject line Bug#433814: fixed in cl-uffi 1.6.0-1 has caused the attached Bug report to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what I am talking about this indicates a serious mail system misconfiguration somewhere. Please contact me immediately.) Debian bug tracking system administrator (administrator, Debian Bugs database)
participants (3)
-
Kevin Rosenberg
-
Mark Wooding
-
owner@bugs.debian.org