|
29 | 29 | #include "protocolServer.h" |
30 | 30 | #endif |
31 | 31 |
|
| 32 | +#ifdef __linux__ |
| 33 | +// The clang compiler in Ubuntu 18.04 has a bug that causes it to crash |
| 34 | +// when compiling _dispatch_bug_kevent_vanished(). As a workaround, use a |
| 35 | +// less capable version of this function on Linux until a fixed version |
| 36 | +// of the compiler is available. |
| 37 | +#define RDAR_49023449 1 |
| 38 | +#endif // __linux__ |
| 39 | + |
32 | 40 | #pragma mark - |
33 | 41 | #pragma mark dispatch_init |
34 | 42 |
|
@@ -964,6 +972,7 @@ _dispatch_continuation_get_function_symbol(dispatch_continuation_t dc) |
964 | 972 | return dc->dc_func; |
965 | 973 | } |
966 | 974 |
|
| 975 | +#if HAVE_MACH |
967 | 976 | void |
968 | 977 | _dispatch_bug_kevent_client(const char *msg, const char *filter, |
969 | 978 | const char *operation, int err, uint64_t ident, uint64_t udata, |
@@ -1007,6 +1016,23 @@ _dispatch_bug_kevent_client(const char *msg, const char *filter, |
1007 | 1016 | msg, strerror(err), err, udata, filter, ident, ident, func); |
1008 | 1017 | } |
1009 | 1018 | } |
| 1019 | +#endif // HAVE_MACH |
| 1020 | + |
| 1021 | +#if RDAR_49023449 |
| 1022 | + |
| 1023 | +// The clang compiler on Ubuntu18.04 crashes when compiling the full version of |
| 1024 | +// this function. This reduced version avoids the crash but logs less useful |
| 1025 | +// information. |
| 1026 | +void |
| 1027 | +_dispatch_bug_kevent_vanished(dispatch_unote_t du) |
| 1028 | +{ |
| 1029 | + _dispatch_log_fault("LIBDISPATCH_STRICT: _dispatch_bug_kevent_vanished", |
| 1030 | + "BUG in libdispatch client: %s, monitored resource vanished before " |
| 1031 | + "the source cancel handler was invoked", |
| 1032 | + dux_type(du._du)->dst_kind); |
| 1033 | +} |
| 1034 | + |
| 1035 | +#else // RDAR_49023449 |
1010 | 1036 |
|
1011 | 1037 | void |
1012 | 1038 | _dispatch_bug_kevent_vanished(dispatch_unote_t du) |
@@ -1036,6 +1062,8 @@ _dispatch_bug_kevent_vanished(dispatch_unote_t du) |
1036 | 1062 | du._du->du_ident, du._du->du_ident, func); |
1037 | 1063 | } |
1038 | 1064 |
|
| 1065 | +#endif // RDAR_49023449 |
| 1066 | + |
1039 | 1067 | DISPATCH_NOINLINE DISPATCH_WEAK |
1040 | 1068 | void |
1041 | 1069 | _dispatch_bug_deprecated(const char *msg) |
|
0 commit comments