[cmucl-imp] motifd isn't 64-bit kosher
Greetings, I believe it turns out to be a fluke that a 64-bit motifd works anywhere: the server passes out 32-bits of a pointer as external IDs for instances of a handful of types [1]. On a 64-bit machine, the instances' addresses might not fit in a 32-bit address, though. (In fact, on my FreeBSD/amd64 machine, when I run the example from the documentation, the first shell widget always gets created at #x8045d8900, so motifd hands out #x45d8900, and then attempting to create the second widget with the shell as parent crashes the server.) Seems like there are two options: A. Change the wire protocol to accomodate 64-bit integers. B. Synthesize 32-bit identifiers for instances of the offending types. Option B seems simpl [1] I think the complete list is AcceleratorTable, Atom, FontList, TranslationTable, Widget, and sometimes XmString.
Argh. Didn't finish writing this. Richard M Kreuter writes: Greetings, I believe it turns out to be a fluke that a 64-bit motifd works anywhere: the server passes out 32-bits of a pointer as external IDs for instances of a handful of types [1]. On a 64-bit machine, the instances' addresses might not fit in a 32-bit address, though. (In fact, on my FreeBSD/amd64 machine, when I run the example from the documentation, the first shell widget always gets created at #x8045d8900, so motifd hands out #x45d8900, and then attempting to create the second widget with the shell as parent crashes the server.) Seems like there are two options: A. Change the wire protocol to accomodate 64-bit integers. B. Synthesize 32-bit identifiers for instances of the offending types. Option B seems simpler, I think. Does anybody have any notion of how better to do this than to add a table mapping pointers to some kind of opaque IDs at the message layer? Thanks, Richard [1] I think the complete list is AcceleratorTable, Atom, FontList, TranslationTable, Widget, and sometimes XmString.
Richard M Kreuter wrote:
I believe it turns out to be a fluke that a 64-bit motifd works anywhere: the server passes out 32-bits of a pointer as external IDs for instances of a handful of types [1]. On a 64-bit machine, the instances' addresses might not fit in a 32-bit address, though.
(In fact, on my FreeBSD/amd64 machine, when I run the example from the documentation, the first shell widget always gets created at #x8045d8900, so motifd hands out #x45d8900, and then attempting to create the second widget with the shell as parent crashes the server.)
Seems like there are two options:
A. Change the wire protocol to accomodate 64-bit integers.
B. Synthesize 32-bit identifiers for instances of the offending types.
Option B seems simpler, I think. Does anybody have any notion of how better to do this than to add a table mapping pointers to some kind of opaque IDs at the message layer?
C. Run 32-bit motifd on 64-bit system. You need some 32-bit libraries to be able to run CMUCL at all, just install the X11 and Motif ones as well. Robert Swindells
Robert Swindells writes:
C. Run 32-bit motifd on 64-bit system.
You need some 32-bit libraries to be able to run CMUCL at all, just install the X11 and Motif ones as well.
That's a good idea, too. (Perhaps the binary distribution for Linux shouldn't ship with a 64-bit motifd, though. It's liable not to work for some people, and mislead me into expecting less confusion today on FreeBSD.) Thanks, Richard
Richard M Kreuter writes:
Seems like there are two options...
A. Change the wire protocol to accomodate 64-bit integers.
B. Synthesize 32-bit identifiers for instances of the offending types.
Well I tried B. Attached is a proof of concept that suffices to run the example in the doc and the programs in INTERFACE. Nevertheless, it's not particularly good; I'm just out of time for today. Obvious problems in the current code: 1. It's a doubly linked alist associating pointers with 32-bit integers. 2. It looks like nothing ever gets removed from the alist. (I don't yet understand how memory is managed in motifd. I tried to hook an "unintern" function into every place where XtFree is called, but I don't see the linked list shrinking in some (unattached) instrumented code.) 3. I'm not certain that I've caught all the places where motifd hands out pointers to Lisp. If anyone is particularly interested in maintaining the thing, I ought to have time next weekend to spruce it up. (And if anyone knows where to find non-trivial example clm programs to exercise it against, that could help.) Regards, Richard
On 7/6/14 11:58 AM, Richard M Kreuter wrote:
Greetings,
I believe it turns out to be a fluke that a 64-bit motifd works anywhere: the server passes out 32-bits of a pointer as external IDs for instances of a handful of types [1]. On a 64-bit machine, the instances' addresses might not fit in a 32-bit address, though.
(In fact, on my FreeBSD/amd64 machine, when I run the example from the documentation, the first shell widget always gets created at #x8045d8900, so motifd hands out #x45d8900, and then attempting to create the second widget with the shell as parent crashes the server.)
Seems like there are two options:
A. Change the wire protocol to accomodate 64-bit integers.
B. Synthesize 32-bit identifiers for instances of the offending types.
Option B seems simpl
[1] I think the complete list is AcceleratorTable, Atom, FontList, TranslationTable, Widget, and sometimes XmString.
Thanks for the report. (I had responded earlier, but used gmane, and cmucl's lists don't allow mail from gmane anymore for some unknown reason). In any case, see also http://trac.common-lisp.net/cmucl/ticket/84 I'm surprised anyone is using clm anymore, and I rarely, if ever, check to see if it works. If you don't mind, can you tell me what you use it for? I'm just curious. Ray
_______________________________________________ cmucl-imp mailing list cmucl-imp@cmucl.cons.org http://lists.zs64.net/mailman/listinfo/cmucl-imp
participants (3)
-
Raymond Toy -
Richard M Kreuter -
Robert Swindells