Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: random fatal errors on iOS #14070

Closed
mikioh opened this issue Jan 22, 2016 · 6 comments
Closed

runtime: random fatal errors on iOS #14070

mikioh opened this issue Jan 22, 2016 · 6 comments

Comments

@mikioh
Copy link
Contributor

mikioh commented Jan 22, 2016

/cc @ianlancetaylor

According to the dashboard, the build started to fail with signal failures with a7cad52.

Before (mostly timeouts): http://build.golang.org/log/a04d0ed55471343ddd7dec8bb8ef9459cc02588e
After (signal failures): http://build.golang.org/log/32a73620035a8c1101d15bcbbdce2cdce640d70f

@mikioh mikioh added this to the Go1.6Maybe milestone Jan 22, 2016
@mikioh
Copy link
Contributor Author

mikioh commented Jan 22, 2016

We can observe typically:

  • fatal error: runtime: stack split at bad time on log/syslog test
  • fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0x0 pc=0x4066590] on net test
  • fatal error: runtime: stack split at bad time on net/http test
  • fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0x0 pc=0x4064204] on os/signal test
  • fatal error: runtime: stack split at bad time on time test

@mikioh mikioh changed the title runtime: fatal error: unexpected signal during runtime execution on iOS runtime: random fatal errors on iOS Jan 22, 2016
@ianlancetaylor
Copy link
Contributor

Those errors do look similar to the ones we saw on NetBSD and DragonFly.

@crawshaw Is it possible for you to run this C program on Darwin/ARM, to see how signal stacks are handled for newly created threads?

#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>

static void
die (const char *s)
{
  perror (s);
  exit (EXIT_FAILURE);
}

static void
printsigstack (const char *prefix)
{
  stack_t ss;

  if (sigaltstack (NULL, &ss) < 0)
die ("sigaltstack get");
  printf ("%s %p 0x%lx 0x%x\n", prefix, ss.ss_sp, (unsigned long) ss.ss_size,
      (unsigned int) ss.ss_flags);
}

static void *
thread (void *arg)
{
  stack_t ss;

  printsigstack ("thread");
  ss.ss_sp = malloc (SIGSTKSZ);
  if (ss.ss_sp == NULL)
die ("malloc");
  ss.ss_size = SIGSTKSZ;
  ss.ss_flags = 0;
  if (sigaltstack (&ss, NULL) < 0)
die ("sigaltstack set");
  return NULL;
}

int
main ()
{
  pthread_t tid;
  int i;
  stack_t ss;

  printsigstack ("main 1");

  i = pthread_create (&tid, NULL, thread, NULL);
  if (i != 0)
{
  errno = i;
  die ("pthread_create");
}

  i = pthread_join (tid, NULL);
  if (i != 0) {
errno = i;
die ("pthread_join");
  }

  printsigstack ("main 2");

  ss.ss_sp = malloc (SIGSTKSZ);
  if (ss.ss_sp == NULL)
die ("malloc");
  ss.ss_size = SIGSTKSZ;
  ss.ss_flags = 0;
  if (sigaltstack (&ss, NULL) < 0)
die ("sigaltstack set");

  printsigstack ("main 3");

  i = pthread_create (&tid, NULL, thread, NULL);
  if (i != 0)
{
  errno = i;
  die ("pthread_create");
}

  i = pthread_join (tid, NULL);
  if (i != 0) {
errno = i;
die ("pthread_join");
  }

  printsigstack ("main 4");

  return 0;
}

@minux
Copy link
Member

minux commented Jan 23, 2016 via email

@crawshaw
Copy link
Member

For a few (uninteresting) reasons it would take me a couple of hours work to run this. Hopefully the run by @minux does the job.

@ianlancetaylor
Copy link
Contributor

The run by minux tells me that the problem on iOS is not the same as the problem on NetBSD and DragonFly. This will require more investigation.

@gopherbot
Copy link

CL https://golang.org/cl/18940 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants