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
@@ -955,6 +963,7 @@ _dispatch_continuation_get_function_symbol(dispatch_continuation_t dc)
955
963
return dc -> dc_func ;
956
964
}
957
965
966
+ #if HAVE_MACH
958
967
void
959
968
_dispatch_bug_kevent_client (const char * msg , const char * filter ,
960
969
const char * operation , int err , uint64_t ident , uint64_t udata ,
@@ -998,6 +1007,23 @@ _dispatch_bug_kevent_client(const char *msg, const char *filter,
998
1007
msg , strerror (err ), err , udata , filter , ident , ident , func );
999
1008
}
1000
1009
}
1010
+ #endif // HAVE_MACH
1011
+
1012
+ #if RDAR_49023449
1013
+
1014
+ // The clang compiler on Ubuntu18.04 crashes when compiling the full version of
1015
+ // this function. This reduced version avoids the crash but logs less useful
1016
+ // information.
1017
+ void
1018
+ _dispatch_bug_kevent_vanished (dispatch_unote_t du )
1019
+ {
1020
+ _dispatch_log_fault ("LIBDISPATCH_STRICT: _dispatch_bug_kevent_vanished" ,
1021
+ "BUG in libdispatch client: %s, monitored resource vanished before "
1022
+ "the source cancel handler was invoked" ,
1023
+ dux_type (du ._du )-> dst_kind );
1024
+ }
1025
+
1026
+ #else // RDAR_49023449
1001
1027
1002
1028
void
1003
1029
_dispatch_bug_kevent_vanished (dispatch_unote_t du )
@@ -1012,7 +1038,7 @@ _dispatch_bug_kevent_vanished(dispatch_unote_t du)
1012
1038
dc = du ._dr -> ds_handler [DS_EVENT_HANDLER ];
1013
1039
if (dc ) func = _dispatch_continuation_get_function_symbol (dc );
1014
1040
break ;
1015
- #if HAVE_MACH
1041
+ #if HAVE_MACH
1016
1042
case DISPATCH_MACH_CHANNEL_TYPE :
1017
1043
func = du ._dmrr -> dmrr_handler_func ;
1018
1044
break ;
@@ -1027,6 +1053,8 @@ _dispatch_bug_kevent_vanished(dispatch_unote_t du)
1027
1053
du ._du -> du_ident , du ._du -> du_ident , func );
1028
1054
}
1029
1055
1056
+ #endif // RDAR_49023449
1057
+
1030
1058
DISPATCH_NOINLINE DISPATCH_WEAK
1031
1059
void
1032
1060
_dispatch_bug_deprecated (const char * msg )
0 commit comments