[comp.windows.x] X11R4 xrn

garyf@mehlville.ncsa.uiuc.edu (Gary Faulkner) (01/09/90)

I am having a problem with the xrn distributed with r4 (on one of the
contrib tapes).  It displays
article titles, but fails to display the selected articles contents. 
Has anyone else seen this??
I have temporarily went back to the binary I compiled under R3, but I'd
like to have all R4 
clients for consitency's sake.

Any help is appreciated.


Gary Faulkner
National Center for Supercomputing Applications - University of Illinois
Internet: garyf@mehlville.ncsa.uiuc.edu
Disclaimer:  I've only stated my opinion, not anyone elses.

parker@eric.mpr.ca (Ross Parker) (01/10/90)

In article <1990Jan9.120453.15352@ux1.cso.uiuc.edu> garyf@mehlville.ncsa.uiuc.edu (Gary Faulkner) writes:
>I am having a problem with the xrn distributed with r4 (on one of the
>contrib tapes).  It displays
>article titles, but fails to display the selected articles contents. 
>Has anyone else seen this??
>I have temporarily went back to the binary I compiled under R3, but I'd
>like to have all R4 
>clients for consitency's sake.
>
>Any help is appreciated.
>

I, too, am having a problem with xrn.

H/W: Sun 3/60 Monochrome, 8Mb memory, local SCSI disk
S/W: SunOS 4.0.3, X11R4, twm (R4), xrn (R4)
Environment: Standard X11R4 installation. Gcc 1.36 used. xrn installed in
	     standard location (/usr/bin/X11/xrn) with supplied app-defaults
	     file.

Description: xrn dies in XrmStringToQuark with a segmentation violation 
	     (i.e. 'Caught signal (11), cleaned up .newsrc and removed temp
	     files' dialogue is displayed) when the 'read group' button is
	     selected (A couple of article titles are displayed in the top
	     box).

Traceback from dbx:

(dbx) where
XrmStringToQuark(0x4c) at 0x4921a
CacheArgs(0x2361f8, 0x4, 0x0, 0x0, 0xeffed3c, 0x64, 0xeffed38) at 0x3b457
_XtGetResources(0x2361f4, 0x2361d8, 0x4, 0x0, 0xefff510) at 0x3b4eb
_XtCreate(0x844a3, 0x0, 0x84178, 0xc52e4, 0xb8854, 0x2361d8, 0x4, 0x0, 0x0, 0x0) at 0x2f481
_XtCreateWidget() at 0x2f875
XtCreateWidget(0x844a3, 0x84178, 0xc52e4, 0x2361d8, 0x4) at 0x2f901
XawDiskSourceCreate() at 0x176d9
redrawArticleWidget(filename = 0x23614c "/tmp/xrn16797-a02215", question = 0xae2b0 "Article 16797 in comp.unix.questions (58 remaining)"), line 1777 in "buttons.c"
foundArticle(file = 0x23614c "/tmp/xrn16797-a02215", ques = 0xae2b0 "Article 16797 in comp.unix.questions (58 remaining)", artNum = 16797), line 1992 in "buttons.c"
artNextFunction(widget = (nil), client_data = (nil), call_data = (nil)), line 2915 in "buttons.c"
artNextUnreadFunction(widget = (nil), client_data = (nil), call_data = (nil)), line 2968 in "buttons.c"
switchToArticleMode(0x9b058, 0xefff648), line 1843 in "buttons(0xd4b20, 0xd4b4c, 0xefffd7c, 0xefff987) at 0x44c35
DispatchEvent(0xefffd7c, 0xd4b20, 0x8, 0xb9114) at 0x31cbb
DecideToDispatch(0xefffd7c) at 0x321ed
XtDispatchEvent(0xefffd7c) at 0x32299
XtAppMainLoop(0xb6e48) at 0x32511
XtMainLoop() at 0x324ef
main(argc = 1, argv = 0xefffe40, 0xefffe48), line 232 in "xrn.c"


Any help would be appreciated. If the original poster has recieved any info
about this problem, I'd appreciate a note about it, as I *can't* run the R3
version of xrn for some reason... (I get a 'Client is not authorized to
connect to Server' error).


Thanks a lot!

BTW... Congratulations to those in the X Consortium... This software (other
than xrn breaking!) is *SLICK*! The R4 server is blindingly fast, and built
much easier than the R3 version.

You guys all deserve large raises.


Ross

-- 
Ross Parker      uunet!ubc-cs!mpre!parker       |
Microtel Pacific Research Ltd.			| You can't erase the dream,
Burnaby, B.C.,					| you can only wake me up...
Canada, eh?					|

casey@gauss.llnl.gov (Casey Leedom) (01/10/90)

  I notice quite a few uses of XtNewString with constant strings in xrn.
since you're using GCC, you're probably getting bitten by the GCC bug I
mentioned earlier.  GCC compiles the following:

	"..." == 0 ? exp1 : exp2

into exp1 instead of exp2 as it should.  This bug is in 1.34 and 1.36 at
least, and someone told me that it was also in 1.35.  Richard Stallman
tells me that the BETA version of GCC 1.37 (soon to be released).  In the
mean time there's a fairly simple work around.  Just rewrite the ternary
expression as:

	"..." != 0 ? exp2 : exp1

Here's the patch one more time:

*** mit/lib/Xt/Intrinsic.h-dist	Fri Dec 15 04:35:00 1989
--- mit/lib/Xt/Intrinsic.h	Sun Jan  7 20:43:15 1990
***************
*** 2144,2150 ****
  
  #define XtNew(type) ((type *) XtMalloc((unsigned) sizeof(type)))
  #define XtNewString(str) \
!     ((str) == NULL ? NULL : (strcpy(XtMalloc((unsigned)strlen(str) + 1), str)))
  
  extern char *XtMalloc(
  #if NeedFunctionPrototypes
--- 2144,2150 ----
  
  #define XtNew(type) ((type *) XtMalloc((unsigned) sizeof(type)))
  #define XtNewString(str) \
!     ((str) != NULL ? (strcpy(XtMalloc((unsigned)strlen(str) + 1), str)) : NULL)
  
  extern char *XtMalloc(
  #if NeedFunctionPrototypes