VimClojure - OpenSolaris - What am I doing wrong?

16 views
Skip to first unread message

Michael Aldred

unread,
Sep 8, 2009, 9:10:29 AM9/8/09
to Clojure
G'day,

I'm having a bit of trouble getting VimClojure working under
OpenSolaris 2009.06 (I'm currently using the development IPS
repository, however I still got the problem with the release
repository).

I'm compiled and installed vimclojure.jar, and ng.

Vim correctly detects and highlights .clj files as clojure files, and
I can start the ng server just fine:

java -cp /export/home/aldredmr/local/clojure/clojure.jar:/export/home/
aldredmr/local/clojure/clojure-contrib.jar:/export/home/aldredmr/local/
clojure/vimclojure.jar com.martiansoftware.nailgun.NGServer 127.0.0.1
NGServer started on 127.0.0.1, port 2113.

However, when start vim, e.g.:

gvim test.clj

vim starts up, and I get the following from the ng server:

java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at com.martiansoftware.nailgun.NGSession.run(Unknown Source)
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at com.martiansoftware.nailgun.NGSession.run(Unknown Source)

Entering in :nmap in vim, I get the following:

n \K :call <SNR>2_PreGetPage(0)<CR>
n gx <Plug>NetrwBrowseX
n <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)
<CR>

So it seems I'm unable to start the REPL.

I've tried setting my CLASSPATH:

echo $CLASSPATH
/export/home/aldredmr/local/clojure/clojure.jar:/export/home/aldredmr/
local/clojure/clojure-contrib.jar:/export/aldredmr/local/clojure/
vimclojure.jar

I think I've narrowed the problem down to the ng client, when I try
"ng ng-alias" I get a core dump, so it appears that the ng client
doesn't like OpenSolaris.

Michael Aldred

unread,
Sep 8, 2009, 9:31:07 AM9/8/09
to Clojure
I've found the problem.

The NailGun client assumes that the strlen function will handle a null
pointer for the argument.
Under Solaris this is not the case (http://technopark02.blogspot.com/
2006/04/solaris-null-pointer-bugs-usrlib00so1.html)

The problem is in sendText.

With Nailgun 0.7.1, this starts at line 203.

I did a quick check for a null:

void sendText(char chunkType, char *text) {
int len = 0;
if ( text ) {
len = strlen(text);
}
sendHeader(len, chunkType);
sendAll(nailgunsocket, text, len);
}

and it seems to have fixed the problem, I've now got my REPL in
Vim. :)

Meikel Brandmeyer

unread,
Sep 26, 2009, 1:41:28 PM9/26/09
to clo...@googlegroups.com
Hi,

Am 08.09.2009 um 15:31 schrieb Michael Aldred:

> The NailGun client assumes that the strlen function will handle a null
> pointer for the argument.
> Under Solaris this is not the case (http://technopark02.blogspot.com/
> 2006/04/solaris-null-pointer-bugs-usrlib00so1.html)

Thank you for the fix. I will include the patch.

Sincerely
Meikel

Meikel Brandmeyer

unread,
Sep 27, 2009, 4:50:35 AM9/27/09
to clo...@googlegroups.com
Hi,

Am 08.09.2009 um 15:31 schrieb Michael Aldred:

> The NailGun client assumes that the strlen function will handle a null
> pointer for the argument.
> Under Solaris this is not the case (http://technopark02.blogspot.com/
> 2006/04/solaris-null-pointer-bugs-usrlib00so1.html)

Fixed with rev 6fc1bf045247. Allthough I didn't follow the
recommendation in the above link to track down the initialisation of
the pointer...

Sincerely
Meikel

Reply all
Reply to author
Forward
0 new messages