Problem opening connections on 64-bit machines #1

tymmothy opened this Issue Mar 14, 2012 · 2 comments


None yet
2 participants


I really appreciate the python-only VXI-11 implementation (especially after fighting for hours with assorted, broken, SWIG-based implementations).

I found an issue though with 64-bit machines...

Here's the traceback:

$ vxi11-cli ds1204b

Traceback (most recent call last):
File "/home/tymm/pyenvs/notebook/bin/vxi11-cli", line 9, in
load_entry_point('pyvxi11==0.3', 'console_scripts', 'vxi11-cli')()
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/", line 60, in main
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/", line 178, in open
self.vxi11_client.create_link(id(self), 0, 0,
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/", line 138, in create_link
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/", line 258, in make_call
File "/home/tymm/pyenvs/notebook/local/lib/python2.7/site-packages/pyvxi11-0.3-py2.7.egg/pyvxi11/", line 72, in pack_create_link_parms
File "/usr/lib/python2.7/", line 57, in pack_int
self.__buf.write(struct.pack('>l', x))
struct.error: 'l' format requires -2147483648 <= number <= 2147483647

issue comes from interaction between code in Vxi11::open() and Vxi11Packer::pack_create_link_parms(), as the passed ID can exceed the value that can be stored in an int:

def open(self):'Opening connection to %s',
    error, link_id, abort_port, max_recv_size = \
            self.vxi11_client.create_link(id(self), 0, 0,


def pack_create_link_parms(self, params):
    id, lock_device, lock_timeout, device = params


I threw together a quick hack without digging too deeply into the code; it's flawed I'm sure, but gets things working for me for now -- just mask off the high bits of the id. I imagine this will come back to bite me at some point.

           self.vxi11_client.create_link(id(self) & 0x7fffffff, 0, 0,

If you have suggestions on a proper fix, would greatly appreciate it.



mwalle added a commit that referenced this issue Mar 15, 2012

bugfix: add posibility to specify own client_id
If no one was given, get it from the id of the Vxi11 object by taking the
lower 31 bits as client_id.

This fixes issues on 64bit hosts (#1). Thanks to Timothy Twillman.

Signed-off-by: Michael Walle <>

mwalle commented Mar 15, 2012

hopefully commit e2a2bb2 will fix this issue.

@mwalle mwalle closed this Mar 15, 2012

Seems to work great; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment