[Xastir] Re: Crash on 64-bit FC3
Jim King
jim at jimking.net
Thu Oct 7 10:50:16 EDT 2004
I wrote:
>I'm running FC3 test 2, Xastir source pulled from CVS yesterday. I
>suspect this is an FC3 bug, but I'm an X11 noob. Xastir crashes with a
>segmentation violation. In gdb I get:
>
>(gdb) bt
>#0 0x0000003b07c4d061 in _XtCountVaList () from /usr/X11R6/lib64/libXt.so.6
>#1 0x0000003b07c4cabe in XtVaGetValues () from /usr/X11R6/lib64/libXt.so.6
>#2 0x0000000000473925 in da_expose (w=0x8b9960, client_data=0x3b00000000,
> call_data=0x7fbfffe7f8) at main.c:9069
>#3 0x0000003b07c13fa5 in XtCallCallbackList ()
> from /usr/X11R6/lib64/libXt.so.6
>[etc.]
>
>It looks to me like the call from da_expose to XtVaGetValues is causing
>a segv. Since this same code works on 32-bit Linux that led to me guess
>that this is a bug in 64-bit FC3, unless maybe Xastir is using
>XtVaGetValues in a not-quite-sanctioned manner that happens to work on
>32-bit but not on 64-bit.
>
>If somebody can confirm that Xastir's use of XtVaGetValues is OK I'll
>submit a Fedora bug. Otherwise if somebody can suggest some variations
>on the function call to try I'll do that.
>
A little bit of looking at the source code was inspirational, and I
think I've found the problem. It looks to me like the XtVaXXX functions
require a NULL as the final parameter to signal the end of argument
list. In main.c, a little over half of the calls to XtVaGetValues use
"0" as the final parameter, and the rest of the calls use "NULL" as the
final parameter. I think that all of the calls to other XtVaXXX
functions use "NULL" as the final parameter. On x86_64, int's are still
32 bits, but pointers are 64 bits, so "0" (an int) and "NULL" (a
pointer) are not the same thing. I changed all the of the 0 final
parameters to NULL in calls to XtVaGetValues and Xastir seems to run OK now.
Jim, KD5LUQ
More information about the Xastir
mailing list