LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-26-2011, 06:53 AM   #1
sanushchacko
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Rep: Reputation: 0
Motif program crashes when performing Drag and Drop


We have an application which allows user to perform Drag and Drop operations. The problem we are facing now is the application crash. System works fine for some time and allows user to perform many drag drops successfully. But after running for some time and user perform a drag and drop the system crashes.
Following stack trace we are getting while system crashes.

XtDispatchEvent [Event.c]
RemoveAllPMgr [libXm.so.3]
XtCallCallbackList [Callback.c]
Recursive [Destroy.c]
XtPhase2Destroy [Destroy.c]
_XtDoPhase2Destroy [Destroy.c]
XtDestroyWidget [Destroy.c]
DragDropFinish [libXm.so.3]
DropConvertCallback [libXm.so.3]
DoLocalTransfer [Selection.c]

Ours is a 32-Bit application running in the Solaris/Linux. We are using the Motif 2.3.1 Version

We had run a IBM Rational Purify for the application to find memory issues. We could find one memory issue as below.
SBR(Stack array Bounds Read)
SBR: Stack array bounds read (36 times)
This is occurring while in:
XtDispatchEvent [Event.c]
RemoveAllPMgr [libXm.so.3]
XtCallCallbackList [Callback.c]
Recursive [Destroy.c]
XtPhase2Destroy [Destroy.c]
_XtDoPhase2Destroy [Destroy.c]
XtDestroyWidget [Destroy.c]
DragDropFinish [libXm.so.3]
DropConvertCallback [libXm.so.3]
DoLocalTransfer [Selection.c]
Reading 4 bytes from 0xffbee478.
Frame pointer 0xffbee458
Address 0xffbee478 is 32 bytes above stack pointer in function XtCallCallbackList.
This happens when the Drag Drop completes

Please note that here the XtDestroyWidget is called by MOTIF itself. We believe this is to destroy the DragContext created by us using the XmDragStart. Since the XtDestroyWidget is called by the MOTIF from DragDropFinish, we cannot stop calling it.
To prevent the SBR(Stack array Bounds Read), we have removed all the XmNdestroyCallback callbacks functions for the

DragContext widget using the below command.
XtRemoveAllCallbacks(dc, XmNdestroyCallback);

But even after this removal the SBR(Stack array Bounds Read) is happening same as previous.
Can you please let us know why the call back function is called even after we removed the callbacks ?.

Also i had tried the a sample program from the Motif Programming Manual (Volume 6A). The sample program can be found in

the below link.
http://www.ist.co.uk/motif/books/vol...fm.html#791437
file_manager.c and editor_dnd.c are the example i took.
For these program also when we ran IBM Rational Purify, SBR raised

SBR: Stack array bounds read (117 times)
This is occurring while in:
XtDispatchEvent [Event.c]
RemoveAllPMgr [libXm.so.3]
XtCallCallbackList [Callback.c]
Recursive [Destroy.c]
XtPhase2Destroy [Destroy.c]
_XtDoPhase2Destroy [Destroy.c]
XtDispatchEvent [Event.c]
XtAppMainLoop [Event.c]
Reading 4 bytes from 0xffbeea10.
Frame pointer 0xffbee9f0
Address 0xffbeea10 is 32 bytes above stack pointer in function XtCallCallbackList.

Can you please let me know is there any way to avoid this SBR happening here?.
Also is it possible to check is a Bug in motif?.
 
Old 07-27-2011, 12:58 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Do you know how to use gdb and valgrind? gdb should help find this particular bug and valgrind should help with latent bugs.
Kevin Barry
 
  


Reply

Tags
motif, xwindows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag and Drop PapillonRus Linux - General 1 08-11-2008 10:44 AM
drag and drop seaking Linux - Desktop 0 05-25-2007 01:05 PM
drag and drop poeta_boy Programming 4 11-23-2006 09:32 PM
KDE --how to make perl program support drag and drop? nextekcarl Linux - Software 2 01-19-2006 01:35 AM
Drag and Drop on CDRW TigerLinux Linux - Software 1 10-09-2005 04:54 AM


All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration