🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40539

Re: Diablo debugging problems...

#40539
From: Kjetil Torgrim Homme
Date: Tue, 05 Oct 1999 00:00
57 lines
2876 bytes
[Brad Knowles]

>       Well, remember that I'm running the PIPE patches, and the
>   point was made to me that I should make the same changes to them
>   as I did for diab-filter.c.

The PIPE-patch was intended to handle the return value from write/read
correctly, and will probably break if you substitute all write()s for
xwrite().

I see now that this is not the case in flushPipedFeeds(), but since it
is only called when shutting down Diablo, it shouldn't be the source
of your problem.  This one, in util/dnewslink.c, is more likely:

#ifdef PIPE
        } else {
          if (PipeOpt)
            /* Notify parent diablo process that we have read this line */
            write (2, &n, sizeof(n));    
#endif

It is possible that this fails due to interrupted system calls,
resulting in 0 bytes written and communication out of whack.  Geez,
this may be the cause of some problem reports from a FreeBSD user
which tried our code.  (We run Solaris, but it's probably just luck
that it hasn't hit us.)

The attached patch has been running satisfactorily for 15 seconds.


Kjetil T.

--- util/dnewslink.c.orig       Tue Oct  5 22:39:24 1999
+++ util/dnewslink.c    Tue Oct  5 22:46:32 1999
@@ -2208,9 +2208,18 @@
            }
 #ifdef PIPE
         } else {
-          if (PipeOpt)
+          if (PipeOpt) {
+           int ret, offset = 0;
             /* Notify parent diablo process that we have read this line */
-           write (2, &n, sizeof(n));
+            do {
+             ret = write (2, (char *) &n + offset , sizeof(n) - offset);
+             if (ret == -1 && errno != EAGAIN) {
+               dl_logit("write failed: %s\n", strerror(errno));
+               exit (1);
+             }
+             offset += ret;
+           } while (offset != sizeof(n));
+         }
 #endif
        }
        rbs->rb_Len += n;

Technical Details
Message-ID: <1rln9h5xrc.fsf@haey.ifi.uio.no>
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> <brad-0510991317560001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com> <brad-0510992046060001@brad.techos.skynet.be>

Show Full Headers
Complete Article Headers
Message-ID: <1rln9h5xrc.fsf@haey.ifi.uio.no>
Subject: Re: Diablo debugging problems...
Date: Tue, 05 Oct 1999 00:00:00 +0000
From: Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no>
References: <brad-0110991517500001@brad.techos.skynet.be> <brad-0510991317560001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com> <brad-0510992046060001@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: 533225440
X-Complaints-To: usenet@maud.ifi.uio.no
X-Trace: maud.ifi.uio.no 939157208 22125 129.240.64.139 (5 Oct 1999 21:00:08 GMT)
Organization: Dept. of Informatics, University of Oslo, Norway
NNTP-Posting-Date: 5 Oct 1999 21:00:08 GMT
Newsgroups: news.software.nntp