9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] stats(1) suicide
Date: Thu, 7 Aug 2014 13:56:47 +0200	[thread overview]
Message-ID: <b370d35e690e4ec0db1c9bcd89adab0e@felloff.net> (raw)
In-Reply-To: <44fe6f6965c52b3475c55ac98002217a@x301.inri>

thanks! i know whats wrong.

network timeout (alarm note) is the trigger. the bug was introduced in:

http://code.google.com/p/plan9front/source/detail?r=a2985da84dc3e147251c75c5839d1d074b1e7506&path=/sys/src/9/pc64/l.s

the problem is that forkret() in l.s doesnt restore BP register from
the ureg (anymore!). the first argument to a function is passed in BP
(also known as RARG). as its not loaded from the ureg, the first argument
to the note handler is garbage. which causes the crash. most note handlers
ignore the ureg argument (so it works all fine with other programs), but
not with this alarm note handler which tries todo a stack unwind with the
note jump.

i'm at work and have no access to amd64 machine right now so i cant
test anything, but you can probably fix it with a single line in
pc64/trap.c, function syscall():


        if(scallnr!=RFORK && (up->procctl || up->nnote)){
                splhi();
                notify(ureg);
+				((void**)&ureg)[-1] = (void*)noteret;	/* restores BP */
        }

--
cinap


  reply	other threads:[~2014-08-07 11:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07  2:51 sl
2014-08-07 11:56 ` cinap_lenrek [this message]
2014-08-08  7:45   ` [9front] " arisawa
2014-08-08 16:01     ` sl
2014-08-08 21:30       ` arisawa
2014-08-08 21:44         ` sl
2014-08-08 22:35           ` arisawa
2014-08-08 22:57             ` cinap_lenrek
2014-08-09  6:05               ` arisawa
2014-08-09 15:42                 ` cinap_lenrek
2014-08-09 22:46                   ` arisawa

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=b370d35e690e4ec0db1c9bcd89adab0e@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /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).