linux-um archives
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: Haifeng He <hehaifeng@gmail.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Strange segmentation fault
Date: Fri, 13 Apr 2007 13:59:01 -0400	[thread overview]
Message-ID: <20070413175901.GB10624@c2.user-mode-linux.org> (raw)
In-Reply-To: <3aab51dc0704130931q782ce158r134c6b73d4945625@mail.gmail.com>

On Fri, Apr 13, 2007 at 09:31:16AM -0700, Haifeng He wrote:
> Yes. So that is the problem. Is there any other place which may cause
> similar problems?

If you're going to be sprinking code randomly around UML, you need to
be cognizant of what stack the surrounding code runs on.

You hit code which is setting up a new process, and is running on a
non-kernel stack in the context of the new process.

init_thread_cb runs on the initial UML process stack.

The stubs run on a stack in the upper two pages of the process address
space.

These bits of code can't run kernel code, since they aren't on a
kernel stack, and current() et al won't be valid.

Pretty much everything else is on a kernel stack, and what you're
doing should be fine.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

      reply	other threads:[~2007-04-13 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13  5:14 [uml-devel] Strange segmentation fault Haifeng He
2007-04-13 13:54 ` Jeff Dike
2007-04-13 16:31   ` Haifeng He
2007-04-13 17:59     ` Jeff Dike [this message]

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=20070413175901.GB10624@c2.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=hehaifeng@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.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