All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seebach <peter.seebach@windriver.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: yocto@yoctoproject.org
Subject: Re: pseudo interaction issue
Date: Fri, 23 Mar 2012 17:45:06 -0500	[thread overview]
Message-ID: <20120323174506.5634af61@wrlaptop> (raw)
In-Reply-To: <1537192.Q99X1xdoal@helios>

On Fri, 23 Mar 2012 12:20:08 +0000
Paul Eggleton <paul.eggleton@linux.intel.com> wrote:

> On Friday 23 March 2012 02:16:35 Peter Seebach wrote:
> > Still really weird to me that I can't reproduce this outside of hob.
> > I am pretty sure there exists a series of forks and execs and
> > environment changes such that this will end up happening.
> 
> I now have a fairly simple test case outside of hob. Put the attached
> file in meta/classes/ and then add the following to your local.conf:
> 
> INHERIT += "breakit"

Okay, some notes.

The magic seems to come from the interpolated Python output that itself
calls os.popen from inside the shell script.

A bit of poking about turns up the following:

1.  The environment setup and teardown in runqueue.py don't seem to be
atomic at all, such that if I annotate the stashing in envbackup with a
bb.note for each variable stashed, I sometimes see a fork() call in
pseudo BETWEEN two variables.  Which is to say, we can be forking WHILE
changing the environment.
2.  The func_exec_shell calls seem to be able to call the git_branch
stuff (which uses os.popen()) in a way that does not hit the runqueue
code AT ALL.  Meaning it operates with Whatever Environment Seems Handy.
3.  I am inclined to suggest that a first pass would be to distinguish
between "we need to set this, but we never need to unset
it" (PSEUDO_PREFIX) and "we need to set this and then revert
it" (PSEUDO_UNLOAD).
4.  We should have a handler for popen() anyway, but it will not in and
of itself fix the problem.

I am still getting the hang of finding my way around bitbake and
figuring out who's calling what.  I'd guess that just making sure
PSEUDO_PREFIX never gets unset would effectively mitigate the problem,
but I suspect that we'll still be vulnerable to Weird Race Conditions.

-s
-- 
Listen, get this.  Nobody with a good compiler needs to be justified.


  parent reply	other threads:[~2012-03-23 22:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-17 17:35 pseudo interaction issue Paul Eggleton
2012-02-17 18:50 ` Mark Hatle
2012-03-14  9:02   ` Xu, Dongxiao
2012-03-22  1:49     ` Xu, Dongxiao
2012-03-22 16:18       ` Peter Seebach
2012-03-23  1:01         ` Xu, Dongxiao
2012-03-23  2:29           ` Peter Seebach
2012-03-23  3:21             ` Xu, Dongxiao
2012-03-23  7:16               ` Peter Seebach
2012-03-23 12:20                 ` Paul Eggleton
2012-03-23 20:06                   ` Peter Seebach
2012-03-23 22:45                   ` Peter Seebach [this message]
2012-03-24 17:15                     ` Richard Purdie
2012-03-24 17:41                       ` Richard Purdie
2012-03-26 16:44                         ` Peter Seebach
2012-03-26 16:47                           ` Richard Purdie
2012-03-26 17:18                             ` Peter Seebach
2012-03-26 21:45                               ` Richard Purdie
2012-03-27  3:47                                 ` Peter Seebach
2012-03-27 14:26                                 ` Peter Seebach
2012-03-26  7:43                       ` Peter Seebach
2012-03-26  9:23                         ` Richard Purdie
2012-03-26 20:36                       ` Peter Seebach
2012-03-26 20:41                       ` Peter Seebach

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=20120323174506.5634af61@wrlaptop \
    --to=peter.seebach@windriver.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.