info-inventor-dev
[Top] [All Lists]

Re: Open Inventor with openmotif

To: dennis@xxxxxxxxxxxxxxxxxxxxxx (Dennis Mikkelson)
Subject: Re: Open Inventor with openmotif
From: jlim@xxxxxxxxxxxxxxxxxxxx (Jonathan Lim)
Date: Sat, 16 Sep 2000 00:39:23 -0700 (PDT)
Cc: info-inventor-dev@xxxxxxxxxxx
In-reply-to: <200009160723.CAA19686@xxxxxxxxxxxxxxxxxxxxxx> from "Dennis Mikkelson" at Sep 16, 2000 02:23:08 AM
Sender: owner-info-inventor-dev@xxxxxxxxxxx
On Sat Sep 16 00:23:08 2000, dennis@xxxxxxxxxxxxxxxxxxxxxx wrote:
> 
> Hi,
> 
> I was having trouble building Open Inventor using the OpenMotif 2.1.30 rpms
> from Metrolink on a RedHat 6.2 Linux system.  In particular ivview would
> seg fault immediately.  I tracked the problem to a call to
> XmCreatePulldownMenu that passed NULL in for the second parameter,
> the name string.  Replacing:
> 
>   XmCreatePulldownMenu(menuWidget, NULL, popupargs, popupn);
> 
> with
> 
>   XmCreatePulldownMenu(menuWidget, "", popupargs, popupn);
> 
> fixed the problem.  This problem had been fixed at a few other places

More information about this ... I happen to be working on an unrelated Motif
2.1 problem and have the code for RowColumn.c in front of me.

In Motif 1.2, the name argument was sprintf()'d into an array of 200 bytes,
hardcoded. In Motif 2.1, the array is dynamically allocated and strlen() is
used to figure out the length of the name argument. Consequently, the program
crashes at strlen() when one passes in NULL. The Motif code should really be
checking for that, just to be safe.


              Jonathan Lim  _  Silicon Graphics  _  Mountain View
              GPS Graphics     Computer Systems        CA, USA

<Prev in Thread] Current Thread [Next in Thread>