Well, My question can be disregarded. I see in the known problems document that this issue does not currently have a known reason or solution.
Thanks, Shawn
-----Original Message----- From: Shawn Nicholson Sent: Wednesday, June 29, 2005 11:21 AM To: slime-devel@common-lisp.net Subject: [slime-devel] Slime hanging on foreign function calls with Lispworks
Hello, I am a new user to slime and have run into something I can't seem to figure out. I am running Lispworks 4.4.5 Professional and Slime 2005-4-27 (LispWorks Port 1525 PID 220). I am attempting to run some code which calls some foreign functions however any attempt to do so causes Slime to hang. The windows click does not happen at all.
Any ideas on what I'm missing (or what settings I have incorrect) that would prevent me from making FLI calls?
Thanks, Shawn
(in-package :cl-user)
(defparameter *segman-dll* "C:\Projects\SegMan\hemets\src\segman.dll")
(fli:register-module *segman-dll*)
(fli:define-foreign-function (c_single_click "c_single_click" :source) ((pause :int)) :result-type :void)
(defun single-click (&optional (pause 0)) (format t "Executing single click.~%") (c_single_click pause))
(defun test-click () (single-click))
_______________________________________________ slime-devel site list slime-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/slime-devel
On Wed, 29 Jun 2005 13:02:09 -0400, "Shawn Nicholson" shawn.nicholson@dnamerican.com wrote:
My question can be disregarded. I see in the known problems document that this issue does not currently have a known reason or solution.
You might also want to search Gmane for a thread called "Problems with LWW FFI" or something like that. Martin Simmons there describes what he thinks is the underlying problem. No solution yet, though...
Cheers, Edi.
Edi Weitz <edi <at> agharta.de> writes:
On Wed, 29 Jun 2005 13:02:09 -0400, "Shawn Nicholson" <shawn.nicholson <at>
dnamerican.com> wrote:
My question can be disregarded. I see in the known problems document that this issue does not currently have a known reason or solution.
You might also want to search Gmane for a thread called "Problems with LWW FFI" or something like that. Martin Simmons there describes what he thinks is the underlying problem. No solution yet, though...
Cheers, Edi.
This is really weird. Before the July 3 CVS, SLIME hanged for me when calling FFI (using LispWorks 4.4.5 Personal Edition), but with the July 3 CVS, I can call foreign functions just fine from SLIME. This is with a DLL that was built with MS Visual C++ version 6.0 and MinGW, both built with default options, and not doing anything different than I had before.
I'd like to see this stay fixed :)
On Tue, 5 Jul 2005 17:07:14 +0000 (UTC), Glenn Ehrlich glenn.ehrlich@specastro.com wrote:
This is really weird. Before the July 3 CVS, SLIME hanged for me when calling FFI (using LispWorks 4.4.5 Personal Edition), but with the July 3 CVS, I can call foreign functions just fine from SLIME. This is with a DLL that was built with MS Visual C++ version 6.0 and MinGW, both built with default options, and not doing anything different than I had before.
Hmm, not for me, unfortunately. Could you please try with the test.dll I mentioned in the old thread? And what exactly is your setup - which Emacs version, which Windows version?
I'd like to see this stay fixed :)
I also want to have that... :(
Thanks, Edi.
Glenn Ehrlich <glenn.ehrlich <at> specastro.com> writes:
Edi Weitz <edi <at> agharta.de> writes:
On Wed, 29 Jun 2005 13:02:09 -0400, "Shawn Nicholson" <shawn.nicholson <at>
dnamerican.com> wrote:
My question can be disregarded. I see in the known problems document that this issue does not currently have a known reason or solution.
You might also want to search Gmane for a thread called "Problems with LWW FFI" or something like that. Martin Simmons there describes what he thinks is the underlying problem. No solution yet, though...
Cheers, Edi.
This is really weird. Before the July 3 CVS, SLIME hanged for me when calling FFI (using LispWorks 4.4.5 Personal Edition), but with the July 3 CVS, I can call foreign functions just fine from SLIME. This is with a DLL that was built with MS Visual C++ version 6.0 and MinGW, both built with default options, and not doing anything different than I had before.
I'd like to see this stay fixed :)
Edi asked me to try out the test.dll that appeared in this post:
http://article.gmane.org/gmane.lisp.slime.devel/2912
so I downloaded http://zappa.agharta.de/test.dll to a working directory, ,cd in the slime repl to that directory and did this:
CL-USER> (fli:register-module "test.dll") "test.dll" CL-USER> (fli:define-foreign-function foo ((x :int)) :result-type :int) FOO CL-USER> (foo 21) 42
So, the particulars are:
Windows 2000, SP4 "GNU Emacs 21.3.1 (i386-mingw-nt5.0.2195) of 2004-03-10 on NYAUMO" (the standard download from fsf) SLIME 2005-07-03 LispWorks 4.4.5 Personal Edition
Just checked on a cleaned out version of SLIME 2005-06-21 and test.dll also works.
In other messages in the same thread, doing: (capi:display-message "foo") is supposed to hang in a fresh SLIME as well, and for me, I get the message box.
I thought it might be because I called fli:register-module "test.dll"), but here's a fresh slime where I don't (I'm in some other directory other than c:/home/glenn):
; SLIME 2005-06-21 CL-USER> (fli:define-foreign-function foo ((x :int)) :result-type :int :module "c:/home/glenn/test.dll") FOO CL-USER> (foo 21) 42 CL-USER>
Just to be totally tedious, here's all of my slime related setup:
(require 'slime) (slime-setup :autodoc t) (add-hook 'lisp-mode-hook (lambda () (slime-mode t))) (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t))) (define-key slime-mode-map [(control c) (control backspace)] 'cltl2-lookup) (setq common-lisp-hyperspec-root "file:///usr/local/doc/HyperSpec/") (define-key slime-mode-map [(control c) (s)] 'slime-selector)
(defun go-slime-lispworks () (interactive) (shell-command (expand-file-name "~/bin/start_lispworks.vbs")) (slime-connect "127.0.0.1" 4005))
I start up emacs, M-x go-slime-lispworks, which starts up lispworks via this VB script:
Dim Wsh Set Wsh = WScript.CreateObject("WScript.Shell")
rem Start LispWorks Wsh.Run("c:\lispworks\lispworks-personal-4450.exe")
rem Wait for a few seconds for it to start WScript.Sleep(5000)
rem Press the OK button on the splash screen Wsh.AppActivate "Upgrade LispWorks" Wsh.SendKeys "{ENTER}"
rem Load the SLIME startup code rem Wsh.AppActivate "LispWorks Personal Edition 4.4.5" Wsh.AppActivate "Listener 1" str = "load " & """c:/home/glenn/bin/slime.lisp""" WScript.Sleep(100) Wsh.SendKeys (str) Wsh.SendKeys "{ENTER}" WScript.Sleep(1000)
rem Toggle back to Emacs rem Wsh.SendKeys "%{TAB}"
The above script calls my ~/bin/slime.lisp:
(load "/usr/local/share/emacs/slime/swank-loader.lisp") (swank::create-swank-server 4005 :spawn #'swank::simple-announce-function t) (load "/usr/local/share/emacs/slime/present") (load "/home/glenn/.lispworks")
The .lispworks just does a bunch of asdf stuff and sets the compiler options.
Other than I was getting the hanging just last week, I can't explain why it's all of sudden working with 2 recent versions of slime.
Just another check, I was wondering if anything I was loading via asdf from my .lispworks was helping out, so I started a fresh LispWorks (not via my VB script), manually started up swank (just the 2 lines above, I didn't load present.lisp or my .lispworks). Then I did a slime-connect, and I still got a successful result.
For the life of me, I can't make it break at the moment.
Hope some of this might help.
Glenn
For the life of me, I can't make it break at the moment.
Hope some of this might help.
Glenn
One thing I forgot to add, I've just been recently removing the secret .slime directory containing the swank fasls whenever I update my slime from CVS, because it's been having loading problems with nregex. That coincides with the time that FFI started working for me. I also download the slime tarball rather than using command-line CVS to access slime. When I do that, I rename the existing slime directory and unzip the tarball and move the slime directory to where it's supposed to live. So I have totally clean, fresh dirs both in slime and .slime.
Hi Glenn!
On Tue, 5 Jul 2005 19:40:02 +0000 (UTC), Glenn Ehrlich glenn.ehrlich@specastro.com wrote:
(defun go-slime-lispworks () (interactive) (shell-command (expand-file-name "~/bin/start_lispworks.vbs")) (slime-connect "127.0.0.1" 4005))
I start up emacs, M-x go-slime-lispworks, which starts up lispworks via this VB script:
Dim Wsh Set Wsh = WScript.CreateObject("WScript.Shell")
rem Start LispWorks Wsh.Run("c:\lispworks\lispworks-personal-4450.exe")
rem Wait for a few seconds for it to start WScript.Sleep(5000)
rem Press the OK button on the splash screen Wsh.AppActivate "Upgrade LispWorks" Wsh.SendKeys "{ENTER}"
rem Load the SLIME startup code rem Wsh.AppActivate "LispWorks Personal Edition 4.4.5" Wsh.AppActivate "Listener 1" str = "load " & """c:/home/glenn/bin/slime.lisp""" WScript.Sleep(100) Wsh.SendKeys (str) Wsh.SendKeys "{ENTER}" WScript.Sleep(1000)
rem Toggle back to Emacs rem Wsh.SendKeys "%{TAB}"
The above script calls my ~/bin/slime.lisp:
(load "/usr/local/share/emacs/slime/swank-loader.lisp") (swank::create-swank-server 4005 :spawn #'swank::simple-announce-function t) (load "/usr/local/share/emacs/slime/present") (load "/home/glenn/.lispworks")
Thanks for all your tests. But the info you give above shows that we're not talking about the same thing, unfortunately. I'm using the Professional Edition of LWW and I have a custom-built console image that I invoke directly by just setting the `inferior-lisp-program' variable in my .emacs file. If I start an "external" instance of a CAPI-enabled LispWorks and connect to it using `slime-connect' like you do I don't have FLI/CAPI problems and I never had them.
Hm, I wonder why you experienced hangs up until last week.
Thanks anyway, Edi.