I'll follow up to my own message.

The following patch to OpenDX fixes the problem with LessTif.
I believe that this is an OpenDX bug, not a LessTif bug.

You'll want to remove the fprintf statement of course.

        Danny

dell: {10} cvs diff TransferAccelerator.c
Index: TransferAccelerator.c
===================================================================
RCS file: /src/master/dx/src/uipp/dxuilib/TransferAccelerator.c,v
retrieving revision 1.5
diff -c -r1.5 TransferAccelerator.c
*** TransferAccelerator.c       2002/03/22 23:26:24     1.5
--- TransferAccelerator.c       2002/04/15 19:16:50
***************
*** 7,13 ****
  /***********************************************************************/
  
  #include "dxconfig.h"
! 
  #include <stdlib.h>
  #include <X11/Xatom.h>
  #include <X11/Intrinsic.h>
--- 7,13 ----
  /***********************************************************************/
  
  #include "dxconfig.h"
! #include <stdio.h>
  #include <stdlib.h>
  #include <X11/Xatom.h>
  #include <X11/Intrinsic.h>
***************
*** 188,197 ****
  
  #if defined(HAVE_XMMAPKEYEVENTS)
                int        count ;
!               int       *type_list;
!               KeySym    *keysym_list ;
!               Modifiers *modifiers_list ;
!               
                count = _XmMapKeyEvents(accelerator, &type_list, &keysym_list,
&modifiers_list) ;
  
                if (count > 0) {
--- 188,198 ----
  
  #if defined(HAVE_XMMAPKEYEVENTS)
                int        count ;
!               int       *type_list = (int *)XtCalloc(10, sizeof(int));
!               KeySym    *keysym_list = (KeySym *)XtCalloc(10, sizeof(KeySym));
!               Modifiers *modifiers_list = (Modifiers *)XtCalloc(10,
sizeof(Modifiers));
! 
!       fprintf(stderr, "TransferAccelerator(%s)\n", accelerator);
                count = _XmMapKeyEvents(accelerator, &type_list, &keysym_list,
&modifiers_list) ;
  
                if (count > 0) {



Danny Backx wrote:
> 
> Rob Lahaye pointed me to these addresses.
> 
> The CVS version of LessTif seems to have problems with the CVS
> version of OpenDX, in our new implementation of _XmMapKeyEvents().
> I wrote to you about implementing that in LessTif earlier.
> 
> Please read the messages attached, I am not completely sure
> whether the way in which OpenDX calls _XmMapKeyEvents() is correct.
> I've indicated a fix as well.
> 
> After that fix, there is still a problem, Rob indicates that this
> may be LessTif related. The argument is that OpenDX-CVS works with
> LessTif 0.93.18 but not with LessTif-CVS. (I'm inclined to
> believe that.)
> 
> Do you have more insights ?
> 
> Also is my idea about the _XmMapKeyEvents() call right - that your
> call is mistaken ?
> 
> Thanks,
> 
>         Danny
> --
> Danny Backx ([EMAIL PROTECTED] [EMAIL PROTECTED])
> Home page :     http://users.skynet.be/danny.backx
> Projects:       LessTif (http://www.lesstif.org)
>                 Oleo    (http://www.gnu.org/software/oleo/oleo.html)
> 
>   --------------------------------------------------------------------------------
> 
> Subject: Re: [Lesstif] Re: lesstif-CVS: Double click on VPE-tool (OpenDX)
>      destroys VPE.
> Date: Fri, 12 Apr 2002 12:00:05 +0200
> From: Danny Backx <[EMAIL PROTECTED]>
> Organization: Familie Backx
> To: Alexander Mai <[EMAIL PROTECTED]>,
>      "R. Lahaye" <[EMAIL PROTECTED]>
> CC: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> References: <[EMAIL PROTECTED]>
> 
> I have the CVS version of OpenDX working now, and I can reproduce.
> 
> However, is the OpenDX code correct ?
> 
> It is passing this to _XmMapKeyEvents :
>         KeySym  keysym = 0;
>         KeySym  *keysym_list;
>         count = _XmMapKeyEvents(accelerator, &type_list, &keysym_list, ...
> 
> Shouldn't keysym_list either point to allocated memory or be initialised to 0 ?
> 
> I'd expect something like this :
>         KeySym  *keysym_list = XtCalloc(10, sizeof(KeySym));
> or
>         KeySym  *keysym_list = NULL;
> 
> (In the latter case I could detect inside LessTif and allocate memory
> for this, but I'm not sure whether I should do this as I have no description
> of what _XmMapKeyEvents() should do in this case. Currently I'm not
> detecting it so the second suggestion would crash with LessTif.)
> 
> I made the first of my suggested changes above, and now I get a crash
> further along. I stopped gdb around the previously guilty lines, and
> printed some stuff :
> 
> (gdb) break 2040
> Breakpoint 2 at 0x40170328: file MapEvent.c, line 2040.
> (gdb) c
> Continuing.
> 
> Breakpoint 2, _XmMapKeyEvents (str=0x842ce10 "Ctrl<Key>S", eventType=0xbffff114,
>     keysym=0xbffff110, modifiers=0xbffff10c) at MapEvent.c:2040
> 2040                    (*keysym)[i] = e->event.eventCode;
> (gdb) p i
> $1 = 0
> (gdb) s
> 2041                    (*modifiers)[i] = e->event.modifiers;
> (gdb) s
> 2042                    i++;
> (gdb) p *keysym
> $2 = (KeySym *) 0x8473940
> (gdb) p *keysym[0]
> $3 = 83
> (gdb) c
> Continuing.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x080b2c86 in EditorWindow::doSelectedNodesDefaultAction ()
> (gdb) q
> 
> This may still be a LessTif problem, but I cannot tell without
> further investigation. Rob, do you have insights ?
> 
>         Danny
-- 
Danny Backx ([EMAIL PROTECTED] [EMAIL PROTECTED])
Home page :     http://users.skynet.be/danny.backx
Projects:       LessTif (http://www.lesstif.org)
                Oleo    (http://www.gnu.org/software/oleo/oleo.html)
_______________________________________________
Lesstif mailing list
[EMAIL PROTECTED]
https://terror.hungry.com/mailman/listinfo/lesstif

Reply via email to