Hi All, We have a 32bit Motif Gui application. Now we ported the application from Solaris to Linux and the system is crashing very frequently. On our analysis we could find that this issue happened when we are closing the forms in our application. When the forms are closed we will delete the forms and will call the function XtDestroyWidget() to remove the widgets. We ran a purify for the application and we could found that the Stack Array Bounds Read (SBR) is happening when we close the form.

I had downloaded a sample motif program from the internet which is using XtDestroyWidget() to destroy the object. When i ran purify for this sample program also, i could found the same SBR.

SBR: Stack array bounds read (54 times): * This is occurring while in: XtDispatchEvent [libXt.so.4] RemoveAllPMgr [libXm.so.3] XtCallCallbackList [libXt.so.4] XtPhase2Destroy [libXt.so.4] _XtDoPhase2Destroy [libXt.so.4] XtDispatchEvent [libXt.so.4] XtAppMainLoop [libXt.so.4] main [popup.cc:49] _start [crt1.o] * Reading 4 bytes from 0xffbfe4f0. * Frame pointer 0xffbfe4d0 * Address 0xffbfe4f0 is 32 bytes above stack pointer in function XtCallCallbackList.

This SBR is happening in the XtAppMainLoop(). From these facts i assume that this SBR is a common one and related to motif rather than to our application.

Can you please add some thoughts to the following questions. 1) Why SBR is happening when we use XtDestroyWidget(). Is this SBR a severe one.

2) I had removed the XtDestroyWidget and used XtUnrealizeWidget(). This will help me to remove the SBR and hence crash is not happening. Also all normal forms will be removed normally. But the problem i am facing in this approach is the POP_UP forms are NOT removed in this method. Can any one please suggest a work around for removing POP_UP forms also other than the HIDE option.

It will be very helpful for me if anyone can answer or add some thoughts for this issue.

Thanks in advance, Sanush Chacko

-----Adding Sample Program.. Hi Please find the sample program from where i got the SBR.

include X11/StringDefs.h include Xm/Xm.h include Xm/PushB.h

Widget toplevel;

void close_window(Widget w, XtPointer client_data, XtPointer event_data) { Widget popup = (Widget)client_data; XtDestroyWidget(popup); }

void pop(Widget w, XtPointer client_data, XtPointer event_data) { Widget a, button, popup;

popup = XtVaCreatePopupShell("Popup", transientShellWidgetClass, toplevel, NULL);
button = XtVaCreateManagedWidget("Close", xmPushButtonWidgetClass, popup,
    NULL);

XtAddCallback(button, XmNactivateCallback, close_window, (XtPointer)popup);

XtPopup(popup, XtGrabNone);

}

main(int argc, char *argv[]) { Widget button; XtAppContext app; XmString label;

toplevel = XtVaAppInitialize(&app, "Popup", NULL, 0,
    &argc, argv, NULL, NULL);

label = XmStringCreateSimple("Make popup"); 
button = XtVaCreateManagedWidget("pushme", xmPushButtonWidgetClass, toplevel,
    XmNlabelString, label,
    NULL);

XmStringFree(label);
XtAddCallback(button, XmNactivateCallback, pop, NULL);

XtRealizeWidget(toplevel);
XtAppMainLoop(app);

}

We wre using motif Version 2.3.1

define XmVERSION 2

define XmREVISION 3

define XmUPDATE_LEVEL 1

X11 and Xt version - 6

asked 30 Aug '10, 15:34

sanushchacko's gravatar image

sanushchacko
112
accept rate: 0%

closed 15 Jan '14, 16:43

rfelsburg's gravatar image

rfelsburg ♦
6061618

Can you post a compilable source sample code exhibiting the problem ? What Motif library are you using ?

(01 Sep '10, 15:25) jlliagre

Please find the updated original post.

(02 Sep '10, 04:10) sanushchacko

The question has been closed for the following reason "Duplicate Question" by rfelsburg 15 Jan '14, 16:43

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7

Asked: 30 Aug '10, 15:34

Seen: 4,855 times

Last updated: 15 Jan '14, 16:43

powered by OSQA