[Bug 1279620] Re: stack corruption running "go install launchpad.net/juju-core/..."

Bug Watch Updater 1279620 at bugs.launchpad.net
Wed Feb 26 04:38:40 UTC 2014


Launchpad has imported 1 comments from the remote bug at
http://sourceware.org/bugzilla/show_bug.cgi?id=16629.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2014-02-24T03:09:25+00:00 Michael Hudson-Doyle wrote:

Created attachment 7435
adapted from example in http://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html

I'm attaching a simple demo program for makecontext/swapcontext that I
found somewhere with the addition of code to print the alternate signal
stack before and after calling swapcontext.  On aarch64 it prints this:

start f2
start f1
finish f2
finish f1
{ss_sp: (nil), ss_flags: 2, ss_size: 0}
{ss_sp: 0x7ffbe931f8, ss_flags: 0, ss_size: 8192}

It turns out that because setcontext is implemented in terms of the
rt_sigreturn syscall it ends up copying the uc_stack data from the
passed context into the (kernel) task's sigaltstack parameters.
Hilarity ensues.  Specifically it means that programs linked against the
gccgo runtime sometimes handle signals with SP pointing at memory that
another thread is using for its stack, with predictably bad results.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1279620/comments/5


** Changed in: eglibc
       Status: Unknown => Confirmed

** Changed in: eglibc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1279620

Title:
  stack corruption running "go install launchpad.net/juju-core/..."

Status in Embedded GLIBC:
  Confirmed
Status in “eglibc” package in Ubuntu:
  Confirmed
Status in “eglibc” source package in Trusty:
  Confirmed

Bug description:
  This is the sort of bug I was hoping we were going to escape in this
  porting effort :(

  It's not frequent, but maybe 10% of the time go install launchpad.net
  /juju-core/... will fail with some kind of memory error. It's not
  exactly the same error every time, but it's consistent with something
  scribbling on the stack.  It doesn't seem to happen if you run pass -p
  1 to install, which limits the parallelism inside the install command,
  so it's probably some kind of race.  Yay!

To manage notifications about this bug go to:
https://bugs.launchpad.net/eglibc/+bug/1279620/+subscriptions



More information about the foundations-bugs mailing list