9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: forsyth@plan9.cs.york.ac.uk forsyth@plan9.cs.york.ac.uk
Subject: bug in aux/listen
Date: Wed, 12 Jun 1996 08:53:05 -0400	[thread overview]
Message-ID: <19960612125305.mABiTBZ_VeCIGFnrW28A_bkbMilsRq7QSpbiUhem_fk@z> (raw)

aux/listen does an rfork sharing memory to create the listener for
each service.  that also ensures that
	Subsequent forks by the parent will then
	propagate the shared data and bss between children.
	[rfork(2)]
aux/listen later forks a process to handle each incoming call.
that doesn't specify RFMEM, but is still sharing memory.
perhaps that was expected, but in any case, the later becomenone()
calls newns, which uses bio to read /lib/namespace, and malloc
is called, but the libc.h version doesn't expect to share memory;
mayhem ensues. there are safe versions of malloc (for instance in /sys/src/cmd/ndb), or
one could rewrite listen in Alef, but for now it seems easier just
to be a bit less efficient.  listen doesn't seem to rely on sharing memory.

forse% diff $home/cd/cmd/aux/listen.c /sys/src/cmd/aux/listen.c
100c100
< 		switch(rfork(RFFDG|RFPROC|RFMEM)){
---
> 		switch(rfork(RFFDG|RFPROC)){ /* had RFMEM */






                 reply	other threads:[~1996-06-12 12:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19960612125305.mABiTBZ_VeCIGFnrW28A_bkbMilsRq7QSpbiUhem_fk@z \
    --to=forsyth@plan9.cs.york.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).