🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40361

Re: Diablo debugging problems...

#40361
From: Joe Greco
Date: Fri, 01 Oct 1999 00:00
164 lines
6255 bytes
In news.software.nntp article <brad-0110991517500001@brad.techos.skynet.be>, brad@shub-internet.org (Brad Knowles) wrote:
:Folks,
:
:    I'm trying to use the Diablo "pipe" patch that Lars mentioned a couple
:of days ago, and I'm having some problems.  Specifically, filtering is
:occasionally dying unexpectedly.  I get error messages such as this in
:news.err:
:
:Oct  1 14:29:22 <news.err> seymour diablo[1268]: filter write failure:
:wanted to write 450523, wrote 393216: Undefined error: 0
:Oct  1 14:29:22 <news.err> seymour diablo[1268]: diab-filter: filter
:failed, write, sleeping for 4 seconds 
:Oct  1 14:29:22 <news.err> seymour diablo[1268]: filter exited on signal 91
:Oct  1 14:33:02 <news.err> seymour diablo[1268]: filter write failure:
:wanted to write 497437, wrote 393216: Undefined error: 0
:Oct  1 14:33:02 <news.err> seymour diablo[1268]: diab-filter: filter
:failed, write, sleeping for 9 seconds 
:Oct  1 14:33:02 <news.err> seymour diablo[1268]: filter exited on signal 29
:Oct  1 14:53:59 <news.err> seymour diablo[1268]: filter write failure:
:wanted to write 1004816, wrote 786432: Undefined error: 0
:Oct  1 14:53:59 <news.err> seymour diablo[1268]: diab-filter: filter
:failed, write, sleeping for 4 seconds 
:Oct  1 14:53:59 <news.err> seymour diablo[1268]: filter exited on signal 16
:
:    Now, I decided I'd take a look at what's going on with the daemon
:using truss, and relative to these errors, I see the following:
:
:syscall open("/news/spool/news/D.00eebe84/B.6c8b",0,00)
:        returns 6 (0x6)
:syscall lseek(6,0x449d7,0)
:        returns 281047 (0x449d7)
:syscall read(0x6,0x8138000,0x6c3e5)
:        returns 443365 (0x6c3e5)
:SIGNAL 20
:SIGNAL 20
:SIGNAL 20
:syscall write(164,0x8238000,450523)
:        returns 393216 (0x60000)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 1747 (0x6d3)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 0 (0x0)
:syscall sigreturn(0xbfbfd92c)
:        returns 393216 (0x60000)
:syscall gettimeofday(0xbfbfcd04,0x0)
:        returns 0 (0x0)
:syscall getpid()
:        returns 1268 (0x4f4)
:syscall sendto(0x3,0xbfbfd164,0x70,0x0,0x0,0x0)
:        returns 112 (0x70)
:
:    [ ... deletia ... ]
:
:syscall open("/news/spool/news/D.00eebe8e/B.2892",0,00)
:        returns 6 (0x6)
:syscall lseek(6,0x29858,0)
:        returns 170072 (0x29858)
:syscall read(0x6,0x8138000,0x77e1e)
:        returns 491038 (0x77e1e)
:SIGNAL 20
:SIGNAL 20
:SIGNAL 20
:syscall write(164,0x8238000,497437)
:        returns 393216 (0x60000)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 1793 (0x701)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 0 (0x0)
:syscall sigreturn(0xbfbfd92c)
:        returns 393216 (0x60000)
:syscall gettimeofday(0xbfbfcd04,0x0)
:        returns 0 (0x0)
:syscall getpid()
:        returns 1268 (0x4f4)
:syscall sendto(0x3,0xbfbfd164,0x70,0x0,0x0,0x0)
:        returns 112 (0x70)
:
:    [ ... deletia ... ]
:
:syscall open("/news/spool/news/D.00eebea2/B.2892",0,00)
:        returns 6 (0x6)
:syscall lseek(6,0x2d4f7a,0)
:        returns 2969466 (0x2d4f7a)
:syscall read(0x6,0x8138000,0xf16b3)
:        returns 988851 (0xf16b3)
:SIGNAL 20
:SIGNAL 20
:SIGNAL 20
:syscall write(174,0x8238000,1004816)
:        returns 786432 (0xc0000)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 2439 (0x987)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 2420 (0x974)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 1366 (0x556)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 1358 (0x54e)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 1357 (0x54d)
:syscall wait4(0xffffffff,0x0,0x1,0x0)
:        returns 0 (0x0)
:syscall sigreturn(0xbfbfd92c)
:        returns 786432 (0xc0000)
:syscall gettimeofday(0xbfbfcd04,0x0)
:        returns 0 (0x0)
:syscall getpid()
:        returns 1268 (0x4f4)
:syscall sendto(0x3,0xbfbfd164,0x71,0x0,0x0,0x0)
:        returns 113 (0x71)
:
:
:
:    Unfortunately, I'm totally at a loss to figure out what's going
:wrong.  The patch doesn't touch filter/diab-filter.c, nor does it touch
:anything else in filter/.
:
:    Anyone have any ideas of what I should do next to try and debug this
:problem?

Well, is your filter process _actually_ exiting, or not?  If so, what's 
causing it to do so? (*)

My "take" on this, is that somehow the pipe to the filter is getting
switched to non-blocking mode.  If this is so, you could do something
like nice 19 your filter process and the problem should happen fairly
quickly if you load down the box, even for smaller articles.

It could probably be fixed by wrapping write with a function that
requires all bytes to be written, although typically I don't recall
pipes having this sort of behaviour.

Try changing the write calls to "xwrite", and insert this at the top
of diab-filter.c.

int xwrite(fd, buf, siz)
int fd;
char *buf;
int siz;
{
	register int rval, chrs = 0;

	while (siz) {
		if ((rval = write(fd, buf, siz)) < 0) {
			return(rval);
		}
		chrs += rval;
		siz -= rval;
		buf += rval;
	}
	return(chrs);
}

If that works, I'll be irritated.

And since this snippet is written off the top of my head, it'll be wrong
and I'll have posted the embarrassing evidence of my incompetence as a C
programmer.  :-)  So I'll be irritated twice.

* I'm guessing that it's simply going away because diab-filter kills it.

... JG

Technical Details
Message-ID: <37f4e0b3$0$10188@news.execpc.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <brad-0110991517500001@brad.techos.skynet.be>

Show Full Headers
Complete Article Headers
Message-ID: <37f4e0b3$0$10188@news.execpc.com>
Subject: Re: Diablo debugging problems...
Date: Fri, 01 Oct 1999 00:00:00 +0000
From: jgreco@ns.sol.net (Joe Greco)
References: <brad-0110991517500001@brad.techos.skynet.be>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 531598536
Sender: jgreco@earth.execpc.com
X-Trace: S=T[4Gb?NPaI5[332>a9YkbfNiaEHUgJgRYcgIRLSUEm?ao0OAAQd5onB09n@7IYWd]d4H87I=[?bGhaMU<hZ^NgF4FfQ?Mh6Um
Organization: sol.net Network Services - Milwaukee, WI
Newsgroups: news.software.nntp
X-Complaints-To: abuse@execpc.com