cdesktopenv/cde/programs
Marcin Cieslak 48b76f8623 dtcreate: Don't crash when clicking "Find Set..."
dtcreate crashed on 64-bit system when clicking
"Find Set.." button.

Crash happens in libXm:

    new_w=0x805db4300, args=0x7fffffffb430, num_args=0x7fffffffb3dc)
    at Form.c:1955

$1 = {att = {{type = 4 '\004', w = 0x805db3700, percent = 0, offset = 0,
      value = 0, tempValue = 0}, {type = 1 '\001', w = 0x0, percent = 0,
      offset = 10, value = 0, tempValue = 0}, {type = 3 '\003',
      w = 0x805db3700, percent = 0, offset = 0, value = 0, tempValue = 0}, {
      type = 3 '\003', w = 0x800000000, percent = 0, offset = 10, value = 0,
      tempValue = 0}}, next_sibling = 0x0, sorted = 0 '\0',
  resizable = 1 '\001', preferred_width = 0, preferred_height = 0}

(...)

    at icon_selection_dialog.c:1768
1767            /* Creation of icon_scrolled_win */
1768            icon_scrolled_win = XtVaCreateManagedWidget( "icon_scrolled_win",
1769                            xmScrolledWindowWidgetClass,
1770                            icon_selection_dialog,
1771                            XmNscrollingPolicy, XmAUTOMATIC,
1772    /*                      XmNnavigationType, XmTAB_GROUP, */
1773                            XmNx, 282,
1774                            XmNy, 84,
1775                            XmNscrollBarDisplayPolicy, XmAS_NEEDED,
1776                            XmNrightOffset, 10,
1777                            XmNrightAttachment, XmATTACH_FORM,
1778                            XmNtopOffset, 0,
1779                            XmNtopWidget, icon_container_label,
1780                            XmNtopAttachment, XmATTACH_WIDGET,
1781                            XmNleftOffset, 0,
1782                            XmNleftWidget, icon_container_label,
1783                            XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
1784                            XmNbottomOffset, 10,
1785                            XmNbottomWidget, XmATTACH_NONE,
1786                            XmNbottomAttachment, XmATTACH_WIDGET,
1787                            NULL );

What happens here is that ConstraintInitialize receives
four constraints, the last one is this:

    { type = 3 '\003', /* XmATTACH_WIDGET */
      w = 0x800000000, /* malformed XmATTACH_NONE ???
      percent = 0,
      offset = 10, /* specified as XmNbottomOffset */
      value = 0,
      tempValue = 0}

XmATTACH_* values are defined in <Xm/Xm.h> as follows:

   505  enum{   XmATTACH_NONE,                  XmATTACH_FORM,
   506          XmATTACH_OPPOSITE_FORM,         XmATTACH_WIDGET,
   507          XmATTACH_OPPOSITE_WIDGET,       XmATTACH_POSITION,
   508          XmATTACH_SELF
   509          } ;

What is not clear to why XmATTACH_NONE - which should be (int)0 -
becomes 0x800000000 - looks like a 64 bit bug somewhere.

Providing a long value on None (0L) as in this change fixes the
problem.

I understand is that it possible to use such an "empty" widget
is to create additional space at the bottom of the newly created
"icon_scrolled_win".

What needs to be clarified - shouldn't be such an (int) value be
automatically promoted to (long) (or XtArgVal, XtPointer, ...)
and preserve the value 0? Lots of parameters seem to be
passed as ints (for example dimensions) and they do not
appear to cause any trouble.
2012-09-30 11:11:21 -06:00
..
backdrops Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
dsdm dsdm: Include ansi C headers to prevent implicit incompatible declaration warnings. 2012-08-30 17:59:34 +01:00
dtaction 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
dtappbuilder Remove unnecessary extern modifier from struct declaration. 2012-09-27 18:01:09 -06:00
dtappintegrate Use KORNSHELL variable instead of /bin/ksh 2012-08-23 20:00:43 -06:00
dtcalc message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtcm Fixes for dtlogin and dtcm on FreeBSD. 2012-09-05 19:27:45 -06:00
dtconfig message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtcreate dtcreate: Don't crash when clicking "Find Set..." 2012-09-30 11:11:21 -06:00
dtdbcache 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
dtdocbook dtdocbook: on some systems SIGLOST = SIGPWR and they should not be in the same case statement. 2012-08-16 16:19:40 -06:00
dtdspmsg dtdspmsg: Warning prevention 2012-08-30 18:14:15 +01:00
dtexec Don't use fstat for readable pipe chars in dtexec. 2012-09-09 18:23:45 -06:00
dtfile dtfile: fix crash in RecheckFlag (64bit) 2012-09-28 19:13:29 -06:00
dthello message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dthelp message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dticon dticon: fix typo in the last commit 2012-09-27 17:54:09 -06:00
dtimsstart message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtinfo 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
dtksh Fix for __va_copy on FreeBSD i386. 2012-09-05 19:28:31 -06:00
dtlogin Dtlogin logo for FreeBSD 2012-09-25 11:35:29 -06:00
dtmail Use the system strcasestr() on Linux. 2012-09-27 18:01:24 -06:00
dtpad dtpad: kill one warning 2012-09-23 19:46:21 -06:00
dtpdm dtpdm: XtVaGetValues, XtPointer, XtArgVal, ... 2012-09-24 18:31:25 -06:00
dtpdmd message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtprintegrate message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtprintinfo dtprintinfo: sym2num needs ksh 2012-09-23 19:43:43 -06:00
dtscreen message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtsearchpath Don't make /var group writable 2012-09-25 11:33:11 -06:00
dtsession message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
dtspcd FreeBSD updates for dtspcd, dtfile and others 2012-08-15 12:41:31 -06:00
dtsr dtsr: include stdlib.h to resolve 20 incompaible implicit declaration warnings. 2012-08-29 18:25:32 +01:00
dtstyle dtstyle: XVaGetValues() calls 2012-09-26 19:42:57 -06:00
dtterm dtterm: Resolve 4 compiler warnings 2012-09-17 16:28:55 +01:00
dtudcexch dtudcexch/dtudcfonted: Resolve 78 compiler warnings. 2012-09-18 12:00:05 +01:00
dtudcfonted dtudcexch/dtudcfonted: Resolve 78 compiler warnings. 2012-09-18 12:00:05 +01:00
dtwm dtfile: Add missing prototypes 2012-09-18 09:59:11 -06:00
fontaliases Corrected font aliases for "-b&h-lucidasans" on FreeBSD. 2012-09-25 11:32:02 -06:00
icons Update vendor logo for FreeBSD 2012-09-26 19:43:55 -06:00
localized message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
nsgmls Process sgml and man files in doc directory for FreeBSD. 2012-08-15 15:56:03 -06:00
palettes Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
ttsnoop OpenBSD patches for ttsnoop. 2012-08-11 20:06:44 -06:00
tttypes Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
types Use KORNSHELL variable instead of /bin/ksh 2012-08-23 20:00:43 -06:00
util 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
Imakefile dtlogin: enable building on FreeBSD 2012-09-06 12:36:14 -06:00