Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Phil Hagelberg
"Steven E. Harris"  writes:

>> There was some discussion about it a couple months ago:
>
> I picked up the torch today, in hope that others will try again for a
> better resolution:
>
>   http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383

Thanks for digging. I'll keep this around to show to anyone else in the
future who might be inclined to go further with it.

-Phil
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Steven E. Harris
Phil Hagelberg  writes:

> There was some discussion about it a couple months ago:

I picked up the torch today, in hope that others will try again for a
better resolution:

  http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Phil Hagelberg
"Steven E. Harris"  writes:

> Phil Hagelberg  writes:
>
>> If someone would volunteer to fix it, I'd be thrilled. Nobody who is
>> interested in using CL and Clojure at the same time has stepped
>> forward so far, which is why it's currently broken.
>
> Can you characterize what needs to be fixed?

There was some discussion about it a couple months ago:

http://groups.google.com/group/clojure/browse_thread/thread/3e5f416e3f2a1884

Unfortunately I don't have the resources to pursue it myself.

-Phil
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Rob Lachlan
I've reverted to the setup that you listed, Ramakrishnan.  I spent
quite a few hours trying to figure out how to use ELPA + the forked
slime + the new swank clojure, but failed miserably (despite the kind
assistance of Phil and others on another thread).

I would agree that it would be nice to have the option of installing
packages oneself, since if an automatic package management system is
relied on, and it fails, it can be very difficult to figure out how to
fix things.

On Jan 8, 1:03 am, Ramakrishnan Muthukrishnan 
wrote:
> On Fri, Jan 8, 2010 at 12:57 PM, Richard Newman  wrote:
> >> I don't want to have to use ELPA, or maven, or some other configuration
> >> management thing to get basic tools like an editing environment for the
> >> language up and running. Perhaps I should just bite the bullet and use the
> >> crazy configuration/package management things that the clojure community
> >> seems so enamored of (ELPA, maven, leiningen, etc...), but in the way I'm
> >> used to doing things, nothing more than the source code and a fairly simple
> >> system definition tool (like ASDF) are enough to get things done. It's not
> >> too say that there's room for improvement, but I like it when simple tools
> >> get the job done and I don't need to rely on a bunch of shell scripts, to
> >> have to modify classpaths, restart JVMs, etc... to get the code I want
> >> loaded. Perhaps I'm just ignorant of the proper clojure-y way to do things,
> >> so I'll hop off my soapbox now.
>
> > I think I'm pretty familiar with the Clojure-y way to do things, and I also
> > close the tab when I see "... using Maven".
>
> I am alien to the Java world and haven't still embrased ELPA, lein and
> other tools. Here is my setup which works fine for me:
>
> o. slime
>     git://git.boinkor.net/slime.git
>
> o. swank-clojure
>     git://github.com/jochu/swank-clojure.git
>
> o. clojure-mode
>     git://github.com/jochu/clojure-mode.git
>
> It has worked quite nicely for me until now. I also discovered the
> other branch of swank-clojure, which seem to be what people are using
> more. I see that it does things like downloading jars etc etc. I would
> rather like it to leave them for other tools to do. I have no problem
> installing emacs scripts by hand. If so, I wouldn't be using it
> anyway, so I just don't see why ELPA and the other swank-clojure
> branch is trying to do things that other tools are supposed to do.
>
> --
>   Ramakrishnan
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-09 Thread Ramakrishnan Muthukrishnan
On Fri, Jan 8, 2010 at 12:57 PM, Richard Newman  wrote:
>> I don't want to have to use ELPA, or maven, or some other configuration
>> management thing to get basic tools like an editing environment for the
>> language up and running. Perhaps I should just bite the bullet and use the
>> crazy configuration/package management things that the clojure community
>> seems so enamored of (ELPA, maven, leiningen, etc...), but in the way I'm
>> used to doing things, nothing more than the source code and a fairly simple
>> system definition tool (like ASDF) are enough to get things done. It's not
>> too say that there's room for improvement, but I like it when simple tools
>> get the job done and I don't need to rely on a bunch of shell scripts, to
>> have to modify classpaths, restart JVMs, etc... to get the code I want
>> loaded. Perhaps I'm just ignorant of the proper clojure-y way to do things,
>> so I'll hop off my soapbox now.
>
> I think I'm pretty familiar with the Clojure-y way to do things, and I also
> close the tab when I see "... using Maven".

I am alien to the Java world and haven't still embrased ELPA, lein and
other tools. Here is my setup which works fine for me:

o. slime
git://git.boinkor.net/slime.git

o. swank-clojure
git://github.com/jochu/swank-clojure.git

o. clojure-mode
git://github.com/jochu/clojure-mode.git

It has worked quite nicely for me until now. I also discovered the
other branch of swank-clojure, which seem to be what people are using
more. I see that it does things like downloading jars etc etc. I would
rather like it to leave them for other tools to do. I have no problem
installing emacs scripts by hand. If so, I wouldn't be using it
anyway, so I just don't see why ELPA and the other swank-clojure
branch is trying to do things that other tools are supposed to do.

-- 
  Ramakrishnan
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-08 Thread Steven E. Harris
Phil Hagelberg  writes:

> If someone would volunteer to fix it, I'd be thrilled. Nobody who is
> interested in using CL and Clojure at the same time has stepped
> forward so far, which is why it's currently broken.

Can you characterize what needs to be fixed?

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Richard Newman
I don't want to have to use ELPA, or maven, or some other  
configuration management thing to get basic tools like an editing  
environment for the language up and running. Perhaps I should just  
bite the bullet and use the crazy configuration/package management  
things that the clojure community seems so enamored of (ELPA, maven,  
leiningen, etc...), but in the way I'm used to doing things, nothing  
more than the source code and a fairly simple system definition tool  
(like ASDF) are enough to get things done. It's not too say that  
there's room for improvement, but I like it when simple tools get  
the job done and I don't need to rely on a bunch of shell scripts,  
to have to modify classpaths, restart JVMs, etc... to get the code I  
want loaded. Perhaps I'm just ignorant of the proper clojure-y way  
to do things, so I'll hop off my soapbox now.


I think I'm pretty familiar with the Clojure-y way to do things, and I  
also close the tab when I see "... using Maven".


My setup is:

* Installing some trivial Emacs stuff through ELPA (but not all: e.g.,  
some packages fail to build). I'm a recent Emacs convert, so this  
seemed easy.

* Building swank-clojure myself.
* Installing the Emacs side myself the old-fashioned way.
* Storing my stuff in git.
* Building jars using ant.
* Launching the appropriate swank server with the right classpath  
using a generic 'swank-clj' script that understands the same .clojure  
files as my 'clj' script.


No Maven, little ELPA, no Clojure project-building scripts, nothing  
swank-related configured through emacs. I don't like libraries which  
want to download their own dependency jars: most projects on which I  
work integrate at least a dozen libraries, many of which share  
dependencies (Commons Logging, for example), and I inevitably need to  
manage those myself. Neither do I want a tool to download a Clojure  
jar for me: I manage that myself, because I want to keep up-to-date,  
and I need to maintain patches against contrib.


Every time I've tried to use Maven I've given up in disgust as it  
downloaded hundreds of megs of jars I already had, and didn't want to  
have to manually re-package for my company's existing deployment  
infrastructure.


Ah, Java.
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Cyrus Harmon

I agree with Steven on this. As one who uses emacs and SLIME for both common 
lisp and clojure, I'd like to be able to use the current SLIME HEAD for clojure 
development work. I consider the fact that swank-clojure and the SLIME HEAD 
don't play nicely with each other to be a deficiency of swank-clojure. It may 
be that the "right" fix is to fix SLIME, but I see recommending a different 
mechanism of installing SLIME (via ELPA) as the fix to be an ugly hack. My 
personal hack-fix-of-choice is to check out version 
3b3f604c396f0c5ceb8bc5a13fa41061bcc96184 from the slime git repo. It's true 
that this is fundamentally no better than what ELPA is doing, but at least I 
know what version of SLIME i need to make things work. It would be great if 
swank-clojure and/or slime were fixed so that the SLIME HEAD worked with 
swank-clojure.

I don't want to have to use ELPA, or maven, or some other configuration 
management thing to get basic tools like an editing environment for the 
language up and running. Perhaps I should just bite the bullet and use the 
crazy configuration/package management things that the clojure community seems 
so enamored of (ELPA, maven, leiningen, etc...), but in the way I'm used to 
doing things, nothing more than the source code and a fairly simple system 
definition tool (like ASDF) are enough to get things done. It's not too say 
that there's room for improvement, but I like it when simple tools get the job 
done and I don't need to rely on a bunch of shell scripts, to have to modify 
classpaths, restart JVMs, etc... to get the code I want loaded. Perhaps I'm 
just ignorant of the proper clojure-y way to do things, so I'll hop off my 
soapbox now.

cyrus


On Jan 7, 2010, at 5:38 PM, Steven E. Harris wrote:

> Phil Hagelberg  writes:
> 
>> Could you try installing SLIME via ELPA as recommended in the
>> swank-clojure readme?
> 
> That will be a project I'll have to defer until the weekend, as I've
> never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
> so I'm reluctant to give it up. Also, it's not a tenable situation to
> fork SLIME for Clojure support.
> 
>> CVS head is known to have introduced incompatibilities with Clojure.
> 
> Is the git repository at git://git.boinkor.net/slime.git just tracking
> the CVS repository, or is that the same as the ELPA-hosted one? I did
> try all of this with the git version and found the exact same behavior
> as with the CVS version.
> 
> -- 
> Steven E. Harris
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Phil Hagelberg
"Steven E. Harris"  writes:

>> Could you try installing SLIME via ELPA as recommended in the
>> swank-clojure readme?
>
> That will be a project I'll have to defer until the weekend, as I've
> never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
> so I'm reluctant to give it up. Also, it's not a tenable situation to
> fork SLIME for Clojure support.

If someone would volunteer to fix it, I'd be thrilled. Nobody who is
interested in using CL and Clojure at the same time has stepped forward
so far, which is why it's currently broken.

>> CVS head is known to have introduced incompatibilities with Clojure.
>
> Is the git repository at git://git.boinkor.net/slime.git just tracking
> the CVS repository, or is that the same as the ELPA-hosted one? I did
> try all of this with the git version and found the exact same behavior
> as with the CVS version.

Yes, that git repo is just a mirror of CVS.

-Phil
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Steven E. Harris
Phil Hagelberg  writes:

> Could you try installing SLIME via ELPA as recommended in the
> swank-clojure readme?

That will be a project I'll have to defer until the weekend, as I've
never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
so I'm reluctant to give it up. Also, it's not a tenable situation to
fork SLIME for Clojure support.

> CVS head is known to have introduced incompatibilities with Clojure.

Is the git repository at git://git.boinkor.net/slime.git just tracking
the CVS repository, or is that the same as the ELPA-hosted one? I did
try all of this with the git version and found the exact same behavior
as with the CVS version.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Phil Hagelberg
"Steven E. Harris"  writes:

> Here's the stack:
>
> o swank-clojure
>   Git head.
>
> o SLIME
>   Both CVS head and git://git.boinkor.net/slime.git head behave the same
>   way, as the offending calls are in swank-clojure.

Could you try installing SLIME via ELPA as recommended in the
swank-clojure readme? CVS head is known to have introduced
incompatibilities with Clojure.

-Phil
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-03 Thread Steven E. Harris
Rob Wolfe  writes:

> Do you use "slime-indentation.el" in your configuration?

Yes. It turns out that I have another Lisp-related initialization file
that contained the following form:

,
| (slime-setup '(slime-fancy
|slime-asdf
|slime-fontifying-fu
|slime-indentation
|slime-indentation-fu
|slime-banner))
`

Removing the indentation-related entries fixed the `etypecase' Elisp
error. Unfortunately, the SLIME-Swank handshake still doesn't complete
(and hence the SLIME REPL doesn't start up) without the aforementioned
prodding.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-03 Thread Rob Wolfe
"Steven E. Harris"  writes:

> "Steven E. Harris"  writes:
>
>> Now get this: Right before the SLIME-Swank connection completes, Emacs
>> beeps and prints the following two lines in the *Messages* buffer:
>>
>> ,
>> | error in process filter: cond: etypecase failed: defun, (number cons 
>> string)
>> | error in process filter: etypecase failed: defun, (number cons string)
>> `
>
> I caught the Emacs debugger trace here:
>
>   http://paste.lisp.org/display/92936
>
> It looks to be a problem parsing the indentation recommendations sent
> from Swank.

Do you use "slime-indentation.el" in your configuration?
I can see in this trace "define-cl-indent" function, which is not
defined in my configuration.
I added this line to my configuration:
(require 'slime-indentation) 
and now I have almost the same problem as you:
"""
Polling "/tmp/slime.5593".. (Abort with `M-x slime-abort-connection'.) [32 
times]
Connecting to Swank on port 57580.. [2 times]
error in process filter: cond: etypecase failed: defun, (number cons string)
error in process filter: etypecase failed: defun, (number cons string)
"""
As a matter of fact *slime repl* still works for me, but I have
different environment.

HTH,
Rob


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
"Steven E. Harris"  writes:

> Now get this: Right before the SLIME-Swank connection completes, Emacs
> beeps and prints the following two lines in the *Messages* buffer:
>
> ,
> | error in process filter: cond: etypecase failed: defun, (number cons string)
> | error in process filter: etypecase failed: defun, (number cons string)
> `

I caught the Emacs debugger trace here:

  http://paste.lisp.org/display/92936

It looks to be a problem parsing the indentation recommendations sent
from Swank.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
Rich Hickey  writes:

> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?

I'll do that next time. Sorry for the noise.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Richard Newman
> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?

Might I suggest

http://paste.lisp.org/

?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Rich Hickey
On Sat, Jan 2, 2010 at 11:03 AM, Steven E. Harris  wrote:
> "Steven E. Harris"  writes:
>
>> In the meantime, I'll continue the investigation.
>
> Here are two thread dumps of the Java process running Clojure and Swank,
> which, at this time, has a live Clojure REPL, but the Swank call to
> `connection-info' hasn't completed yet.
>

Perhaps it would be best to paste such dumps somewhere, rather than
mail to the entire list?

Thanks,

Rich

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
"Steven E. Harris"  writes:

> In the meantime, I'll continue the investigation.

And yet more information: Apparently it's not critical to call on the
RuntimeMXBean#getName() method specifically to kick the Swank thread out
of its blocking call; just about /any call on a Java method/ from the
Clojure REPL will unblock the Swank thread and make the connection
complete.

For example, I've tried calling

  java.util.concurrent.Executors#newSingleThreadExecutor()
  java.util.Collections#emptySet()
  java.lang.Math#max()

and both work to unblock the Swank thread, but this one does not:

  java.lang.Integer#parseInt()

Now get this: Right before the SLIME-Swank connection completes, Emacs
beeps and prints the following two lines in the *Messages* buffer:

,
| error in process filter: cond: etypecase failed: defun, (number cons string)
| error in process filter: etypecase failed: defun, (number cons string)
`

Those errors messages come from the ELisp evaluator. Strangely, I can't
find any etypecase or typecase form in file slime.el that tolerates all
three of those types (number, cons, and string), so it's hard to figure
out where the error is arising.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
"Steven E. Harris"  writes:

> In the meantime, I'll continue the investigation.

Here are two thread dumps of the Java process running Clojure and Swank,
which, at this time, has a live Clojure REPL, but the Swank call to
`connection-info' hasn't completed yet.

This first one comes via jvisualvm:

==
2010-01-02 10:55:39
Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):

"RMI TCP Connection(4)-192.168.1.35" daemon prio=6 tid=0x02e43000 nid=0x15f8 
runnable [0x0377f000]
   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
- locked <0x23215700> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown 
Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown 
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown 
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- <0x2321c928> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

"RMI TCP Connection(idle)" daemon prio=6 tid=0x02f74c00 nid=0x121c waiting on 
condition [0x0372f000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x231df420> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown 
Source)
at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

"JMX server connection timeout 22" daemon prio=6 tid=0x02f70400 nid=0x324 in 
Object.wait() [0x036df000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x231e31d8> (a [I)
at 
com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(Unknown Source)
- locked <0x231e31d8> (a [I)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

"RMI Scheduler(0)" daemon prio=6 tid=0x02b4e000 nid=0x1430 waiting on condition 
[0x0368f000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x231b9ae0> (a 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(Unknown
 Source)
at java.util.concurrent.DelayQueue.take(Unknown Source)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown 
Source)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(Unknown 
Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

"RMI TCP Connection(idle)" daemon prio=6 tid=0x02e4b400 nid=0x1608 waiting on 
condition [0x0363f000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x231df420> (a 
java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source)
at 
java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(Unknown Source)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(Unknown 
Source)
at java.util.concurrent.SynchronousQueue.poll(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

   Locked ownable synchronizers:
- None

"RMI TCP Accept-0" daemon prio=6 tid=0x02b2e800 nid=0x128c runnable [0x035cf000]
   java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(Unknown Source)
- locked <0x231c

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
Rob Wolfe  writes:

> Unfortunately I have no idea what is the reason of this problem,

That makes two of us.

> but I'm curious what Java version are you using?

user=> (map #(System/getProperty %)
["java.version" "java.vendor" "java.vm.version"])
("1.6.0_17" "Sun Microsystems Inc." "14.3-b01")
user=> (map #(System/getProperty %)
["os.name" "os.version" "os.arch"])
("Windows XP" "5.1" "x86")

> Have you tried by any chance two different Java versions with the same
> result?

No, that's the only one I have installed. In a few days when I return to
the office, I can try it against version 1.6.0_14 as well.

In the meantime, I'll continue the investigation.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Rob Wolfe
"Steven E. Harris"  writes:

[...]

> Here's the stack:
>
> o swank-clojure
>   Git head.
>
> o SLIME
>   Both CVS head and git://git.boinkor.net/slime.git head behave the same
>   way, as the offending calls are in swank-clojure.
>
> o Clojure 1.1.0
>   Downloaded Jar from code.google.com.
>
> o GNU Emacs 23.1.1
>
> o Windows XP 32-bit

Unfortunately I have no idea what is the reason of this problem,
but I'm curious what Java version are you using?
Have you tried by any chance two different Java versions with the same
result?

user> (map #(System/getProperty %) ["java.version" "java.vendor" 
"java.vm.version"])
("1.5.0_17" "Sun Microsystems Inc." "1.5.0_17-b04")
user> (map #(System/getProperty %) ["os.name" "os.version" "os.arch"])
("Linux" "2.6.26-1-486" "i386")

Br,
Rob

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
"Steven E. Harris"  writes:

> it takes calling RuntimeMXBean#get() -- actually using the
> RuntimeMXBean instance -- to unblock the other thread.

I meant RuntimeMXBean#getName() there.
My typing is poor this morning.

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-02 Thread Steven E. Harris
Phil Hagelberg  writes:

> But I'm not quite following on the exact problem and specific repro
> case; could you clarify?

Yes. When I start SLIME, the Swank back-end starts and presents the
Clojure REPL in the *inferior-lisp* buffer. Right after that, the SLIME
front-end sends an "Emacs REX" command to the Swank back-end, asking it
to invoke the `connection-info' function.

At this point, the SLIME front-end has reported that it's trying to
connect. The Swank back-end receives the REX request, invokes the
`connection-info' method on some thread separate from the thread
servicing the Clojure REPL, and hangs in its call to `get-pid'.

Because the Swank back-end thread servicing the call to
`connection-info' hasn't responded, the SLIME front-end is hung waiting
for its REX to complete to gather the `connection-info' result. Not
until the SLIME front-end has received that result will it finally
announce that it succeeded connecting and present the SLIME REPL.

It's not just the SLIME REPL that won't work until that
`connection-info' REX completes. Any buffers that attempt to submit
forms to Clojure for evaluation will not receive a result; the requests
are merely queued because the SLIME front-end has not completed its
connection and initial handshake.

The call to `get-pid' hangs on its call to

  RuntimeMXBean#getName()

which is part of the first path taken by `get-pid':

,
| (.. java.lang.management.ManagementFactory
| (getRuntimeMXBean)
| (getName)
| (split "@"))
`

Now, I found a way to unblock that hung call to RuntimeMXBean#getName():
In the Clojure REPL available in the *inferior-lisp* buffer, I can
evaluate the following form:

,
| (.. java.lang.management.ManagementFactory (getRuntimeMXBean) (getName)
`

That evaluation takes place in the thread servicing the Clojure REPL,
which is a different thread from the one blocked in the REX call to
`connection-info' and, transitively, `get-pid'.

The above form evaluates immediately in he Clojure REPL and, as a
side-effect I don't yet understand, /also/ causes the call blocked in
the Swank REX-servicing thread to complete as well. Hence, `get-pid'
completes, the `connection-info' completes, then the SLIME front-end
receives its reply and finally sets up the SLIME REPL. From then on, all
is well.

I've been searching the Web looking for similar complaints about such a
call hanging, and so far I've come up blank. Again, note that calling
ManagementFactory#getRuntimeMXBean() from the Clojure REPL is not
sufficient to unblock the other thread hung in `get-pid'; it takes
calling RuntimeMXBean#get() -- actually using the RuntimeMXBean
instance -- to unblock the other thread. Perhaps there's some lazy
initialization going on in Sun's RuntimeMXBean implementation.

> Does it occur with the latest version of swank-clojure?

Yes. I'm tracking the tip of the "master" branch via Git.

Here's the stack:

o swank-clojure
  Git head.

o SLIME
  Both CVS head and git://git.boinkor.net/slime.git head behave the same
  way, as the offending calls are in swank-clojure.

o Clojure 1.1.0
  Downloaded Jar from code.google.com.

o GNU Emacs 23.1.1

o Windows XP 32-bit

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-01 Thread Phil Hagelberg
"Steven E. Harris"  writes:

> Is there a separate mailing list to which I should report this problem?

There's http://groups.google.com/group/swank-clojure, though for this
particular issue you can just continue in this thread.

But I'm not quite following on the exact problem and specific repro
case; could you clarify? Does it occur with the latest version of
swank-clojure?

-Phil

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean (was: Clojure/SLIME/Emacs questions)

2010-01-01 Thread Steven E. Harris
"Steven E. Harris"  writes:

> My next step will be to instrument the Swank side to see when
> `connection-info' is being called.

I found the problem: swank.util.sys/get-pid.

It looks like the JMX call to get the PID hangs. If I visit the
*inferior-lisp* buffer's REPL and evaluate the following form, the REPL
finishes connecting immediately:

,[ Fragment of `get-pid' function ]
| (.. java.lang.management.ManagementFactory
| (getRuntimeMXBean) (getName) (split "@"))
`

Apparently forcing more than one call through that path kicks it out of
some wait, and the thread blocked on the Swank-side function
`swank.commands.basic/connection-info' finally finishes its call to
get-pid.

Note that calling

  java.lang.management.ManagementFactory#getRuntimeMXBean()

is not sufficient to unblock the thread in `connection-info'. It takes
the following call to

  RuntimeMXBean#getName()

to unblock the wait.

Is there a separate mailing list to which I should report this problem?

-- 
Steven E. Harris

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en