*BSD News Article 69363


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!inferno.mpx.com.au!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!usenet.ins.cwru.edu!agate!howland.reston.ans.net!vixen.cso.uiuc.edu!newsfeed.internetmci.com!panix!not-for-mail
From: tls@panix.com (Thor Lancelot Simon)
Newsgroups: comp.unix.bsd.misc
Subject: Re: Why does this program panic 4.4BSD?
Date: 24 May 1996 22:30:44 -0400
Organization: Panix
Lines: 26
Message-ID: <4o5rck$etb@panix2.panix.com>
References: <4o2kn3$21u@panix2.panix.com> <4o4eu1$mr6@innocence.interface-business.de>
Reply-To: tls@rek.tjls.com
NNTP-Posting-Host: panix2.panix.com

In article <4o4eu1$mr6@innocence.interface-business.de>,
J Wunsch <joerg_wunsch@interface-business.de> wrote:
>tls@panix.com (Thor Lancelot Simon) wrote:
>
>> The following code appears to quite reliably panic every 4.4 derivative I've
>> run it on, when run by an ordinary, unprivileged user.
>
>Your code wasn't compilable on my FreeBSD system (several header files
>are also required when _not_ using SunOS -- i wonder how you got it to
>find O_RDONLY on your other 4.4BSD derivatives?), but the following
>works fine for me:

It doesn't need O_RDONLY unless it's using mmap to allocate the memory; I did
that because some versions of SunOS I wanted to test on didn't seem to be able
to reliably mlock() memory allocated with malloc().

I didn't test it using mmap for memory allocation under any 4.4 variant.  Does
FreeBSD define "sun" in its C preprocessor, on the i386?!

What happens if you allocate the memory with malloc()?  That's what blew up
NetBSD, BSDI, and OpenBSD.

-- 
Thor Lancelot Simon	                                          tls@panix.COM
"Gee, if your knee jerks any harder you're going to kick yourself in the head."
                                                          -- Barry Sherman