Menu

#2804 crasher in unix/tkUnixWm.c UpdatePhotoIcon

obsolete: 8.5.8
closed-fixed
7
2010-05-19
2010-05-18
No

I'm developing coccinella on OpenBSD, and wanted to try the port on other architectures than i386.
So I tried on OpenBSD 4.7 sparc64, or OpenBSD -current mips64, and I get random crashes with the following, and similar backtraces:

Program received signal SIGSEGV, Segmentation fault.
0x0000000057292780 in _XData32 () from /usr/X11R6/lib/libX11.so.12.0
(gdb) bt
#0 0x0000000057292780 in _XData32 () from /usr/X11R6/lib/libX11.so.12.0
#1 0x000000005725fafc in XChangeProperty () from /usr/X11R6/lib/libX11.so.12.0
#2 0x000000005b89b99c in UpdatePhotoIcon () from /usr/local/lib/libtk85.so.0.5
#3 0x000000005b894428 in TkWmMapWindow () from /usr/local/lib/libtk85.so.0.5
#4 0x000000005b7ddc44 in Tk_MapWindow () from /usr/local/lib/libtk85.so.0.5
#5 0x000000005ac39a70 in _ftext () from /usr/local/lib/tktray1.2/libtktray12.so.0.0
#6 0x0000000000000001 in ?? ()
Cannot access memory at address 0xfffffffffffffffe

static void
UpdatePhotoIcon(
TkWindow *winPtr)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
unsigned char *data = wmPtr->iconDataPtr;
int size = wmPtr->iconDataSize;

if (data == NULL) {
data = winPtr->dispPtr->iconDataPtr;
size = winPtr->dispPtr->iconDataSize;
}
if (data != NULL) {
/*
* Set icon:
*/

XChangeProperty(winPtr->display, wmPtr->wrapperPtr->window,
Tk_InternAtom((Tk_Window) winPtr, "_NET_WM_ICON"),
XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) data, size);
}
}

Searching google for XChangeProperty, or _XData32 I found a lot of similar bug reports with similar backtraces in other applications, which was not considered a bug in Xorg, but in the application, in the call to XChangeProperty. This seems to be a 64Bit problem.

On OpenBSD 4.6 i386, I do not have that problem, there everything works perfectly.
I'll try to install and run it on my other 32Bit systems, a sparc and vax in the next couple of days, but I guess there the problem will also not show up.

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-05-18
    • priority: 5 --> 7
    • assigned_to: jenglish --> dkf
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-05-18

    Could this in any way be related to this recent fix?

    2009-12-09 Donal K. Fellows
    * generic/tkColor.c (Tk_GetColorByValue): [Bug 2911570]: Ensure that
    hash keys of color values are zeroed first, so that they hash properly
    on 64-bit systems (where X structures are not tightly packed).

     
  • Sebastian Reitenbach

    Thanks for looking into this.

    I tried to exchange the generic/tkColor.c with the version before the change you mentioned, but then tk did not compiled anymore, I also tried to exchange some headers, but that got even worse...

    Then I completely downgraded both tcl and tk to 8.5.7, and the problem is gone, I was able to start coccinella multiple times without the crasher.
    So it may be related to the change you mentioned. The test was done on the mips64 box.

     
  • Sebastian Reitenbach

    so after updating to tcl and tk to 8.5.8 again, and taking revision 1.58.2.4 of unix/tkUnixWm.c seems to fix the problem. I was able to start coccinella multiple times on the mips64 box.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-05-19

    Looks like it has been fixed post-8.5.8.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-05-19
    • status: open --> closed
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-05-19
    • status: closed --> closed-fixed