DELIVER does not work on Linux (override getpid)
This tiny example does not work (please, see example which does work
if you substitute getpid for foogetpid below)
Is this expected behaviour?!
override.lisp:
(in-package "CL-USER")
(lw:load-all-patches)
(fli:define-foreign-callable ("getpid" :result-type :int) ()
;; (format t "Calling GETPID~%")
42)
(lispworks:deliver nil "liblwoverride.so" 0 :dll-exports '("getpid"))
(precise_i386)yakov@x220t:~/override$ lispworks-6-1-0-x86-linux -build
override.lisp
LispWorks(R): The Common Lisp Programming Environment
Copyright (C) 1987-2011 LispWorks Ltd. All rights reserved.
Version 6.1.0
Saved by LispWorks as lispworks-6-1-0-x86-linux, at 10 Jan 2012 17:32
User yakov on x220t
; Loading text file /usr/lispworks/lib/6-1-0-0/private-patches/load.lisp
; Loading text file /home/yakov/override/override.lisp
; Loading text file /usr/lispworks/lib/6-1-0-0/private-patches/load.lisp
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/variables.ufasl
; Loading fasl file /usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/pkg.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/delivery-keywords.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-share.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-actions.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-gui.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-unix.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/dvintfc.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/shake-share.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/nclos/deliv-patch.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/utilities/around-shake-actions-runtime.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/x86-function-zapper.ufasl
; Loading fasl file /usr/lispworks/lib/6-1-0-0/patches/delivery/0001/0001.ufasl
; Loaded public patch DELIVERY 1.1
;;; Delivery function NIL
;;; Destination file #P"liblwoverride.so"
;;; Delivery severity 0
;;; Delivery parameters (:DLL-EXPORTS ("getpid"))
; Loading fasl file /usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/pkg.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/do-command-classes.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/command-classes.ufasl
Backtrace [because of error: Segmentation violation(11) [code 0] at 1C2FE7F0
eax 0 ; ebx 1C2FD00C ; ecx F75D024C ; edx 0
esp 1C2FE800 ; ebp 886 ; esi 20905D84 ; edi 1C2FFFFC]:
DESCRIPTION: Output Backtrace <and a simple test case, if possible>
IMPACT: Broken/Annoying/Data Loss/Missing Error/New Feature/Performance Loss
URGENCY: ASAP/Current Release/Next Release/Future Release/None
PRODUCT CONFIGURATION:
LispWorks 6.1.0
(precise_i386)yakov@x220t:~/override$
(precise_i386)yakov@x220t:~/override$ lispworks-6-1-0-x86-linux -build
override.lisp
LispWorks(R): The Common Lisp Programming Environment
Copyright (C) 1987-2011 LispWorks Ltd. All rights reserved.
Version 6.1.0
Saved by LispWorks as lispworks-6-1-0-x86-linux, at 10 Jan 2012 17:32
User yakov on x220t
; Loading text file /usr/lispworks/lib/6-1-0-0/private-patches/load.lisp
; Loading text file /home/yakov/override/override.lisp
; Loading text file /usr/lispworks/lib/6-1-0-0/private-patches/load.lisp
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/variables.ufasl
; Loading fasl file /usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/pkg.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/delivery-keywords.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-share.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-actions.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-gui.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/clean-unix.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/dvintfc.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/shake-share.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/nclos/deliv-patch.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/utilities/around-shake-actions-runtime.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/x86-function-zapper.ufasl
; Loading fasl file /usr/lispworks/lib/6-1-0-0/patches/delivery/0001/0001.ufasl
; Loaded public patch DELIVERY 1.1
and this one works.
(in-package "CL-USER")
(lw:load-all-patches)
(fli:define-foreign-callable ("foogetpid" :result-type :int) ()
;; (format t "Calling GETPID~%")
42)
(lispworks:deliver nil "liblwoverride.so" 0 :dll-exports '("foogetpid"))
Why so?! I expect DELIVER to work in either case.
;;; Delivery function NIL
;;; Destination file #P"liblwoverride.so"
;;; Delivery severity 0
;;; Delivery parameters (:DLL-EXPORTS ("foogetpid"))
; Loading fasl file /usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/pkg.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/do-command-classes.ufasl
; Loading fasl file
/usr/lispworks/lib/6-1-0-0/load-on-demand/deliv/command-classes.ufasl
Shaking stage : Starting delivery
Removing plist indicators :: (EDITOR::SECTION-PARSING-FUNCTION
EDITOR::SECTION EXTERNAL-FORMAT::EF-FUNCTION-SPEC)
Generation 0: Total Size 616K, Allocated 313K, Free 293K
Segment 20090128: Total Size 507K, Allocated 313K, Free 189K
minimum free space 64K,
Awaiting promotion = 0K, sweeps before promotion =10
Segment 221F4F60: Total Size 108K, Allocated 0K, Free 104K
minimum free space 0K,
Awaiting promotion = 0K, sweeps before promotion =2
Generation 1: Total Size 1396K, Allocated 1081K, Free 302K
Segment 2070F0C0: Total Size 68K, Allocated 63K, Free 0K
minimum free space 3K,
Awaiting promotion = 0K, sweeps before promotion =4
Segment 21ED4F60: Total Size 1088K, Allocated 908K, Free 175K
minimum free space 0K,
Awaiting promotion = 0K, sweeps before promotion =4
Segment 200540A8: Total Size 240K, Allocated 109K, Free 126K
minimum free space 0K, static
Generation 2: Total Size 2180K, Allocated 1788K, Free 383K
Segment 21FE4F60: Total Size 2112K, Allocated 1726K, Free 381K
minimum free space 0K,
Awaiting promotion = 0K, sweeps before promotion =4
Segment 20F1C640: Total Size 68K, Allocated 61K, Free 2K
minimum free space 117K,
Awaiting promotion = 0K, sweeps before promotion =4
Generation 3: Total Size 30351K, Allocated 29773K, Free 565K
Segment 2010F0C0: Total Size 6144K, Allocated 5941K, Free 198K
minimum free space 3K,
Awaiting promotion = 1485K, sweeps before promotion =10
Segment 20F2D6B8: Total Size 16030K, Allocated 15713K, Free 312K
minimum free space 0K,
Awaiting promotion = 3BF4K, sweeps before promotion =10
Segment 20720138: Total Size 8177K, Allocated 8119K, Free 54K
minimum free space 0K,
Awaiting promotion = 1FB7K, sweeps before promotion =10
Total Size 34880K, Allocated 32957K, Free 1545K
Shaking stage : Saving image
Build saving image: liblwoverride.so
Build saved image: /home/yakov/override/liblwoverride.so
Delivery successful - liblwoverride.so
(precise_i386)yakov@x220t:~/override$ nm liblwoverride.so | grep getpid
00008a00 T foogetpid
(precise_i386)yakov@x220t:~/override$
--
Yakov Zaytsev
+7 921 343 4327 (Russia)
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html