[comp.windows.x] Dropping core and not knowing why

scott@nbc1.ge.com (Scott Barman) (06/26/91)

I have an application written with Motif (1.1.2) and running on Sun
Sparc systems (it bombs on a 4/280, 4/110, and a SparcStation 1+; the X
server is running on the 4/110 since that is what is in my office).  The
application gathers some information from the user to produce a report.
This report is displayed by calling XtAppCreateShell and having it
manage a child XmForm widget that is defined in a UIL file.

When the user is finished with the display, there is a DONE button
(XmPushButton widget) at the bottom of the display.  On the activate
callback, it takes the widget ID, finds the parent widget ID (the XmForm
mentioned above, with XtParent) and executes an XtDestroyWidget on that
parent widget ID.  This works fine for a while.  Then, without
explanation it core dumps.  I don't understand why because there seems
to be no pattern I can find.  I bring the program into dbx and I find
the following in the stack trace:

gershwin!(11) dbx main
Reading symbolic information...
Read 5534 symbols
warning: core file read error: address not in data space
program terminated by signal SEGV (no mapping at the fault address)
(dbx) where
warning: core file read error: address not in data space
insert() at 0xf7694274
free() at 0xf7694854
XtFree() at 0xf7770260
UrmDestroyCallback() at 0xaae0
_XtCallCallbacks() at 0xf7770998
Phase2Callbacks() at 0xf77763e8
Recursive() at 0xf77763b0
Recursive() at 0xf7776348
Recursive() at 0xf7776348
XtPhase2Destroy() at 0xf7776704
_XtDoPhase2Destroy() at 0xf7776900
XtDispatchEvent() at 0xf77796f8
XtAppMainLoop() at 0xf77799d4
main(argc = 10, argv = 0xf7fffb6c), line 110 in "main.c"
(dbx)

Sometimes, it core dumps on SIGBUS:

gershwin!(13) dbx main
Reading symbolic information...
Read 5534 symbols
warning: core file read error: address not in data space
program terminated by signal BUS (alignment error)
(dbx) where
warning: core file read error: address not in data space
realloc() at 0xf76949b0
miUnionNonO() at 0xf7735c84
miRegionOp() at 0xf7735af0
XUnionRegion() at 0xf7736288
XUnionRectWithRegion() at 0xf7734d14
XtAddExposureToRegion() at 0xf7779a94
CompressExposures() at 0xf7778f48
DispatchEvent() at 0xf7778c8c
DecideToDispatch() at 0xf7779520
XtDispatchEvent() at 0xf77796d8
XtAppMainLoop() at 0xf77799d4
main(argc = 10, argv = 0xf7fffb6c), line 110 in "main.c"
(dbx)

Line 110 in main.c is the call to XtAppMainLoop().
And other times, it core dumps when to fetch the XmForm widget using
MrmFetchWidget():

gershwin!(15) dbx main
Reading symbolic information...
Read 5534 symbols
warning: core file read error: address not in data space
program terminated by signal BUS (alignment error)
(dbx) where
warning: core file read error: address not in data space
realloc() at 0xf76949b0
XtRealloc() at 0xf77701e4
CompositeInsertChild() at 0xf7770de0
`Manager`InsertChild() at 0x940ec
`BulletinB`InsertChild() at 0x156d8
_XtCreateWidget() at 0xf7775fb4
XtCreateWidget() at 0xf7776010
XmCreateLabel() at 0x2d440
UrmCreateWidgetInstance() at 0x97c8
UrmCreateWidgetTree() at 0x9278
UrmCreateWidgetTree() at 0x9448
MrmFetchWidgetOverride() at 0x6848
MrmFetchWidget() at 0x66d0
fetch_widget(shell = 0x148dd8, hierarchy_id = 0xf1188, name = 0xb52f7 "RSForm"), line 229 in "cb.c"
cb_display_advertiser(start_time = -1, end_time = 6, start_day = 662706000, end_day = 677822400, isci = 0x14e738 "*", is_spot = 0, strings = 0x149af8), line 1044 in "cb.c"
rg_generate(is_print = 0), line 111 in "rg.c"
cb_generate(unused = 0x1241b8, is_print = 0x11424c), line 470 in "cb.c"
_XtCallCallbacks() at 0xf7770998
XtCallCallbackList() at 0xf7770c04
`PushB`ActivateCommon() at 0x41d8c
`PushB`Activate() at 0x41bbc
_XtTranslateEvent() at 0xf778fe38
DispatchEvent() at 0xf7778ee8
DecideToDispatch() at 0xf7779618
XtDispatchEvent() at 0xf77796d8
XtAppMainLoop() at 0xf77799d4
main(argc = 10, argv = 0xf7fffb6c), line 110 in "main.c"
(dbx)

(I have to remove those 9Mb core dumps!)

If anyone has an idea of where I can look or if there's some gotcha in
X11 or Motif that I don't know about, I would appreciate the info.  I am
stuck and I have to demo this thing by Friday.

Thanks in advance to all who can help!!

-- 
scott barman			| Life's Mystery #4,598,346:
scott@nbc1.ge.com		|   How many light bulbs could it possibly
(This does not represent any	|   take to run a television network?
 opinions of NBC or affiliates)	|