🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21040

Re: nnrpd + mmap + large active = seg fault

#21040
From: Mark Hittinger
Date: Thu, 28 Aug 1997 00:00
23 lines
1238 bytes
steve@clara.net (Steve Rawlinson) writes:

>    /* Count lines. */
>    for (p = active, i = 0; (p = strchr(p, '\n')) != NULL; p++, i++)
>        continue;

>as it gets to towards the end of the file.
>Shrinking the active file a bit or using nnrpd without the mmap patch
>solves the problem.

I bet when the active file ends exactly on a page boundary you seg fault
when you go over the edge of the mmap.  We'd need an active file length
double check here instead of just touching the location p (which won't
exist in that case).

Regards,

Mark Hittinger
Netcom/Dallas
bugs@freebsd.netcom.com

Technical Details
Message-ID: <5u4mmc$aqc@dfw-ixnews1.ix.netcom.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: <3405a544.2088096267@news.clara.net>

Show Full Headers
Complete Article Headers
Message-ID: <5u4mmc$aqc@dfw-ixnews1.ix.netcom.com>
Subject: Re: nnrpd + mmap + large active = seg fault
Date: Thu, 28 Aug 1997 00:00:00 +0000
From: bugs@freebsd.netcom.com (Mark Hittinger)
References: <3405a544.2088096267@news.clara.net>
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: 268829504
Organization: Netcom
X-NETCOM-Date: Thu Aug 28 3:22:39 PM CDT 1997
Newsgroups: news.software.nntp,comp.os.bsdi.misc