esj@manatee.cis.ufl.edu (Eric S. Johnson) (03/16/89)
Im having trouble getting xwebster to work. It compiles fine, but dumps core when you attempt to "define" a word. The core dump occurs because XwTextCopyBuffer is returning a nil (char *). (Line 90, contolpanel.c) word = (char *) XwTextCopyBuffer(word_input_Wgt); Before I dig deeper into this problem, has anyone else seen it. Did I make some sorta obvious mistake somewhere... Relevent Data: X11r3 on a Sun 3. Sun OS 4.0.1. Fixes 1-8 and Purdue 2.0 and 2.1. Server compiled with gcc 1.31. Shared libX11. Xw from contrib/widgets/Xhp + fixes for R3. Compiled with Sun cc. Problem occurs with xwebster compiled with gcc 1.31 and Sun cc. Ej <esj@ufl.edu>
jlo@elan.UUCP (Jeff Lo) (03/17/89)
In article <19929@uflorida.cis.ufl.EDU> esj@manatee.cis.ufl.edu (Eric S. Johnson) writes: > Im having trouble getting xwebster to work. It compiles fine, > but dumps core when you attempt to "define" a word. > > The core dump occurs because XwTextCopyBuffer is returning > a nil (char *). (Line 90, contolpanel.c) > > word = (char *) XwTextCopyBuffer(word_input_Wgt); > > Before I dig deeper into this problem, has anyone else seen it. > Did I make some sorta obvious mistake somewhere... > > Relevent Data: > X11r3 on a Sun 3. Sun OS 4.0.1. > Fixes 1-8 and Purdue 2.0 and 2.1. > Server compiled with gcc 1.31. > Shared libX11. > > Xw from contrib/widgets/Xhp + fixes for R3. Compiled with Sun cc. > > Problem occurs with xwebster compiled with gcc 1.31 and Sun cc. > > Ej > <esj@ufl.edu> I noticed this problem in something else using Xw. It turns out that two functions in Xw/TextEdit.c are not returning anything. I have enclosed a diff -c patch to fix it. What has been happening is that the copy functions get called, but the value isn't returned. I guess the HP compilers were leaving the values in the right place on the stack, but other machines wouldn't get anything. By looking at the code, this was happening with both XwTextCopyBuffer() and XwTextCopySelection(). I hope this fixes your problem. Jeff Lo Elan Computer Group, Inc. 888 Villa Street, Third Floor Mountain View, CA 94041 (415) 964-2200 ..!{ames,uunet}!elan!jlo ---- *** TextEdit.c.orig Fri Aug 19 13:32:56 1988 --- TextEdit.c Tue Nov 1 13:45:02 1988 *************** *** 1921,1928 XwTextEditWidget w; { ! (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring) ! ((XwTextEditWidget)w, 0, GETLASTPOS(w)); } --- 1921,1928 ----- XwTextEditWidget w; { ! return((*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_substring) ! ((XwTextEditWidget)w, 0, GETLASTPOS(w))); } *************** *** 1931,1938 /*--------------------------------------------------------------------------+*/ XwTextEditWidget w; { ! (*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_selection) ! ((XwTextEditWidget)w); } /*--------------------------------------------------------------------------+*/ --- 1931,1938 ----- /*--------------------------------------------------------------------------+*/ XwTextEditWidget w; { ! return((*((XwTextEditClassRec *)(w->core.widget_class))->textedit_class.copy_selection) ! ((XwTextEditWidget)w)); } /*--------------------------------------------------------------------------+*/