[comp.sources.bugs] RN crash

chen@digital.sps.MOT.COM (Jinfu Chen) (12/19/89)

I don't know where to send bug report of rn and I believe this bug
was reported a few months ago already in this group but failed to
show up in patches:

Version: 4.3, patchlevel 40
Output of 'v' in rn: @(#)$Header: rn.c,v 4.3.1.4 85/09/10 11:05:13 lwall Exp $

Description: When news article files have file mode 775, the program crashed with
			 an IOT trap when moving to news group mode:

panda<63 chen>% rn (and hit 'y' to enter a group)
IOT trap
panda<64 chen>% tb -l       ( Apollo's adb equivalent, sort-off )
Process        2338 (parent 1357, group 2338)
Time           89/12/18.17:04(MST)
Program        //node_9f51/usr/local/bin/rn
Status         09010006: IOT instruction fault (UNIX/signal)
In routine     "kill" line 84
Called from    "abort" line 47
Called from    "finalize" line 65
Called from    "pfm_$fault" line 2309
Called from    diagnostic frame (00120011) access violation (OS/fault handler)
Called from    "_doprnt" line 227
Called from    "printf" line 53
Called from    "do_newsgroup" line 405
Called from    "main" line 473
Called from    "unix_$main" line 114
Called from    "_start" line 51
Called from    "PM_$CALL" line 176
Called from    "pgm_$load_run" line 891
Called from    "pgm_$invoke_uid_pn" line 1112

Cause: The order of evaluation in art.c line 107 is wrong ( '!=' has high
	   priority than '&' )

Fix: Add parentthesis around the bitwise pair before comparing:

*** art.c	Mon Dec 18 17:14:27 1989
--- art.c.orig	Mon Dec 18 17:14:04 1989
***************
*** 104,110 ****
      if (fstat(artfp->_file,&filestat))
  			    /* get article file stats */
  	return DA_CLEAN;
!     if ((filestat.st_mode & S_IFMT) != S_IFREG)
  	return DA_NORM;
      artsize = filestat.st_size;
  			    /* from that get article size */
--- 104,110 ----
      if (fstat(artfp->_file,&filestat))
  			    /* get article file stats */
  	return DA_CLEAN;
!     if (filestat.st_mode & S_IFMT != S_IFREG)
  	return DA_NORM;
      artsize = filestat.st_size;
  			    /* from that get article size */

-- 
Jinfu Chen                  (602)898-5338      |       Disclaimer:
Motorola, Inc.  Logic IC Div., Mesa, AZ        | 
...{somewhere}!uunet!dover!digital!chen        | My employer doesn't pay
chen@digital.sps.mot.com                       | me to express opinions.
----------

weening@Gang-of-Four.Stanford.EDU (Joe Weening) (12/23/89)

In the current version of rn (patchlevel 44), this has been fixed.
Patches 41 to 44 of rn were posted to news.software.b recently.
--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

jpn@genrad.com (John P. Nelson) (12/28/89)

>In the current version of rn (patchlevel 44), this has been fixed.
>Patches 41 to 44 of rn were posted to news.software.b recently.

Oh, damn.  I don't follow that newsgroup.  Could some kind person please
REPOST the patches to comp.sources.bugs (where they belonged in the first
place!?!)

     john nelson

UUCP:	{decvax,mit-eddie}!genrad!jpn
smail:	jpn@genrad.com

andrew@ramona.Cary.NC.US (Andrew Ernest) (12/29/89)

I just consulted Larry Wall's mail-based patch server and it said the
following:

	Subject: rn version 4.3 patch #41
	
	[The latest patch for rn version 4.3 is #40.]
	
	mailpatch speaking for lwall

I don't receive the news.software.b news group (long distance news
feed blues).  Were patches 41-44 official?  Are they not available via
mailpatch yet?
-- 
Andrew Ernest (andrew@ramona.Cary.NC.US or ramona!andrew@mcnc.org)