Wednesday, January 18, 2017

Channel callbacks randomly fail to fire in Vim for win32

Hi.

I've been working on a Vim plugin using the channel APIs. When testing
the plugin on Windows (Windows 7 Pro. SP1 32-bit), one of my channel
callbacks failed to fire sometimes.

There was no error or anything. It looked like the message passing
through the channel just went missing. I used Wireshark to capture the
packets, and it turned out the message which was supposed to trigger
the callback did go through the sockets, but Vim just won't call my
callback.

I tried ch_logfile(...). But with the logging enabled, I could not
reproduce the problem anymore. Yuck!

I've been reviewing and testing my code, hoping to find something
relevant, but the code worked fine on my other system (Fedora Linux).

The difficulty here is that the callback failure happened randomly.
The code involved was not trivial and I couldn't find a reliable way
to reproduce the problem. So I turn to the nice Vim people here for
suggestions.

I'm using the latest win32 Vim release from vim.org: 8.0 with patches
1-69 (32-bit GUI version with OLE support).

And the code involved is on Github:
https://github.com/l04m33/vlime/blob/00f0f2505597ee5e6f3ff0a268e303b0cfeb2605/vim/plugin/vlime.vim#L45

The callback function on line 45 is the one failed to fire. I used a
"chaining" mechanism to call those callbacks and save some typing.

Any suggestions would be greatly appreciated.

Regards.

Kay Z.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment