🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #837

patch for xrn 6.17beta coredumps (Re: XRN exits with Caught signal 11, Sun 4, OS 4.1.1)

#837
From: Jonathan I. Kamens
Date: Tue, 05 Nov 1991 02:48
128 lines
4198 bytes
The patches below fix two bugs that corrupt the malloc arena and therefore
(potentially) cause coredumps.  I, too, had problems with xrn 6.17beta dumping
core when linked against the R5 libraries, but it has not happened to me since
I applied these patches.

These have both been submitted to the maintainers of xrn, and will presumably
be included in some form or another when xrn is released for real.

*** /tmp/,RCSt1001914	Tue Oct 22 16:10:39 1991
--- buttons.c	Tue Oct 22 16:09:48 1991
***************
*** 2912,2919 ****
      Arg args[5];
      int fildes;
      struct stat buf;
!     static char *olddata = 0;
!     char *data;
  
      if (filename != LastArticle) {
  	LastArticle = filename;
--- 2912,2919 ----
      Arg args[5];
      int fildes;
      struct stat buf;
!     char *olddata;
!     char *data = 0;
  
      if (filename != LastArticle) {
  	LastArticle = filename;
***************
*** 2939,2961 ****
  		XawTextSetSource(ArticleText, ArtSource, (XawTextPosition) 0);
  		XawTextSetSelectionArray(ArticleText, allSelectArray);
  	    } else {
- #ifdef notdef
  		XtVaGetValues(ArtSource,
  			      XtNstring, &olddata,
  			      NULL);
! #endif /* notdef */
! 		if (olddata) XtFree(olddata);
  		XtSetValues(ArtSource, args, XtNumber(args));
  	    }
  #else
  	    /* destroy the old text file window */
  	    if (ArtSource != 0) {
- #ifdef notdef
  		XtVaGetValues(ArtSource,
  			      XtNstring, &olddata,
  			      NULL);
! #endif /* notdef */
! 		if (olddata) XtFree(olddata);
  		XtDestroyWidget(ArtSource);
  	    }
  
--- 2939,2957 ----
  		XawTextSetSource(ArticleText, ArtSource, (XawTextPosition) 0);
  		XawTextSetSelectionArray(ArticleText, allSelectArray);
  	    } else {
  		XtVaGetValues(ArtSource,
  			      XtNstring, &olddata,
  			      NULL);
! 		XtFree(olddata);
  		XtSetValues(ArtSource, args, XtNumber(args));
  	    }
  #else
  	    /* destroy the old text file window */
  	    if (ArtSource != 0) {
  		XtVaGetValues(ArtSource,
  			      XtNstring, &olddata,
  			      NULL);
! 		XtFree(olddata);
  		XtDestroyWidget(ArtSource);
  	    }
  
***************
*** 2981,2987 ****
  	prefetchNextArticle();
  	
  #endif /* XRN_PREFETCH */
- 	olddata = data;
      }
      return;
  }
--- 2977,2982 ----
*** /tmp/,RCSt1001914	Tue Oct 22 16:11:04 1991
--- server.c	Tue Oct 22 15:54:36 1991
***************
*** 973,987 ****
  sendLine(str)
  char *str;
  {
-     int i;
- 
      if (*str == '.') {
! 	for (i = utStrlen(str); i >= 0; i--) {
! 	    str[i+1] = str[i];
! 	}
! 	str[0] = '.';
      }
!     put_server(str);
      return;
  }
  #endif
--- 973,990 ----
  sendLine(str)
  char *str;
  {
      if (*str == '.') {
! 	char *str2 = XtMalloc(utStrlen(str) + 2); /* one for the extra period,
! 						   * and one for the null at
! 						   * the end */
! 	str2[0] = '.';
! 	strcpy(str2 + 1, str);
! 	put_server(str2);
! 	XtFree(str2);
      }
!     else {
! 	put_server(str);
!     }
      return;
  }
  #endif

-- 
Jonathan Kamens						jik@MIT.Edu
MIT Information Systems/Athena		    Moderator, news.answers
	      (Send news.answers-related correspondence
		  to news-answers-request@MIT.Edu.)
Technical Details
Message-ID: <1991Nov5.024821.11471@athena.mit.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!zeus.ieee.org!europa.asd.contel.com!uunet!wupost!micro-heart-of-gold.mit.edu!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!jik
References: <schwager.688325271@mike.cs.uiuc.edu> <1991Oct30.185507.20043@objy.com> <sherman.689246642@foster>

Show Full Headers
Complete Article Headers
Message-ID: <1991Nov5.024821.11471@athena.mit.edu>
Subject: patch for xrn 6.17beta coredumps (Re: XRN exits with Caught signal 11, Sun 4, OS 4.1.1)
Date: Tue, 05 Nov 1991 02:48:21 +0000
From: jik@athena.mit.edu (Jonathan I. Kamens)
References: <schwager.688325271@mike.cs.uiuc.edu> <1991Oct30.185507.20043@objy.com> <sherman.689246642@foster>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmdzi!zeus.ieee.org!europa.asd.contel.com!uunet!wupost!micro-heart-of-gold.mit.edu!bloom-beacon!bloom-picayune.mit.edu!athena.mit.edu!jik
Newsgroups: news.software.readers
Keywords: xrn
Sender: news@athena.mit.edu (News system)
Organization: Massachusetts Institute of Technology
Lines: 128
Nntp-Posting-Host: pit-manager.mit.edu