This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

X widget question


I have finally identified where ncview was
segfaulting on X86_64

The solution was to reverse the order of destruction
for a chain of widgets

        i=0;
-       while( (w = *(diminfo_row_widget + i++)) != NULL )
-               XtDestroyWidget( w );
+       while( (w = *(diminfo_row_widget + i)) != NULL )
+               i++;
+       while( i>0 ) {
+               i--;
+               XtDestroyWidget( *(diminfo_row_widget + i ));
+       }
 }

that were connected by a vertical constraints:

    *(diminfo_row_widget+ll) = XtVaCreateManagedWidget(
           widget_name,
           boxWidgetClass,
           commandcanvas_widget,
           XtNorientation, XtorientHorizontal,
           XtNfromVert, *(diminfo_row_widget + (ll-1)),
           XtNheight, bb_height,
           XtNwidth,  bb_width,
           NULL);

The segfault was inside Xlib when managing the constraints.

As the segfault did not happened on i686, is it possible
that is a race inside Xlib  ?
I have not found in the X Documentation nothing about
requested order of widget destruction in this case.

Thanks in advance
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]