Files
sdk/runtime/bin
Martin Kustermann e0a427a957 Workaround attempt for timeout flakiness: Avoid running atexit() handlers in fork()ed process on linux
About this CL:

  The only purpose of `if (fork() == 0) exit(0)` is to wake up
  a thread in the parent process which might be blocked on `wait()`.

  There is no need to run atexit() handlers in the `fork()`ed child.

  This is a *workaround attempt* for a deadlocked `free()` call inside the
  processing of atexit handlers in glibc.

  (Side note: There might be better ways of notifying the thread, like sending a
   signal to the particular pthread with `pthread_kill` which would make the
   `wait()` syscall be interrupted.)

About the issue:

  It is still unclear why, in this particular case, the tcmalloc locks should
  be hold during the `exit()` call:

    * via a static initializer tcmalloc uses
        `pthread_atfork(before=ObtainAllLocks(),
                        after_parent=ReleaseAllLocks(),
                        after_child=ReleaseAllLocks())`
      to register locking & unlocking around `fork()`

    * glibc's `fork()` runs the either `after_parent` or `after_child` handlers
      (unconditionally) which should free the locks

    * the `exit()` call later should be free to malloc/free

  The [BUG] describes more in detail how we can hit a tcmalloc deadlock in a
  different situation (it's a linux kernel bug).
  Namely, if the linux kernel runs OOM during `fork()` and therefore fails to
  set the new thread-id. The glibc code hits an assert and tries to allocate
  memory before `after_parent`/`after_child` handlers were executed which
  deadlocks.

BUG=https://github.com/dart-lang/sdk/issues/28246
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2618723002 .
2017-01-05 13:56:01 +01:00
..
2016-11-04 12:30:56 -07:00
2017-01-03 14:37:27 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-08 12:28:52 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-10-18 09:37:04 -07:00
2016-11-04 12:30:56 -07:00
2016-12-13 11:09:55 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-15 11:12:42 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-07 09:11:16 -08:00
2016-12-07 09:11:16 -08:00
2016-11-04 12:30:56 -07:00
2016-03-16 10:01:00 -07:00
2016-03-16 10:01:00 -07:00
2016-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-11-23 10:47:44 -08:00
2016-11-23 10:47:44 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-21 09:10:40 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-03-16 10:01:00 -07:00
2016-11-04 12:30:56 -07:00
2016-11-20 22:46:54 -08:00
2016-12-13 11:09:55 -08:00
2016-11-20 22:14:16 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-30 23:52:04 +01:00
2016-11-30 23:52:04 +01:00
2016-12-15 11:12:42 -08:00
2016-12-15 11:12:42 -08:00
2016-11-04 12:30:56 -07:00
2016-12-15 11:12:42 -08:00
2016-12-15 11:12:42 -08:00
2016-12-15 11:12:42 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00