XmToggelButton crashes on "check"

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
XmToggelButton crashes on "check"

Submitted by Anonymous on Wed, 04/03/2002 - 11:01. Developers
When porting an application from DEC Alpha Unix with Motif 1.2 to
Linux Suse 7.3 with OpenMotif 2.1.30 I encountered the next problem

I have an application with a menubar.
This menubar contains about 10 drop-down menus.
Some of these drop-down menus contain menuitems that will be checked.
This checking is what gives the troubles.

Herewith I show a stack dump as generated by the core file.
I also include the last part of the code that I can debug
at this moment. This is the part the does the checking of the menu-item.

Is there someone who can tell me what I am doing wrong?
Might there be a link with the new resource-value that
takes care of the the other visuals that can be used for
the togglebuttons (XmNenableToggleVisual)?

Stack dump
0 0x40a2b990 in free () from /lib/libc.so.6
#1 0x408104d3 in XtFree () from /usr/X11R6/lib/libXt.so.6
#2 0x407453a7 in _XmCacheDelete () from /usr/X11R6/lib/libXm.so.2
#3 0x406b75b6 in _XmReCacheLabG_r () from /usr/X11R6/lib/libXm.so.2
#4 0x40769c4d in _XmRCDoMarginAdjustment () from /usr/X11R6/lib/libXm.so.2
#5 0x406df68d in ConstraintSetValues () from /usr/X11R6/lib/libXm.so.2
#6 0x40750a4f in CSetValuesLeafWrapper () from /usr/X11R6/lib/libXm.so.2
#7 0x40750ec3 in CSetValuesLeafWrapper6 () from /usr/X11R6/lib/libXm.so.2
#8 0x40831acb in CallConstraintSetValues () from /usr/X11R6/lib/libXt.so.6
#9 0x40831f86 in XtSetValues () from /usr/X11R6/lib/libXt.so.6
#10 0x4084423d in XtVaSetValues () from /usr/X11R6/lib/libXt.so.6
#11 0x08416ac7 in VMenuItemcheck (this=0x8806968, b=0) at menuitem.cxx538
#12 0x084243db in VPopupMenucheckAll (this=0x8804680, check=0) at popupmen.cxx514
#13 0x080719b1 in MainViewpopTest (this=0x87911e8, p=0x8804680) at ../mainview.cxx13103
#14 0x0845f853 in VObjectperform (this=0x87911e8, m={__delta = 0, __index = -1, __pfn_or_delta2 = {__pfn = , __delta2 = 6464}}, param=142624384) at object.cxx317
#15 0x084248b9 in VPopupMenuselected (this=0x8804680) at popupmen.cxx674
#16 0x083dccac in VAppViewmenuSelected (this=0x87911e8, m=0x8804680) at appview.cxx521
#17 0x0841a8fc in VNotifiermenuItemCascadeEvent (this=0x876a0a0, popup_menu=0x8804680) at notifier.cxx811
#18 0x0841a844 in NotifierMenuItemCascade (widget=0x8829fc8, client_data=0x8804680 "") at notifier.cxx792
#19 0x408117bf in XtCallCallbackList () from /usr/X11R6/lib/libXt.so.6
#20 0x4067f1b6 in Cascading () from /usr/X11R6/lib/libXm.so.2
#21 0x4067f329 in _XmCascadingPopup () from /usr/X11R6/lib/libXm.so.2
#22 0x4067ee48 in MenuBarSelect () from /usr/X11R6/lib/libXm.so.2
#23 0x4084144d in HandleActions () from /usr/X11R6/lib/libXt.so.6
#24 0x4084190f in HandleSimpleState () from /usr/X11R6/lib/libXt.so.6
#25 0x40841e64 in _XtTranslateEvent () from /usr/X11R6/lib/libXt.so.6
#26 0x4081cf77 in XtDispatchEventToWidget () from /usr/X11R6/lib/libXt.so.6
#27 0x4081d928 in _XtDefaultDispatcher () from /usr/X11R6/lib/libXt.so.6
#28 0x4081db89 in XtDispatchEvent () from /usr/X11R6/lib/libXt.so.6
#29 0x0841a1f3 in VNotifiermessageLoop (this=0x876a0a0, looping_for=LoopMain) at notifier.cxx551
#30 0x08419b55 in VNotifierstart (this=0x876a0a0) at notifier.cxx340
#31 0x080551b7 in cvmain (argc=10, argv=0xbfffef64) at ../aramis.cxx567
#32 0x0844f0a9 in main (argc=10, argv=0xbfffef64) at winstart.cxx240
#33 0x409d47ee in __libc_start_main () from /lib/libc.so.6

Last part of my debuggable code
// --------------------------------------------------------------------------
// Place or Remove a check mark next to this VMenuItem if
// b is TRUE or FALSE respectively.
//
boolean VMenuItemcheck(boolean b)
{
if (menu == 0) {
return FALSE;
}
bChecked = b;
if (!name.compareCStr("")) { // Do not check Separators
return FALSE;
}
if (hPMItm != 0) {
if (!XmIsSeparatorGadget(hPMItm)) {
XtVaSetValues(hPMItm, XmNindicatorOn, b, 0);
XmToggleButtonGadgetSetState(hPMItm, b, False);
}
}
if (hMItm != 0) {
if (!XmIsSeparatorGadget(hMItm)) {
---> crash XtVaSetValues(hMItm, XmNindicatorOn, b, 0);
XmToggleButtonGadgetSetState(hMItm, b, False);
}
}
return TRUE;
}

Who can give me clue?

Luuk Kuiper

ICS_support

The code looks OK.

Crashes in XtFree() and free() are usually indications that there is a pointer value somewhere else that has been corrupted. The code internal to XtFree() is solid. Some bad pointer has munged Xt`s data.

You can use AcquaProva or Purify or another memory-debugging tool to track down such stray references.