Error in servermsg_cb on amd64
Adam Hooper <[email protected]> Tue, 30 Aug 2005 08:53:20 -0400
| Newsgroups | gmane.comp.python.sybase |
|---|---|
| Message-ID | <[email protected]> |
I had a hell of a time getting python-sybase working on x86-64, and I
ended up with only a workaround, so I thought I'd ask for the proper fix
on the mailing list.
The problem begins in servermsg_cb in ctx.c -- and so an exception is
triggered on the very first command to interact with the server
(ct_connect()).
Coming into servermsg_cb(), cs_msg is a valid CS_SERVERMSG struct, with
msgnumber == 5701 ("Database context switched to 'blah'"). After the
memmove() on line 315 (I'm using python-sybase 0.37),
server_msg->msg.msgnumber == 5701, still. Then comes the Py_BuildValue()
(which I don't understand too well, I'm no Python-C API expert), and
finally call_callback() is called, which calls _servermsg_cb() in
Sybase.py. The first line is:
mn = msg.msgnumber
However, msg.msgnumber == 8589940293L !
If I ignore that error and proceed, the very next server message (a
database switch, since I pass 4 arguments to Sybase.connect()), comes
back with msg.msgnumber == 4294972997L.
For some reason, Python is using more bits than it needs. 8589940293L ==
2**33 + 5701, and 4294972997L == 2**32 + 5701.
My workaround is to change the line in Sybase.py:_servermsg_cb() to:
mn = msg.msgnumber % 2**32
Now everything seems to work perfectly! Yay! However, that's obviously
not the proper solution.
Can anybody see what's wrong? Has anybody else gotten python-sybase
working on amd64?
--
Adam Hooper <[email protected]>
_______________________________________________
Python-sybase mailing list
[email protected]
https://www.object-craft.com.au/cgi-bin/mailman/listinfo/python-sybase
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBDFFa/90GtBxQ61zARAtNSAKC5OwuUHslDOjc8zbhdejZD7f22hwCeLuIH 6SkdinKHvcSExZIPIWCUnIU= =c/9s -----END PGP SIGNATURE-----