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-23 14:24:52 -08:00
2016-10-26 08:50:54 -07:00
2016-11-04 12:30:56 -07:00
2017-01-03 14:37:27 -08:00
2016-12-13 13:02:52 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-20 22:04:14 -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-16 13:56:20 +01:00
2016-10-27 10:09:22 +02:00
2016-11-04 12:30:56 -07:00
2016-10-27 10:09:22 +02: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-08-02 13:18:37 -07:00
2016-03-14 11:08:52 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-04-22 07:00:03 -07:00
2016-10-12 13:04:22 -07:00
2016-09-20 14:44:05 -07:00
2016-11-16 14:40:57 +01:00
2016-11-07 16:17:47 -08:00
2016-12-16 20:58:52 -08:00
2016-12-20 09:44:08 -08:00
2016-12-16 20:58:52 -08:00
2016-12-16 20:58:52 -08:00
2016-08-10 12:54:57 -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-07-18 10:45:53 -07:00
2016-10-26 00:26:03 -07:00
2016-11-11 21:15:16 -08:00
2016-11-04 12:30:56 -07:00
2016-12-01 16:39:22 -08:00
2016-11-20 22:04:14 -08:00
2016-11-11 21:15:16 -08:00
2016-11-04 12:30:56 -07:00
2016-11-11 21:15:16 -08:00
2016-11-04 12:30:56 -07:00
2016-10-27 10:09:22 +02: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-14 09:57:54 -07:00
2016-10-14 09:57:54 -07:00
2016-10-14 09:57:54 -07:00
2016-10-14 09:57:54 -07:00
2016-10-18 09:37:04 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -07:00
2016-11-20 22:04:14 -08:00
2016-12-13 11:09:55 -08:00
2016-11-20 22:04:14 -08:00
2016-11-20 22:04:14 -08:00
2016-11-20 22:04:14 -08:00
2017-01-04 13:09:07 -08:00
2017-01-04 13:09:07 -08:00
2017-01-04 13:09:07 -08:00
2017-01-04 13:09:07 -08:00
2017-01-05 12:23:51 +01:00
2016-11-04 12:30:56 -07:00
2016-08-10 12:54:57 -07:00
2016-11-04 12:30:56 -07:00
2016-07-22 14:00:31 -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-29 11:22:03 -07:00
2016-11-04 12:30:56 -07:00
2016-04-20 10:08:37 -07:00
2016-11-04 12:30:56 -07:00
2017-01-04 07:50:35 -08:00
2017-01-04 09:33:28 -08:00
2016-11-04 12:30:56 -07:00
2016-08-10 12:54:57 -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-16 16:00:17 -08:00
2016-11-12 10:57:01 -08:00
2016-12-01 13:51:49 +01:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-07-22 14:00:31 -07:00
2016-12-15 11:12:42 -08:00
2016-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-08-10 12:54:57 -07:00
2016-03-29 11:22:03 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-10-31 15:56:25 -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-11-22 09:59:06 -08:00
2016-10-20 13:39:35 -07:00
2016-11-22 09:59:06 -08: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-12-16 16:00:17 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-16 21:23:20 -08:00
2016-11-23 10:47:44 -08:00
2016-11-23 10:47:44 -08:00
2016-11-16 16:36:10 +01:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-11-11 16:19:02 -08:00
2016-11-04 12:30:56 -07:00
2017-01-05 13:56:01 +01:00
2016-12-21 09:10:40 -08:00
2017-01-05 13:56:01 +01:00
2016-12-21 09:10:40 -08:00
2016-10-27 10:09:22 +02: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-12-21 09:10:40 -08:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-12-12 14:51:30 -08:00
2016-11-04 12:30:56 -07:00
2016-12-01 16:39:22 -08:00
2016-11-30 10:26:45 -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-08-10 12:54:57 -07:00
2016-11-04 12:30:56 -07:00
2016-11-23 10:48:18 -08: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-10-26 00:26:03 -07:00
2016-12-13 11:09:55 -08:00
2016-11-20 22:04:14 -08:00
2016-11-20 22:04:14 -08:00
2016-10-26 00:26:03 -07:00
2016-11-20 22:14:16 -08:00
2016-10-26 00:26:03 -07:00
2016-10-19 15:12:59 -07:00
2016-11-04 12:30:56 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -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-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-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-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -07:00
2016-11-04 12:30:56 -07:00
2016-10-26 00:26:03 -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-16 13:56:20 +01:00
2016-11-16 13:56:20 +01:00
2016-04-13 00:15:37 +02:00