9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Giacomo Tesio <giacomo@tesio.it>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Privalloc(2) and rfork(RFPROC|RFMEM) (was: a pair nec bugs)
Date: Sun,  6 Sep 2015 01:03:38 +0200	[thread overview]
Message-ID: <CAHL7psH78FA_APWfZjTkEbxp0BCqLChwED7xgtUVu48WZ54SJw@mail.gmail.com> (raw)
In-Reply-To: <8b5a65de5cd93ec6242b885530caf86f@brasstown.quanstro.net>

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

2015-09-05 20:47 GMT+02:00 erik quanstrom <quanstro@quanstro.net>:

> > May be my problem is that p is global in my case?
>
> global variables are in the bss, and thus shared. p will have
> the same value in each thread, but *p should point into the
> stack, and thus the same virtual address will be mapped to
> different physical pages of memory.
>
> however, if *p is assigned to a non-zero value before the process
> is created, the new page allocated for the new process' stack will
> have a copy of the old value, and thus not be 0.
>
> - erik
>
>
That's exactly what happened.
I misread privalloc(2), and assumed that privalloc()ed addresses were
somehow reset on rfork.
This is probably something to explicitly state the man page.

Thanks you all!


Giacomo

[-- Attachment #2: Type: text/html, Size: 1354 bytes --]

  reply	other threads:[~2015-09-05 23:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-05 14:03 Giacomo Tesio
2015-09-05 14:11 ` Giacomo Tesio
2015-09-05 15:27 ` erik quanstrom
2015-09-05 16:41   ` erik quanstrom
2015-09-05 18:42     ` Giacomo Tesio
2015-09-05 18:47       ` erik quanstrom
2015-09-05 23:03         ` Giacomo Tesio [this message]
2015-09-05 18:56       ` cinap_lenrek
2015-09-05 22:45 ` Charles Forsyth
2015-09-05 23:38   ` cinap_lenrek
2015-09-06 13:14     ` erik quanstrom
2015-09-06 14:12     ` Charles Forsyth
2015-09-06 15:02       ` erik quanstrom
2015-09-06 20:21         ` Charles Forsyth
2015-09-07  0:30           ` erik quanstrom
2015-09-07  9:38             ` Charles Forsyth
2015-09-07 11:59               ` Charles Forsyth
2015-09-06 18:21       ` cinap_lenrek
2015-09-06 20:27         ` Charles Forsyth

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=CAHL7psH78FA_APWfZjTkEbxp0BCqLChwED7xgtUVu48WZ54SJw@mail.gmail.com \
    --to=giacomo@tesio.it \
    --cc=9fans@9fans.net \
    /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).