9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: ron minnich <rminnich@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] Fwd: plan9 go output faults on 9vx with rfork
Date: Tue, 18 Jan 2011 18:37:55 -0800	[thread overview]
Message-ID: <AANLkTik4ObFY++zSX3g3O9VDeWhoWtbV1P-B330_igfk@mail.gmail.com> (raw)
In-Reply-To: <AANLkTiky+x0gBcr84_p0Mf9HKqGVoTFcyNrdofEMS9_a@mail.gmail.com>

Pavel built a reproducer and sent it to me:


---------- Forwarded message ----------
From: Pavel Zholkover <paulzhol@gmail.com>
Date: Mon, Jan 17, 2011 at 12:24 PM
Subject: Re: plan9 go output faults on 9vx with rfork
To: ron minnich <rminnich@gmail.com>


Hi Ron!

I think I've traced the cause of the crash. It is unfortunately the
syscall semacquire.
The following C program will crash vanilla 0.12 9vx and the one I
compiled from your branch:

#include <u.h>
#include <libc.h>

static long l=1;

void main(int argc, char *argv[]) {
       int i;

       semacquire(&l, 1);

       for(i=0; i < 999999; i++)
               ;

       semrelease(&l, 1);
       exits(nil);
}

---

Got peace and quite and a bulkhead seat to PHX, so had time to look.

The problem was that cmpswap was never set to anything in 9vx, so the
first time canacquire was used, well,
kaboom, since canacquire was NULL.

Changes can be seen here:
https://bitbucket.org/rminnich/vx32/changeset/c7ba21bd847c

My fix is in 9vx/main.c to do this:
	cmpswap = oscmpswap;

What's oscmpswap? Well, for darwin, it is defined in 9vx/os/cmpswap.c

You can see the rest of the changes; you can also see that this won't
build on Linux until we fix it; left as an exercise for the reader, or
until I get back home and fix it.

The reproducer no longer crashes 9vx. Now, the question is, what's
next to make Go work on 9vx?

ron



       reply	other threads:[~2011-01-19  2:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTinx9AiBN4=7knPEK8sKuuCUe+mhhNaP-yZzqVSS@mail.gmail.com>
     [not found] ` <AANLkTikf4cgk7hab5rLLFWyv-c-0XU6WPJW0Ahm4JehM@mail.gmail.com>
     [not found]   ` <AANLkTi=PdAFFDw=ps6DcR38xno_mNb8eGZRJGxL0VpQC@mail.gmail.com>
     [not found]     ` <AANLkTinDengSNpD6pEg_cF6xivxc3qU3=tQFW7Wyo769@mail.gmail.com>
     [not found]       ` <AANLkTiky+x0gBcr84_p0Mf9HKqGVoTFcyNrdofEMS9_a@mail.gmail.com>
2011-01-19  2:37         ` ron minnich [this message]
     [not found] <AANLkTikJ3y5exFtTic+8dhUsUqeZBDmR=S-8VzKDK0GH@mail.gmail.com>
     [not found] ` <AANLkTink4CrELJfGf3W15caSYX8Se5ygsm_WeMRdCBz=@mail.gmail.com>
     [not found]   ` <AANLkTikUa1KF+8NP54BHicus++YbeZbD48E7z=1H0Y5V@mail.gmail.com>
2011-01-19 15:52     ` ron minnich

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=AANLkTik4ObFY++zSX3g3O9VDeWhoWtbV1P-B330_igfk@mail.gmail.com \
    --to=rminnich@gmail.com \
    --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).