[cleanup] Eliminate usage of GRPC_ASSERT(false...); (#31757)

* crash function

* progress

* fix

* fix

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fixes

* Automated change: Fix sanity tests

* fix

* Automated change: Fix sanity tests

* fix

* fix

* use cpp attr

* Automated change: Fix sanity tests

* fix

* fix

* fix

* fix

* fix

* fix

* add exclusion

* fix

* typo

* fix

* fmt

* Update tcp_socket_utils.cc

* Automated change: Fix sanity tests

* fix

* revert php changes

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
pull/32078/head
Craig Tiller 2 years ago committed by GitHub
parent daded8a59f
commit 67f364e23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      BUILD
  2. 1
      CMakeLists.txt
  3. 1
      Makefile
  4. 2
      bazel/grpc_deps.bzl
  5. 19
      build_autogenerated.yaml
  6. 1
      config.m4
  7. 1
      config.w32
  8. 2
      gRPC-C++.podspec
  9. 3
      gRPC-Core.podspec
  10. 1
      grpc.def
  11. 2
      grpc.gemspec
  12. 1
      grpc.gyp
  13. 14
      include/grpc/support/log.h
  14. 2
      package.xml
  15. 3
      src/core/BUILD
  16. 8
      src/core/ext/filters/client_channel/channel_connectivity.cc
  17. 9
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
  18. 1
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  19. 2
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  20. 5
      src/core/ext/filters/stateful_session/stateful_session_filter.cc
  21. 2
      src/core/ext/transport/binder/client/channel_create.cc
  22. 2
      src/core/ext/transport/binder/client/jni_utils.cc
  23. 1
      src/core/ext/transport/binder/security_policy/binder_security_policy.cc
  24. 2
      src/core/ext/transport/binder/server/binder_server_credentials.cc
  25. 2
      src/core/ext/transport/binder/transport/binder_transport.cc
  26. 1
      src/core/ext/transport/binder/transport/binder_transport.h
  27. 1
      src/core/ext/transport/binder/utils/ndk_binder.cc
  28. 2
      src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
  29. 1
      src/core/ext/transport/binder/wire_format/binder_android.cc
  30. 2
      src/core/ext/transport/binder/wire_format/transaction.h
  31. 1
      src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
  32. 3
      src/core/ext/transport/binder/wire_format/wire_writer.cc
  33. 8
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  34. 5
      src/core/ext/transport/chttp2/transport/hpack_encoder.cc
  35. 3
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  36. 3
      src/core/lib/address_utils/sockaddr_utils.cc
  37. 119
      src/core/lib/channel/promise_based_filter.cc
  38. 7
      src/core/lib/compression/compression_internal.cc
  39. 25
      src/core/lib/event_engine/posix_engine/ev_epoll1_linux.cc
  40. 41
      src/core/lib/event_engine/posix_engine/ev_poll_posix.cc
  41. 10
      src/core/lib/event_engine/posix_engine/lockfree_event.cc
  42. 6
      src/core/lib/event_engine/posix_engine/posix_endpoint.cc
  43. 15
      src/core/lib/event_engine/posix_engine/posix_endpoint.h
  44. 17
      src/core/lib/event_engine/posix_engine/posix_engine.cc
  45. 10
      src/core/lib/event_engine/posix_engine/posix_engine_listener.h
  46. 18
      src/core/lib/event_engine/posix_engine/posix_engine_listener_utils.cc
  47. 41
      src/core/lib/event_engine/posix_engine/tcp_socket_utils.cc
  48. 4
      src/core/lib/event_engine/posix_engine/traced_buffer_list.cc
  49. 11
      src/core/lib/event_engine/posix_engine/wakeup_fd_eventfd.cc
  50. 9
      src/core/lib/event_engine/posix_engine/wakeup_fd_pipe.cc
  51. 5
      src/core/lib/event_engine/windows/iocp.cc
  52. 9
      src/core/lib/event_engine/windows/windows_endpoint.cc
  53. 13
      src/core/lib/event_engine/windows/windows_engine.cc
  54. 2
      src/core/lib/gpr/alloc.cc
  55. 1
      src/core/lib/gpr/cpu_linux.cc
  56. 1
      src/core/lib/gpr/cpu_posix.cc
  57. 2
      src/core/lib/gpr/cpu_windows.cc
  58. 12
      src/core/lib/gpr/log.cc
  59. 2
      src/core/lib/gpr/log_android.cc
  60. 1
      src/core/lib/gpr/log_linux.cc
  61. 1
      src/core/lib/gpr/log_posix.cc
  62. 1
      src/core/lib/gpr/log_windows.cc
  63. 1
      src/core/lib/gpr/string.cc
  64. 2
      src/core/lib/gpr/sync_abseil.cc
  65. 2
      src/core/lib/gpr/sync_posix.cc
  66. 2
      src/core/lib/gpr/sync_windows.cc
  67. 2
      src/core/lib/gpr/time.cc
  68. 2
      src/core/lib/gpr/time_posix.cc
  69. 1
      src/core/lib/gpr/time_precise.cc
  70. 1
      src/core/lib/gpr/time_windows.cc
  71. 1
      src/core/lib/gpr/tmpfile_msys.cc
  72. 1
      src/core/lib/gpr/tmpfile_posix.cc
  73. 1
      src/core/lib/gpr/tmpfile_windows.cc
  74. 33
      src/core/lib/gprpp/crash.cc
  75. 34
      src/core/lib/gprpp/crash.h
  76. 1
      src/core/lib/gprpp/stat_windows.cc
  77. 1
      src/core/lib/gprpp/thd_windows.cc
  78. 1
      src/core/lib/iomgr/buffer_list.cc
  79. 1
      src/core/lib/iomgr/call_combiner.cc
  80. 1
      src/core/lib/iomgr/closure.h
  81. 1
      src/core/lib/iomgr/combiner.cc
  82. 1
      src/core/lib/iomgr/endpoint_pair_posix.cc
  83. 1
      src/core/lib/iomgr/endpoint_pair_windows.cc
  84. 2
      src/core/lib/iomgr/error.cc
  85. 1
      src/core/lib/iomgr/error.h
  86. 1
      src/core/lib/iomgr/ev_epoll1_linux.cc
  87. 12
      src/core/lib/iomgr/ev_poll_posix.cc
  88. 8
      src/core/lib/iomgr/ev_posix.cc
  89. 27
      src/core/lib/iomgr/exec_ctx.cc
  90. 1
      src/core/lib/iomgr/exec_ctx.h
  91. 1
      src/core/lib/iomgr/executor.cc
  92. 1
      src/core/lib/iomgr/fork_posix.cc
  93. 1
      src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
  94. 1
      src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
  95. 4
      src/core/lib/iomgr/iocp_windows.cc
  96. 1
      src/core/lib/iomgr/iomgr.cc
  97. 1
      src/core/lib/iomgr/iomgr_windows.cc
  98. 1
      src/core/lib/iomgr/load_file.cc
  99. 8
      src/core/lib/iomgr/lockfree_event.cc
  100. 12
      src/core/lib/iomgr/polling_entity.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -643,6 +643,7 @@ grpc_cc_library(
"//src/core:lib/gpr/tmpfile_posix.cc", "//src/core:lib/gpr/tmpfile_posix.cc",
"//src/core:lib/gpr/tmpfile_windows.cc", "//src/core:lib/gpr/tmpfile_windows.cc",
"//src/core:lib/gpr/wrap_memcpy.cc", "//src/core:lib/gpr/wrap_memcpy.cc",
"//src/core:lib/gprpp/crash.cc",
"//src/core:lib/gprpp/fork.cc", "//src/core:lib/gprpp/fork.cc",
"//src/core:lib/gprpp/global_config_env.cc", "//src/core:lib/gprpp/global_config_env.cc",
"//src/core:lib/gprpp/host_port.cc", "//src/core:lib/gprpp/host_port.cc",
@ -658,6 +659,7 @@ grpc_cc_library(
"//src/core:lib/gpr/string.h", "//src/core:lib/gpr/string.h",
"//src/core:lib/gpr/time_precise.h", "//src/core:lib/gpr/time_precise.h",
"//src/core:lib/gpr/tmpfile.h", "//src/core:lib/gpr/tmpfile.h",
"//src/core:lib/gprpp/crash.h",
"//src/core:lib/gprpp/fork.h", "//src/core:lib/gprpp/fork.h",
"//src/core:lib/gprpp/global_config.h", "//src/core:lib/gprpp/global_config.h",
"//src/core:lib/gprpp/global_config_custom.h", "//src/core:lib/gprpp/global_config_custom.h",
@ -691,6 +693,7 @@ grpc_cc_library(
], ],
visibility = ["@grpc:public"], visibility = ["@grpc:public"],
deps = [ deps = [
"debug_location",
"//src/core:construct_destruct", "//src/core:construct_destruct",
"//src/core:env", "//src/core:env",
"//src/core:examine_stack", "//src/core:examine_stack",
@ -1002,6 +1005,7 @@ grpc_cc_library(
"//src/core:channel_args", "//src/core:channel_args",
"//src/core:channel_args_preconditioning", "//src/core:channel_args_preconditioning",
"//src/core:channel_stack_type", "//src/core:channel_stack_type",
"//src/core:default_event_engine",
"//src/core:iomgr_fwd", "//src/core:iomgr_fwd",
"//src/core:iomgr_port", "//src/core:iomgr_port",
"//src/core:slice", "//src/core:slice",
@ -1746,6 +1750,7 @@ grpc_cc_library(
"absl/status", "absl/status",
"absl/status:statusor", "absl/status:statusor",
"absl/strings", "absl/strings",
"absl/strings:str_format",
"absl/synchronization", "absl/synchronization",
"absl/memory", "absl/memory",
"absl/types:optional", "absl/types:optional",
@ -1817,6 +1822,7 @@ grpc_cc_library(
"absl/types:optional", "absl/types:optional",
"absl/memory", "absl/memory",
"upb_lib", "upb_lib",
"absl/strings:str_format",
"protobuf_headers", "protobuf_headers",
], ],
language = "c++", language = "c++",
@ -2371,6 +2377,7 @@ grpc_cc_library(
"//src/core:lib/iomgr/executor.h", "//src/core:lib/iomgr/executor.h",
"//src/core:lib/iomgr/iomgr_internal.h", "//src/core:lib/iomgr/iomgr_internal.h",
], ],
external_deps = ["absl/strings:str_format"],
visibility = [ visibility = [
"@grpc:alt_grpc_base_legacy", "@grpc:alt_grpc_base_legacy",
"@grpc:exec_ctx", "@grpc:exec_ctx",
@ -2432,6 +2439,7 @@ grpc_cc_library(
], ],
external_deps = [ external_deps = [
"absl/strings", "absl/strings",
"absl/strings:str_format",
], ],
tags = ["nofixdeps"], tags = ["nofixdeps"],
visibility = ["@grpc:iomgr_timer"], visibility = ["@grpc:iomgr_timer"],

1
CMakeLists.txt generated

@ -1565,6 +1565,7 @@ add_library(gpr
src/core/lib/gpr/tmpfile_posix.cc src/core/lib/gpr/tmpfile_posix.cc
src/core/lib/gpr/tmpfile_windows.cc src/core/lib/gpr/tmpfile_windows.cc
src/core/lib/gpr/wrap_memcpy.cc src/core/lib/gpr/wrap_memcpy.cc
src/core/lib/gprpp/crash.cc
src/core/lib/gprpp/env_linux.cc src/core/lib/gprpp/env_linux.cc
src/core/lib/gprpp/env_posix.cc src/core/lib/gprpp/env_posix.cc
src/core/lib/gprpp/env_windows.cc src/core/lib/gprpp/env_windows.cc

1
Makefile generated

@ -867,6 +867,7 @@ LIBGPR_SRC = \
src/core/lib/gpr/tmpfile_posix.cc \ src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \ src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/wrap_memcpy.cc \ src/core/lib/gpr/wrap_memcpy.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/env_linux.cc \ src/core/lib/gprpp/env_linux.cc \
src/core/lib/gprpp/env_posix.cc \ src/core/lib/gprpp/env_posix.cc \
src/core/lib/gprpp/env_windows.cc \ src/core/lib/gprpp/env_windows.cc \

@ -206,7 +206,7 @@ def grpc_deps():
) )
native.bind( native.bind(
name = "googleapis_logging_proto", name = "googleapis_logging_cc_proto",
actual = "@com_google_googleapis//google/logging/v2:logging_cc_proto", actual = "@com_google_googleapis//google/logging/v2:logging_cc_proto",
) )

@ -176,6 +176,8 @@ libs:
- src/core/lib/gpr/tmpfile.h - src/core/lib/gpr/tmpfile.h
- src/core/lib/gpr/useful.h - src/core/lib/gpr/useful.h
- src/core/lib/gprpp/construct_destruct.h - src/core/lib/gprpp/construct_destruct.h
- src/core/lib/gprpp/crash.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/env.h - src/core/lib/gprpp/env.h
- src/core/lib/gprpp/examine_stack.h - src/core/lib/gprpp/examine_stack.h
- src/core/lib/gprpp/fork.h - src/core/lib/gprpp/fork.h
@ -221,6 +223,7 @@ libs:
- src/core/lib/gpr/tmpfile_posix.cc - src/core/lib/gpr/tmpfile_posix.cc
- src/core/lib/gpr/tmpfile_windows.cc - src/core/lib/gpr/tmpfile_windows.cc
- src/core/lib/gpr/wrap_memcpy.cc - src/core/lib/gpr/wrap_memcpy.cc
- src/core/lib/gprpp/crash.cc
- src/core/lib/gprpp/env_linux.cc - src/core/lib/gprpp/env_linux.cc
- src/core/lib/gprpp/env_posix.cc - src/core/lib/gprpp/env_posix.cc
- src/core/lib/gprpp/env_windows.cc - src/core/lib/gprpp/env_windows.cc
@ -810,7 +813,6 @@ libs:
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
@ -2119,7 +2121,6 @@ libs:
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
@ -3556,7 +3557,6 @@ libs:
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
@ -4367,7 +4367,6 @@ targets:
headers: headers:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h - src/core/lib/gprpp/ref_counted_ptr.h
@ -5668,7 +5667,6 @@ targets:
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -6663,7 +6661,6 @@ targets:
- src/core/lib/gpr/spinlock.h - src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -6940,7 +6937,6 @@ targets:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -7032,7 +7028,6 @@ targets:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -7301,7 +7296,6 @@ targets:
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/chunked_vector.h - src/core/lib/gprpp/chunked_vector.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/dual_ref_counted.h - src/core/lib/gprpp/dual_ref_counted.h
- src/core/lib/gprpp/load_file.h - src/core/lib/gprpp/load_file.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
@ -8860,7 +8854,6 @@ targets:
headers: headers:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h - src/core/lib/gprpp/ref_counted_ptr.h
@ -8976,7 +8969,6 @@ targets:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -9333,7 +9325,6 @@ targets:
language: c++ language: c++
headers: headers:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h - src/core/lib/gprpp/ref_counted_ptr.h
@ -9541,7 +9532,6 @@ targets:
- src/core/lib/debug/trace.h - src/core/lib/debug/trace.h
- src/core/lib/gpr/spinlock.h - src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/status_helper.h - src/core/lib/gprpp/status_helper.h
- src/core/lib/gprpp/time.h - src/core/lib/gprpp/time.h
@ -9640,7 +9630,6 @@ targets:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/cpp_impl_of.h - src/core/lib/gprpp/cpp_impl_of.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
@ -11684,7 +11673,6 @@ targets:
language: c++ language: c++
headers: headers:
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h
- src/core/lib/gprpp/ref_counted_ptr.h - src/core/lib/gprpp/ref_counted_ptr.h
- src/core/lib/resource_quota/thread_quota.h - src/core/lib/resource_quota/thread_quota.h
@ -12012,7 +12000,6 @@ targets:
- src/core/lib/gpr/spinlock.h - src/core/lib/gpr/spinlock.h
- src/core/lib/gprpp/atomic_utils.h - src/core/lib/gprpp/atomic_utils.h
- src/core/lib/gprpp/bitset.h - src/core/lib/gprpp/bitset.h
- src/core/lib/gprpp/debug_location.h
- src/core/lib/gprpp/manual_constructor.h - src/core/lib/gprpp/manual_constructor.h
- src/core/lib/gprpp/orphanable.h - src/core/lib/gprpp/orphanable.h
- src/core/lib/gprpp/ref_counted.h - src/core/lib/gprpp/ref_counted.h

1
config.m4 generated

@ -557,6 +557,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/gpr/tmpfile_posix.cc \ src/core/lib/gpr/tmpfile_posix.cc \
src/core/lib/gpr/tmpfile_windows.cc \ src/core/lib/gpr/tmpfile_windows.cc \
src/core/lib/gpr/wrap_memcpy.cc \ src/core/lib/gpr/wrap_memcpy.cc \
src/core/lib/gprpp/crash.cc \
src/core/lib/gprpp/env_linux.cc \ src/core/lib/gprpp/env_linux.cc \
src/core/lib/gprpp/env_posix.cc \ src/core/lib/gprpp/env_posix.cc \
src/core/lib/gprpp/env_windows.cc \ src/core/lib/gprpp/env_windows.cc \

1
config.w32 generated

@ -523,6 +523,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\gpr\\tmpfile_posix.cc " + "src\\core\\lib\\gpr\\tmpfile_posix.cc " +
"src\\core\\lib\\gpr\\tmpfile_windows.cc " + "src\\core\\lib\\gpr\\tmpfile_windows.cc " +
"src\\core\\lib\\gpr\\wrap_memcpy.cc " + "src\\core\\lib\\gpr\\wrap_memcpy.cc " +
"src\\core\\lib\\gprpp\\crash.cc " +
"src\\core\\lib\\gprpp\\env_linux.cc " + "src\\core\\lib\\gprpp\\env_linux.cc " +
"src\\core\\lib\\gprpp\\env_posix.cc " + "src\\core\\lib\\gprpp\\env_posix.cc " +
"src\\core\\lib\\gprpp\\env_windows.cc " + "src\\core\\lib\\gprpp\\env_windows.cc " +

2
gRPC-C++.podspec generated

@ -769,6 +769,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/chunked_vector.h', 'src/core/lib/gprpp/chunked_vector.h',
'src/core/lib/gprpp/construct_destruct.h', 'src/core/lib/gprpp/construct_destruct.h',
'src/core/lib/gprpp/cpp_impl_of.h', 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/crash.h',
'src/core/lib/gprpp/debug_location.h', 'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h', 'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/env.h',
@ -1679,6 +1680,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/chunked_vector.h', 'src/core/lib/gprpp/chunked_vector.h',
'src/core/lib/gprpp/construct_destruct.h', 'src/core/lib/gprpp/construct_destruct.h',
'src/core/lib/gprpp/cpp_impl_of.h', 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/crash.h',
'src/core/lib/gprpp/debug_location.h', 'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h', 'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/env.h',

3
gRPC-Core.podspec generated

@ -1216,6 +1216,8 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/chunked_vector.h', 'src/core/lib/gprpp/chunked_vector.h',
'src/core/lib/gprpp/construct_destruct.h', 'src/core/lib/gprpp/construct_destruct.h',
'src/core/lib/gprpp/cpp_impl_of.h', 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/crash.cc',
'src/core/lib/gprpp/crash.h',
'src/core/lib/gprpp/debug_location.h', 'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h', 'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/env.h',
@ -2347,6 +2349,7 @@ Pod::Spec.new do |s|
'src/core/lib/gprpp/chunked_vector.h', 'src/core/lib/gprpp/chunked_vector.h',
'src/core/lib/gprpp/construct_destruct.h', 'src/core/lib/gprpp/construct_destruct.h',
'src/core/lib/gprpp/cpp_impl_of.h', 'src/core/lib/gprpp/cpp_impl_of.h',
'src/core/lib/gprpp/crash.h',
'src/core/lib/gprpp/debug_location.h', 'src/core/lib/gprpp/debug_location.h',
'src/core/lib/gprpp/dual_ref_counted.h', 'src/core/lib/gprpp/dual_ref_counted.h',
'src/core/lib/gprpp/env.h', 'src/core/lib/gprpp/env.h',

1
grpc.def generated

@ -233,6 +233,7 @@ EXPORTS
gpr_set_log_verbosity gpr_set_log_verbosity
gpr_log_verbosity_init gpr_log_verbosity_init
gpr_set_log_function gpr_set_log_function
gpr_assertion_failed
gpr_format_message gpr_format_message
gpr_strdup gpr_strdup
gpr_asprintf gpr_asprintf

2
grpc.gemspec generated

@ -1127,6 +1127,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/gprpp/chunked_vector.h ) s.files += %w( src/core/lib/gprpp/chunked_vector.h )
s.files += %w( src/core/lib/gprpp/construct_destruct.h ) s.files += %w( src/core/lib/gprpp/construct_destruct.h )
s.files += %w( src/core/lib/gprpp/cpp_impl_of.h ) s.files += %w( src/core/lib/gprpp/cpp_impl_of.h )
s.files += %w( src/core/lib/gprpp/crash.cc )
s.files += %w( src/core/lib/gprpp/crash.h )
s.files += %w( src/core/lib/gprpp/debug_location.h ) s.files += %w( src/core/lib/gprpp/debug_location.h )
s.files += %w( src/core/lib/gprpp/dual_ref_counted.h ) s.files += %w( src/core/lib/gprpp/dual_ref_counted.h )
s.files += %w( src/core/lib/gprpp/env.h ) s.files += %w( src/core/lib/gprpp/env.h )

1
grpc.gyp generated

@ -332,6 +332,7 @@
'src/core/lib/gpr/tmpfile_posix.cc', 'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc', 'src/core/lib/gpr/tmpfile_windows.cc',
'src/core/lib/gpr/wrap_memcpy.cc', 'src/core/lib/gpr/wrap_memcpy.cc',
'src/core/lib/gprpp/crash.cc',
'src/core/lib/gprpp/env_linux.cc', 'src/core/lib/gprpp/env_linux.cc',
'src/core/lib/gprpp/env_posix.cc', 'src/core/lib/gprpp/env_posix.cc',
'src/core/lib/gprpp/env_windows.cc', 'src/core/lib/gprpp/env_windows.cc',

@ -84,17 +84,19 @@ typedef struct gpr_log_func_args gpr_log_func_args;
typedef void (*gpr_log_func)(gpr_log_func_args* args); typedef void (*gpr_log_func)(gpr_log_func_args* args);
GPRAPI void gpr_set_log_function(gpr_log_func func); GPRAPI void gpr_set_log_function(gpr_log_func func);
GPRAPI void gpr_assertion_failed(const char* filename, int line,
const char* message) GPR_ATTRIBUTE_NORETURN;
/** abort() the process if x is zero, having written a line to the log. /** abort() the process if x is zero, having written a line to the log.
Intended for internal invariants. If the error can be recovered from, Intended for internal invariants. If the error can be recovered from,
without the possibility of corruption, or might best be reflected via without the possibility of corruption, or might best be reflected via
an exception in a higher-level language, consider returning error code. */ an exception in a higher-level language, consider returning error code. */
#define GPR_ASSERT(x) \ #define GPR_ASSERT(x) \
do { \ do { \
if (GPR_UNLIKELY(!(x))) { \ if (GPR_UNLIKELY(!(x))) { \
gpr_log(GPR_ERROR, "assertion failed: %s", #x); \ gpr_assertion_failed(__FILE__, __LINE__, #x); \
abort(); \ } \
} \
} while (0) } while (0)
#ifndef NDEBUG #ifndef NDEBUG

2
package.xml generated

@ -1109,6 +1109,8 @@
<file baseinstalldir="/" name="src/core/lib/gprpp/chunked_vector.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/chunked_vector.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/construct_destruct.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/construct_destruct.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/cpp_impl_of.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/cpp_impl_of.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/crash.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/crash.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/debug_location.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/debug_location.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/dual_ref_counted.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/dual_ref_counted.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/gprpp/env.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/gprpp/env.h" role="src" />

@ -1573,6 +1573,7 @@ grpc_cc_library(
"absl/status", "absl/status",
"absl/status:statusor", "absl/status:statusor",
"absl/strings", "absl/strings",
"absl/strings:str_format",
], ],
deps = [ deps = [
"event_engine_poller", "event_engine_poller",
@ -1608,6 +1609,7 @@ grpc_cc_library(
"absl/status", "absl/status",
"absl/status:statusor", "absl/status:statusor",
"absl/strings", "absl/strings",
"absl/strings:str_format",
], ],
deps = [ deps = [
"common_event_engine_closures", "common_event_engine_closures",
@ -2590,6 +2592,7 @@ grpc_cc_library(
"absl/status", "absl/status",
"absl/status:statusor", "absl/status:statusor",
"absl/strings", "absl/strings",
"absl/strings:str_format",
"absl/types:optional", "absl/types:optional",
], ],
language = "c++", language = "c++",

@ -33,6 +33,7 @@
#include "src/core/lib/channel/channel_fwd.h" #include "src/core/lib/channel/channel_fwd.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/dual_ref_counted.h" #include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h" #include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time.h"
@ -130,10 +131,9 @@ class StateWatcher : public DualRefCounted<StateWatcher> {
Unref(); Unref();
return; return;
} }
gpr_log(GPR_ERROR, Crash(
"grpc_channel_watch_connectivity_state called on " "grpc_channel_watch_connectivity_state called on something that is "
"something that is not a client channel"); "not a client channel");
GPR_ASSERT(false);
} }
// Ref from object creation is held by the watcher callback. // Ref from object creation is held by the watcher callback.
auto* watcher_timer_init_state = new WatcherTimerInitState( auto* watcher_timer_init_state = new WatcherTimerInitState(

@ -58,7 +58,6 @@
// IWYU pragma: no_include <sys/socket.h> // IWYU pragma: no_include <sys/socket.h>
#include <inttypes.h> #include <inttypes.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
@ -107,6 +106,7 @@
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h" #include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted.h"
@ -792,10 +792,9 @@ RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
static_cast<const TokenAndClientStatsAttribute*>( static_cast<const TokenAndClientStatsAttribute*>(
address.GetAttribute(kGrpcLbAddressAttributeKey)); address.GetAttribute(kGrpcLbAddressAttributeKey));
if (attribute == nullptr) { if (attribute == nullptr) {
gpr_log(GPR_ERROR, Crash(absl::StrFormat(
"[grpclb %p] no TokenAndClientStatsAttribute for address %p", "[grpclb %p] no TokenAndClientStatsAttribute for address %p",
parent_.get(), address.ToString().c_str()); parent_.get(), address.ToString().c_str()));
abort();
} }
std::string lb_token = attribute->lb_token(); std::string lb_token = attribute->lb_token();
RefCountedPtr<GrpcLbClientStats> client_stats = attribute->client_stats(); RefCountedPtr<GrpcLbClientStats> client_stats = attribute->client_stats();

@ -36,6 +36,7 @@
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h" #include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/iocp_windows.h" #include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr_windows.h" #include "src/core/lib/iomgr/sockaddr_windows.h"

@ -583,7 +583,7 @@ XdsResolver::XdsConfigSelector::CreateMethodConfig(
retry_parts.push_back( retry_parts.push_back(
absl::StrFormat(" \"retryableStatusCodes\": [\n %s ]\n", absl::StrFormat(" \"retryableStatusCodes\": [\n %s ]\n",
absl::StrJoin(code_parts, ",\n"))); absl::StrJoin(code_parts, ",\n")));
retry_parts.push_back(absl::StrFormat(" }")); retry_parts.push_back(" }");
fields.emplace_back(absl::StrJoin(retry_parts, "")); fields.emplace_back(absl::StrJoin(retry_parts, ""));
} }
// Set timeout. // Set timeout.

@ -44,6 +44,7 @@
#include "src/core/lib/channel/context.h" #include "src/core/lib/channel/context.h"
#include "src/core/lib/config/core_configuration.h" #include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time.h"
#include "src/core/lib/promise/context.h" #include "src/core/lib/promise/context.h"
#include "src/core/lib/promise/detail/basic_seq.h" #include "src/core/lib/promise/detail/basic_seq.h"
@ -106,9 +107,7 @@ void MaybeUpdateServerInitialMetadata(
server_initial_metadata->Append( server_initial_metadata->Append(
"set-cookie", Slice::FromCopiedString(absl::StrJoin(parts, "; ")), "set-cookie", Slice::FromCopiedString(absl::StrJoin(parts, "; ")),
[](absl::string_view error, const Slice&) { [](absl::string_view error, const Slice&) {
gpr_log(GPR_ERROR, "ERROR ADDING set-cookie METADATA: %s", Crash(absl::StrCat("ERROR ADDING set-cookie METADATA: ", error));
std::string(error).c_str());
GPR_ASSERT(false);
}); });
} }
} }

@ -30,6 +30,8 @@
#include <grpc/grpc_posix.h> #include <grpc/grpc_posix.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#ifdef GPR_SUPPORT_BINDER_TRANSPORT #ifdef GPR_SUPPORT_BINDER_TRANSPORT
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>

@ -20,6 +20,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#if defined(ANDROID) || defined(__ANDROID__) #if defined(ANDROID) || defined(__ANDROID__)
namespace grpc_binder { namespace grpc_binder {

@ -26,6 +26,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/ext/transport/binder/client/jni_utils.h" #include "src/core/ext/transport/binder/client/jni_utils.h"
#include "src/core/lib/gprpp/crash.h"
#endif #endif

@ -52,7 +52,7 @@ class BinderServerCredentialsImpl final : public ServerCredentials {
void SetAuthMetadataProcessor( void SetAuthMetadataProcessor(
const std::shared_ptr<AuthMetadataProcessor>& /*processor*/) override { const std::shared_ptr<AuthMetadataProcessor>& /*processor*/) override {
GPR_ASSERT(false); grpc_core::Crash("unreachable");
} }
private: private:

@ -35,6 +35,8 @@
#include "src/core/ext/transport/binder/wire_format/wire_reader.h" #include "src/core/ext/transport/binder/wire_format/wire_reader.h"
#include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h" #include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h"
#include "src/core/ext/transport/binder/wire_format/wire_writer.h" #include "src/core/ext/transport/binder/wire_format/wire_writer.h"
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/error_utils.h" #include "src/core/lib/transport/error_utils.h"

@ -32,6 +32,7 @@
#include "src/core/ext/transport/binder/wire_format/binder.h" #include "src/core/ext/transport/binder/wire_format/binder.h"
#include "src/core/ext/transport/binder/wire_format/wire_reader.h" #include "src/core/ext/transport/binder/wire_format/wire_reader.h"
#include "src/core/ext/transport/binder/wire_format/wire_writer.h" #include "src/core/ext/transport/binder/wire_format/wire_writer.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/transport/transport.h" #include "src/core/lib/transport/transport.h"
#include "src/core/lib/transport/transport_impl.h" #include "src/core/lib/transport/transport_impl.h"

@ -24,6 +24,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
namespace { namespace {

@ -24,6 +24,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
namespace grpc_binder { namespace grpc_binder {
const absl::string_view const absl::string_view

@ -26,6 +26,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/ext/transport/binder/wire_format/binder_android.h" #include "src/core/ext/transport/binder/wire_format/binder_android.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
namespace grpc_binder { namespace grpc_binder {

@ -24,6 +24,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
namespace grpc_binder { namespace grpc_binder {
ABSL_CONST_INIT extern const int kFlagPrefix; ABSL_CONST_INIT extern const int kFlagPrefix;

@ -32,6 +32,7 @@
#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h" #include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
#include "src/core/ext/transport/binder/wire_format/binder.h" #include "src/core/ext/transport/binder/wire_format/binder.h"
#include "src/core/ext/transport/binder/wire_format/wire_writer.h" #include "src/core/ext/transport/binder/wire_format/wire_writer.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
namespace grpc_binder { namespace grpc_binder {

@ -25,6 +25,9 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/event_engine/default_event_engine.h"
#include "src/core/lib/gprpp/crash.h"
#define RETURN_IF_ERROR(expr) \ #define RETURN_IF_ERROR(expr) \
do { \ do { \
const absl::Status status = (expr); \ const absl::Status status = (expr); \

@ -21,7 +21,6 @@
#include <inttypes.h> #include <inttypes.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
@ -65,6 +64,7 @@
#include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/bitset.h" #include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
@ -697,9 +697,9 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
for (int i = 0; i < STREAM_LIST_COUNT; i++) { for (int i = 0; i < STREAM_LIST_COUNT; i++) {
if (GPR_UNLIKELY(included.is_set(i))) { if (GPR_UNLIKELY(included.is_set(i))) {
gpr_log(GPR_ERROR, "%s stream %d still included in list %d", grpc_core::Crash(absl::StrFormat("%s stream %d still included in list %d",
t->is_client ? "client" : "server", id, i); t->is_client ? "client" : "server", id,
abort(); i));
} }
} }

@ -34,6 +34,7 @@
#include "src/core/ext/transport/chttp2/transport/http_trace.h" #include "src/core/ext/transport/chttp2/transport/http_trace.h"
#include "src/core/ext/transport/chttp2/transport/varint.h" #include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/surface/validate_metadata.h" #include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h" #include "src/core/lib/transport/timeout_encoding.h"
@ -362,7 +363,7 @@ void HPackCompressor::Encoder::Encode(HttpSchemeMetadata,
EmitIndexed(7); // :scheme: https EmitIndexed(7); // :scheme: https
break; break;
case HttpSchemeMetadata::ValueType::kInvalid: case HttpSchemeMetadata::ValueType::kInvalid:
GPR_ASSERT(false); Crash("invalid http scheme encoding");
break; break;
} }
} }
@ -430,7 +431,7 @@ void HPackCompressor::Encoder::Encode(HttpMethodMetadata,
Slice::FromStaticString("PUT")); Slice::FromStaticString("PUT"));
break; break;
case HttpMethodMetadata::ValueType::kInvalid: case HttpMethodMetadata::ValueType::kInvalid:
GPR_ASSERT(false); Crash("invalid http method encoding");
break; break;
} }
} }

@ -46,6 +46,7 @@
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h" #include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
#include "src/core/ext/transport/cronet/transport/cronet_status.h" #include "src/core/ext/transport/cronet/transport/cronet_status.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/iomgr/closure.h" #include "src/core/lib/iomgr/closure.h"
@ -1109,7 +1110,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
} }
} else { } else {
// Should never reach here // Should never reach here
GPR_ASSERT(false); grpc_core::Crash("unreachable");
} }
} }
stream_state->state_op_done[OP_SEND_MESSAGE] = true; stream_state->state_op_done[OP_SEND_MESSAGE] = true;

@ -33,6 +33,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/host_port.h" #include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
@ -356,7 +357,7 @@ std::string grpc_sockaddr_get_packed_host(
const char* addr_bytes = reinterpret_cast<const char*>(&addr6->sin6_addr); const char* addr_bytes = reinterpret_cast<const char*>(&addr6->sin6_addr);
return std::string(addr_bytes, 16); return std::string(addr_bytes, 16);
} else { } else {
GPR_ASSERT(false); grpc_core::Crash("unknown socket family");
} }
} }

@ -24,6 +24,7 @@
#include "absl/base/attributes.h" #include "absl/base/attributes.h"
#include "absl/functional/function_ref.h" #include "absl/functional/function_ref.h"
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h" #include "absl/strings/str_join.h"
#include "absl/types/variant.h" #include "absl/types/variant.h"
@ -31,6 +32,7 @@
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/error.h"
@ -318,8 +320,7 @@ void BaseCallData::SendMessage::StartOp(CapturedBatch batch) {
case State::kForwardedBatch: case State::kForwardedBatch:
case State::kBatchCompleted: case State::kBatchCompleted:
case State::kPushedToPipe: case State::kPushedToPipe:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kCancelled: case State::kCancelled:
case State::kCancelledButNotYetPolled: case State::kCancelledButNotYetPolled:
return; return;
@ -348,8 +349,7 @@ void BaseCallData::SendMessage::GotPipe(PipeReceiver<MessageHandle>* receiver) {
case State::kForwardedBatch: case State::kForwardedBatch:
case State::kBatchCompleted: case State::kBatchCompleted:
case State::kPushedToPipe: case State::kPushedToPipe:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kCancelled: case State::kCancelled:
case State::kCancelledButNotYetPolled: case State::kCancelledButNotYetPolled:
return; return;
@ -388,8 +388,7 @@ void BaseCallData::SendMessage::OnComplete(absl::Status status) {
case State::kPushedToPipe: case State::kPushedToPipe:
case State::kGotBatch: case State::kGotBatch:
case State::kBatchCompleted: case State::kBatchCompleted:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
break; break;
case State::kCancelled: case State::kCancelled:
case State::kCancelledButNotYetPolled: case State::kCancelledButNotYetPolled:
@ -422,8 +421,7 @@ void BaseCallData::SendMessage::Done(const ServerMetadata& metadata) {
case State::kGotBatchNoPipe: case State::kGotBatchNoPipe:
case State::kGotBatch: case State::kGotBatch:
case State::kBatchCompleted: case State::kBatchCompleted:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
break; break;
case State::kPushedToPipe: case State::kPushedToPipe:
push_.reset(); push_.reset();
@ -574,8 +572,7 @@ void BaseCallData::ReceiveMessage::StartOp(CapturedBatch& batch) {
case State::kPulledFromPipe: case State::kPulledFromPipe:
case State::kCompletedWhilePulledFromPipe: case State::kCompletedWhilePulledFromPipe:
case State::kCompletedWhilePushedToPipe: case State::kCompletedWhilePushedToPipe:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kCancelledWhilstIdle: case State::kCancelledWhilstIdle:
case State::kCancelled: case State::kCancelled:
return; return;
@ -616,8 +613,7 @@ void BaseCallData::ReceiveMessage::GotPipe(PipeSender<MessageHandle>* sender) {
case State::kCancelledWhilstForwarding: case State::kCancelledWhilstForwarding:
case State::kCancelledWhilstIdle: case State::kCancelledWhilstIdle:
case State::kBatchCompletedButCancelled: case State::kBatchCompletedButCancelled:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kCancelled: case State::kCancelled:
return; return;
} }
@ -642,8 +638,7 @@ void BaseCallData::ReceiveMessage::OnComplete(absl::Status status) {
case State::kCancelledWhilstIdle: case State::kCancelledWhilstIdle:
case State::kCompletedWhilePulledFromPipe: case State::kCompletedWhilePulledFromPipe:
case State::kCompletedWhilePushedToPipe: case State::kCompletedWhilePushedToPipe:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kForwardedBatchNoPipe: case State::kForwardedBatchNoPipe:
state_ = State::kBatchCompletedNoPipe; state_ = State::kBatchCompletedNoPipe;
return; return;
@ -702,8 +697,7 @@ void BaseCallData::ReceiveMessage::Done(const ServerMetadata& metadata,
case State::kBatchCompleted: case State::kBatchCompleted:
case State::kBatchCompletedNoPipe: case State::kBatchCompletedNoPipe:
case State::kBatchCompletedButCancelled: case State::kBatchCompletedButCancelled:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", StateString(state_)); Crash(absl::StrFormat("ILLEGAL STATE: %s", StateString(state_)));
abort();
case State::kCancelledWhilstIdle: case State::kCancelledWhilstIdle:
case State::kCancelledWhilstForwarding: case State::kCancelledWhilstForwarding:
case State::kCancelled: case State::kCancelled:
@ -994,10 +988,10 @@ class ClientCallData::PollContext {
case RecvInitialMetadata:: case RecvInitialMetadata::
kRespondedToTrailingMetadataPriorToHook: kRespondedToTrailingMetadataPriorToHook:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(absl::StrFormat("ILLEGAL STATE: %s",
RecvInitialMetadata::StateString( RecvInitialMetadata::StateString(
self_->recv_initial_metadata_->state)); self_->recv_initial_metadata_
abort(); // not reachable ->state))); // not reachable
break; break;
case RecvInitialMetadata::kHookedWaitingForLatch: case RecvInitialMetadata::kHookedWaitingForLatch:
case RecvInitialMetadata::kHookedAndGotLatch: case RecvInitialMetadata::kHookedAndGotLatch:
@ -1033,10 +1027,10 @@ class ClientCallData::PollContext {
case RecvInitialMetadata:: case RecvInitialMetadata::
kRespondedToTrailingMetadataPriorToHook: kRespondedToTrailingMetadataPriorToHook:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(absl::StrFormat("ILLEGAL STATE: %s",
RecvInitialMetadata::StateString( RecvInitialMetadata::StateString(
self_->recv_initial_metadata_->state)); self_->recv_initial_metadata_
abort(); // not reachable ->state))); // not reachable
break; break;
case RecvInitialMetadata::kCompleteWaitingForLatch: case RecvInitialMetadata::kCompleteWaitingForLatch:
case RecvInitialMetadata::kCompleteAndGotLatch: case RecvInitialMetadata::kCompleteAndGotLatch:
@ -1263,10 +1257,10 @@ void ClientCallData::StartBatch(grpc_transport_stream_op_batch* b) {
case RecvInitialMetadata::kCompleteAndSetLatch: case RecvInitialMetadata::kCompleteAndSetLatch:
case RecvInitialMetadata::kResponded: case RecvInitialMetadata::kResponded:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
RecvInitialMetadata::StateString(recv_initial_metadata_->state)); RecvInitialMetadata::StateString(
abort(); // unreachable recv_initial_metadata_->state))); // unreachable
} }
if (hook) { if (hook) {
auto cb = [](void* ptr, grpc_error_handle error) { auto cb = [](void* ptr, grpc_error_handle error) {
@ -1383,10 +1377,9 @@ void ClientCallData::Cancel(grpc_error_handle error, Flusher* flusher) {
case RecvInitialMetadata::kResponded: case RecvInitialMetadata::kResponded:
break; break;
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
RecvInitialMetadata::StateString(recv_initial_metadata_->state)); RecvInitialMetadata::StateString(recv_initial_metadata_->state)));
abort();
break; break;
} }
} }
@ -1441,10 +1434,10 @@ void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) {
case RecvInitialMetadata::kResponded: case RecvInitialMetadata::kResponded:
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook: case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
RecvInitialMetadata::StateString(recv_initial_metadata_->state)); RecvInitialMetadata::StateString(
abort(); // unreachable recv_initial_metadata_->state))); // unreachable
} }
flusher.AddClosure( flusher.AddClosure(
std::exchange(recv_initial_metadata_->original_on_ready, nullptr), std::exchange(recv_initial_metadata_->original_on_ready, nullptr),
@ -1473,10 +1466,10 @@ void ClientCallData::RecvInitialMetadataReady(grpc_error_handle error) {
case RecvInitialMetadata::kResponded: case RecvInitialMetadata::kResponded:
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook: case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
RecvInitialMetadata::StateString(recv_initial_metadata_->state)); RecvInitialMetadata::StateString(
abort(); // unreachable recv_initial_metadata_->state))); // unreachable
} }
} }
WakeInsideCombiner(&flusher); WakeInsideCombiner(&flusher);
@ -1537,10 +1530,10 @@ ArenaPromise<ServerMetadataHandle> ClientCallData::MakeNextPromise(
case RecvInitialMetadata::kResponded: case RecvInitialMetadata::kResponded:
case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook: case RecvInitialMetadata::kRespondedToTrailingMetadataPriorToHook:
case RecvInitialMetadata::kRespondedButNeedToSetLatch: case RecvInitialMetadata::kRespondedButNeedToSetLatch:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
RecvInitialMetadata::StateString(recv_initial_metadata_->state)); RecvInitialMetadata::StateString(
abort(); // unreachable recv_initial_metadata_->state))); // unreachable
} }
} else { } else {
GPR_ASSERT(call_args.server_initial_metadata == nullptr); GPR_ASSERT(call_args.server_initial_metadata == nullptr);
@ -1602,9 +1595,8 @@ Poll<ServerMetadataHandle> ClientCallData::PollTrailingMetadata() {
case RecvTrailingState::kResponded: case RecvTrailingState::kResponded:
// We've already responded to the caller: we can't do anything and we // We've already responded to the caller: we can't do anything and we
// should never reach here. // should never reach here.
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(absl::StrFormat("ILLEGAL STATE: %s",
StateString(recv_trailing_state_)); StateString(recv_trailing_state_)));
abort();
} }
GPR_UNREACHABLE_CODE(return Pending{}); GPR_UNREACHABLE_CODE(return Pending{});
} }
@ -1903,10 +1895,10 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
case SendInitialMetadata::kQueuedWaitingForLatch: case SendInitialMetadata::kQueuedWaitingForLatch:
case SendInitialMetadata::kQueuedAndSetLatch: case SendInitialMetadata::kQueuedAndSetLatch:
case SendInitialMetadata::kForwarded: case SendInitialMetadata::kForwarded:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
SendInitialMetadata::StateString(send_initial_metadata_->state)); SendInitialMetadata::StateString(
abort(); // not reachable send_initial_metadata_->state))); // not reachable
} }
send_initial_metadata_->batch = batch; send_initial_metadata_->batch = batch;
wake = true; wake = true;
@ -1942,9 +1934,9 @@ void ServerCallData::StartBatch(grpc_transport_stream_op_batch* b) {
case SendTrailingState::kQueued: case SendTrailingState::kQueued:
case SendTrailingState::kQueuedBehindSendMessage: case SendTrailingState::kQueuedBehindSendMessage:
case SendTrailingState::kForwarded: case SendTrailingState::kForwarded:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(
StateString(send_trailing_state_)); absl::StrFormat("ILLEGAL STATE: %s",
abort(); // unreachable StateString(send_trailing_state_))); // unreachable
break; break;
case SendTrailingState::kCancelled: case SendTrailingState::kCancelled:
batch.CancelWith( batch.CancelWith(
@ -2022,10 +2014,10 @@ ArenaPromise<ServerMetadataHandle> ServerCallData::MakeNextPromise(
case SendInitialMetadata::kQueuedAndGotLatch: case SendInitialMetadata::kQueuedAndGotLatch:
case SendInitialMetadata::kQueuedAndSetLatch: case SendInitialMetadata::kQueuedAndSetLatch:
case SendInitialMetadata::kForwarded: case SendInitialMetadata::kForwarded:
gpr_log( Crash(absl::StrFormat(
GPR_ERROR, "ILLEGAL STATE: %s", "ILLEGAL STATE: %s",
SendInitialMetadata::StateString(send_initial_metadata_->state)); SendInitialMetadata::StateString(
abort(); // not reachable send_initial_metadata_->state))); // not reachable
break; break;
case SendInitialMetadata::kQueuedWaitingForLatch: case SendInitialMetadata::kQueuedWaitingForLatch:
send_initial_metadata_->state = SendInitialMetadata::kQueuedAndGotLatch; send_initial_metadata_->state = SendInitialMetadata::kQueuedAndGotLatch;
@ -2062,9 +2054,8 @@ Poll<ServerMetadataHandle> ServerCallData::PollTrailingMetadata() {
return WrapMetadata(send_trailing_metadata_batch_->payload return WrapMetadata(send_trailing_metadata_batch_->payload
->send_trailing_metadata.send_trailing_metadata); ->send_trailing_metadata.send_trailing_metadata);
case SendTrailingState::kForwarded: case SendTrailingState::kForwarded:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(absl::StrFormat("ILLEGAL STATE: %s",
StateString(send_trailing_state_)); StateString(send_trailing_state_))); // unreachable
abort(); // unreachable
case SendTrailingState::kCancelled: case SendTrailingState::kCancelled:
// We could translate cancelled_error to metadata and return it... BUT // We could translate cancelled_error to metadata and return it... BUT
// we're not gonna be running much longer and the results going to be // we're not gonna be running much longer and the results going to be
@ -2233,9 +2224,9 @@ void ServerCallData::WakeInsideCombiner(Flusher* flusher) {
send_trailing_state_ = SendTrailingState::kForwarded; send_trailing_state_ = SendTrailingState::kForwarded;
} break; } break;
case SendTrailingState::kForwarded: case SendTrailingState::kForwarded:
gpr_log(GPR_ERROR, "ILLEGAL STATE: %s", Crash(absl::StrFormat(
StateString(send_trailing_state_)); "ILLEGAL STATE: %s",
abort(); // unreachable StateString(send_trailing_state_))); // unreachable
break; break;
case SendTrailingState::kInitial: { case SendTrailingState::kInitial: {
GPR_ASSERT(*md->get_pointer(GrpcStatusMetadata()) != GRPC_STATUS_OK); GPR_ASSERT(*md->get_pointer(GrpcStatusMetadata()) != GRPC_STATUS_OK);

@ -26,6 +26,7 @@
#include "absl/container/inlined_vector.h" #include "absl/container/inlined_vector.h"
#include "absl/strings/ascii.h" #include "absl/strings/ascii.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_split.h" #include "absl/strings/str_split.h"
#include "absl/types/variant.h" #include "absl/types/variant.h"
@ -33,6 +34,7 @@
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
namespace grpc_core { namespace grpc_core {
@ -112,9 +114,8 @@ CompressionAlgorithmSet::CompressionAlgorithmForLevel(
GRPC_API_TRACE("grpc_message_compression_algorithm_for_level(level=%d)", 1, GRPC_API_TRACE("grpc_message_compression_algorithm_for_level(level=%d)", 1,
((int)level)); ((int)level));
if (level > GRPC_COMPRESS_LEVEL_HIGH) { if (level > GRPC_COMPRESS_LEVEL_HIGH) {
gpr_log(GPR_ERROR, "Unknown message compression level %d.", Crash(absl::StrFormat("Unknown message compression level %d.",
static_cast<int>(level)); static_cast<int>(level)));
abort();
} }
if (level == GRPC_COMPRESS_LEVEL_NONE) { if (level == GRPC_COMPRESS_LEVEL_NONE) {

@ -22,6 +22,7 @@
#include "absl/status/status.h" #include "absl/status/status.h"
#include "absl/status/statusor.h" #include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include <grpc/event_engine/event_engine.h> #include <grpc/event_engine/event_engine.h>
#include <grpc/status.h> #include <grpc/status.h>
@ -30,6 +31,7 @@
#include "src/core/lib/event_engine/poller.h" #include "src/core/lib/event_engine/poller.h"
#include "src/core/lib/event_engine/time_util.h" #include "src/core/lib/event_engine/time_util.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
// This polling engine is only relevant on linux kernels supporting epoll // This polling engine is only relevant on linux kernels supporting epoll
@ -463,10 +465,9 @@ int Epoll1Poller::DoEpollWait(EventEngine::Duration timeout) {
grpc_event_engine::experimental::Milliseconds(timeout))); grpc_event_engine::experimental::Milliseconds(timeout)));
} while (r < 0 && errno == EINTR); } while (r < 0 && errno == EINTR);
if (r < 0) { if (r < 0) {
gpr_log(GPR_ERROR, grpc_core::Crash(absl::StrFormat(
"(event_engine) Epoll1Poller:%p encountered epoll_wait error: %s", "(event_engine) Epoll1Poller:%p encountered epoll_wait error: %s", this,
this, grpc_core::StrError(errno).c_str()); grpc_core::StrError(errno).c_str()));
GPR_ASSERT(false);
} }
g_epoll_set_.num_events = r; g_epoll_set_.num_events = r;
g_epoll_set_.cursor = 0; g_epoll_set_.cursor = 0;
@ -573,34 +574,34 @@ using ::grpc_event_engine::experimental::EventEngine;
using ::grpc_event_engine::experimental::Poller; using ::grpc_event_engine::experimental::Poller;
Epoll1Poller::Epoll1Poller(Scheduler* /* engine */) { Epoll1Poller::Epoll1Poller(Scheduler* /* engine */) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void Epoll1Poller::Shutdown() { GPR_ASSERT(false && "unimplemented"); } void Epoll1Poller::Shutdown() { grpc_core::Crash("unimplemented"); }
Epoll1Poller::~Epoll1Poller() { GPR_ASSERT(false && "unimplemented"); } Epoll1Poller::~Epoll1Poller() { grpc_core::Crash("unimplemented"); }
EventHandle* Epoll1Poller::CreateHandle(int /*fd*/, absl::string_view /*name*/, EventHandle* Epoll1Poller::CreateHandle(int /*fd*/, absl::string_view /*name*/,
bool /*track_err*/) { bool /*track_err*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool Epoll1Poller::ProcessEpollEvents(int /*max_epoll_events_to_handle*/, bool Epoll1Poller::ProcessEpollEvents(int /*max_epoll_events_to_handle*/,
Events& /*pending_events*/) { Events& /*pending_events*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
int Epoll1Poller::DoEpollWait(EventEngine::Duration /*timeout*/) { int Epoll1Poller::DoEpollWait(EventEngine::Duration /*timeout*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
Poller::WorkResult Epoll1Poller::Work( Poller::WorkResult Epoll1Poller::Work(
EventEngine::Duration /*timeout*/, EventEngine::Duration /*timeout*/,
absl::FunctionRef<void()> /*schedule_poll_again*/) { absl::FunctionRef<void()> /*schedule_poll_again*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void Epoll1Poller::Kick() { GPR_ASSERT(false && "unimplemented"); } void Epoll1Poller::Kick() { grpc_core::Crash("unimplemented"); }
// If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return // If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
// nullptr. // nullptr.

@ -17,7 +17,6 @@
#include "src/core/lib/event_engine/posix_engine/ev_poll_posix.h" #include "src/core/lib/event_engine/posix_engine/ev_poll_posix.h"
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
#include <atomic> #include <atomic>
#include <list> #include <list>
@ -28,6 +27,7 @@
#include "absl/functional/any_invocable.h" #include "absl/functional/any_invocable.h"
#include "absl/status/status.h" #include "absl/status/status.h"
#include "absl/status/statusor.h" #include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include <grpc/event_engine/event_engine.h> #include <grpc/event_engine/event_engine.h>
#include <grpc/status.h> #include <grpc/status.h>
@ -38,6 +38,7 @@
#include "src/core/lib/event_engine/poller.h" #include "src/core/lib/event_engine/poller.h"
#include "src/core/lib/event_engine/posix_engine/event_poller.h" #include "src/core/lib/event_engine/posix_engine/event_poller.h"
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h" #include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
@ -415,10 +416,9 @@ int PollEventHandle::NotifyOnLocked(PosixEngineClosure** st,
return 1; return 1;
} else { } else {
// upcallptr was set to a different closure. This is an error! // upcallptr was set to a different closure. This is an error!
gpr_log(GPR_ERROR, grpc_core::Crash(
"User called a notify_on function with a previous callback still " "User called a notify_on function with a previous callback still "
"pending"); "pending");
abort();
} }
return 0; return 0;
} }
@ -719,18 +719,15 @@ Poller::WorkResult PollPoller::Work(
// may crash. // may crash.
r = poll(pfds, pfd_count, timeout_ms); r = poll(pfds, pfd_count, timeout_ms);
} else { } else {
gpr_log(GPR_ERROR, grpc_core::Crash("Attempted a blocking poll when declared non-polling.");
"Attempted a blocking poll when declared non-polling.");
GPR_ASSERT(false);
} }
if (r <= 0) { if (r <= 0) {
if (r < 0 && errno != EINTR) { if (r < 0 && errno != EINTR) {
// Abort fail here. // Abort fail here.
gpr_log(GPR_ERROR, grpc_core::Crash(absl::StrFormat(
"(event_engine) PollPoller:%p encountered poll error: %s", this, "(event_engine) PollPoller:%p encountered poll error: %s", this,
grpc_core::StrError(errno).c_str()); grpc_core::StrError(errno).c_str()));
GPR_ASSERT(false);
} }
for (i = 1; i < pfd_count; i++) { for (i = 1; i < pfd_count; i++) {
@ -852,29 +849,31 @@ PollPoller* MakePollPoller(Scheduler* scheduler, bool use_phony_poll) {
#else // GRPC_POSIX_SOCKET_EV_POLL #else // GRPC_POSIX_SOCKET_EV_POLL
#include "src/core/lib/gprpp/crash.h"
namespace grpc_event_engine { namespace grpc_event_engine {
namespace experimental { namespace experimental {
PollPoller::PollPoller(Scheduler* /* engine */) { PollPoller::PollPoller(Scheduler* /* engine */) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void PollPoller::Shutdown() { GPR_ASSERT(false && "unimplemented"); } void PollPoller::Shutdown() { grpc_core::Crash("unimplemented"); }
PollPoller::~PollPoller() { GPR_ASSERT(false && "unimplemented"); } PollPoller::~PollPoller() { grpc_core::Crash("unimplemented"); }
EventHandle* PollPoller::CreateHandle(int /*fd*/, absl::string_view /*name*/, EventHandle* PollPoller::CreateHandle(int /*fd*/, absl::string_view /*name*/,
bool /*track_err*/) { bool /*track_err*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
Poller::WorkResult PollPoller::Work( Poller::WorkResult PollPoller::Work(
EventEngine::Duration /*timeout*/, EventEngine::Duration /*timeout*/,
absl::FunctionRef<void()> /*schedule_poll_again*/) { absl::FunctionRef<void()> /*schedule_poll_again*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void PollPoller::Kick() { GPR_ASSERT(false && "unimplemented"); } void PollPoller::Kick() { grpc_core::Crash("unimplemented"); }
// If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return // If GRPC_LINUX_EPOLL is not defined, it means epoll is not available. Return
// nullptr. // nullptr.
@ -884,15 +883,15 @@ PollPoller* MakePollPoller(Scheduler* /*scheduler*/,
} }
void PollPoller::KickExternal(bool /*ext*/) { void PollPoller::KickExternal(bool /*ext*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void PollPoller::PollerHandlesListAddHandle(PollEventHandle* /*handle*/) { void PollPoller::PollerHandlesListAddHandle(PollEventHandle* /*handle*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void PollPoller::PollerHandlesListRemoveHandle(PollEventHandle* /*handle*/) { void PollPoller::PollerHandlesListRemoveHandle(PollEventHandle* /*handle*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
} // namespace experimental } // namespace experimental

@ -15,8 +15,6 @@
#include "src/core/lib/event_engine/posix_engine/lockfree_event.h" #include "src/core/lib/event_engine/posix_engine/lockfree_event.h"
#include <stdlib.h>
#include <atomic> #include <atomic>
#include <cstdint> #include <cstdint>
@ -27,6 +25,7 @@
#include "src/core/lib/event_engine/posix_engine/event_poller.h" #include "src/core/lib/event_engine/posix_engine/event_poller.h"
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h" #include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
// 'state' holds the to call when the fd is readable or writable respectively. // 'state' holds the to call when the fd is readable or writable respectively.
@ -149,10 +148,9 @@ void LockfreeEvent::NotifyOn(PosixEngineClosure* closure) {
} }
// There is already a closure!. This indicates a bug in the code. // There is already a closure!. This indicates a bug in the code.
gpr_log(GPR_ERROR, grpc_core::Crash(
"LockfreeEvent::NotifyOn: notify_on called with a previous " "LockfreeEvent::NotifyOn: notify_on called with a previous "
"callback still pending"); "callback still pending");
abort();
} }
} }
} }

@ -856,7 +856,7 @@ TcpZerocopySendRecord* PosixEndpointImpl::TcpGetSendZerocopyRecord(
} }
void PosixEndpointImpl::HandleError(absl::Status /*status*/) { void PosixEndpointImpl::HandleError(absl::Status /*status*/) {
GPR_ASSERT(false && "Error handling not supported on this platform"); grpc_core::Crash("Error handling not supported on this platform");
} }
void PosixEndpointImpl::ZerocopyDisableAndWaitForRemaining() {} void PosixEndpointImpl::ZerocopyDisableAndWaitForRemaining() {}
@ -866,7 +866,7 @@ bool PosixEndpointImpl::WriteWithTimestamps(struct msghdr* /*msg*/,
ssize_t* /*sent_length*/, ssize_t* /*sent_length*/,
int* /*saved_errno*/, int* /*saved_errno*/,
int /*additional_flags*/) { int /*additional_flags*/) {
GPR_ASSERT(false && "Write with timestamps not supported for this platform"); grpc_core::Crash("Write with timestamps not supported for this platform");
} }
#endif // GRPC_LINUX_ERRQUEUE #endif // GRPC_LINUX_ERRQUEUE
@ -1299,7 +1299,7 @@ std::unique_ptr<PosixEndpoint> CreatePosixEndpoint(
EventHandle* /*handle*/, PosixEngineClosure* /*on_shutdown*/, EventHandle* /*handle*/, PosixEngineClosure* /*on_shutdown*/,
std::shared_ptr<EventEngine> /*engine*/, std::shared_ptr<EventEngine> /*engine*/,
const PosixTcpOptions& /*options*/) { const PosixTcpOptions& /*options*/) {
GPR_ASSERT(false && "Cannot create PosixEndpoint on this platform"); grpc_core::Crash("Cannot create PosixEndpoint on this platform");
} }
} // namespace experimental } // namespace experimental

@ -42,6 +42,7 @@
#include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h" #include "src/core/lib/event_engine/posix_engine/posix_engine_closure.h"
#include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h"
#include "src/core/lib/event_engine/posix_engine/traced_buffer_list.h" #include "src/core/lib/event_engine/posix_engine/traced_buffer_list.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/ref_counted.h" #include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
@ -344,7 +345,7 @@ class TcpZerocopySendCtx {
// state was CHECK and is_in_write is false. This means that after the // state was CHECK and is_in_write is false. This means that after the
// previous sendmsg returned and set is_in_write to false, it did // previous sendmsg returned and set is_in_write to false, it did
// not update the z-copy change from CHECK to OPEN. // not update the z-copy change from CHECK to OPEN.
GPR_ASSERT(false && "OMem state error!"); grpc_core::Crash("OMem state error!");
} }
} }
@ -641,25 +642,25 @@ class PosixEndpoint
grpc_event_engine::experimental::SliceBuffer* /*buffer*/, grpc_event_engine::experimental::SliceBuffer* /*buffer*/,
const grpc_event_engine::experimental::EventEngine::Endpoint:: const grpc_event_engine::experimental::EventEngine::Endpoint::
ReadArgs* /*args*/) override { ReadArgs* /*args*/) override {
GPR_ASSERT(false && "PosixEndpoint::Read not supported on this platform"); grpc_core::Crash("PosixEndpoint::Read not supported on this platform");
} }
void Write(absl::AnyInvocable<void(absl::Status)> /*on_writable*/, void Write(absl::AnyInvocable<void(absl::Status)> /*on_writable*/,
grpc_event_engine::experimental::SliceBuffer* /*data*/, grpc_event_engine::experimental::SliceBuffer* /*data*/,
const grpc_event_engine::experimental::EventEngine::Endpoint:: const grpc_event_engine::experimental::EventEngine::Endpoint::
WriteArgs* /*args*/) override { WriteArgs* /*args*/) override {
GPR_ASSERT(false && "PosixEndpoint::Write not supported on this platform"); grpc_core::Crash("PosixEndpoint::Write not supported on this platform");
} }
const grpc_event_engine::experimental::EventEngine::ResolvedAddress& const grpc_event_engine::experimental::EventEngine::ResolvedAddress&
GetPeerAddress() const override { GetPeerAddress() const override {
GPR_ASSERT(false && grpc_core::Crash(
"PosixEndpoint::GetPeerAddress not supported on this platform"); "PosixEndpoint::GetPeerAddress not supported on this platform");
} }
const grpc_event_engine::experimental::EventEngine::ResolvedAddress& const grpc_event_engine::experimental::EventEngine::ResolvedAddress&
GetLocalAddress() const override { GetLocalAddress() const override {
GPR_ASSERT(false && grpc_core::Crash(
"PosixEndpoint::GetLocalAddress not supported on this platform"); "PosixEndpoint::GetLocalAddress not supported on this platform");
} }
~PosixEndpoint() override = default; ~PosixEndpoint() override = default;

@ -41,6 +41,7 @@
#include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/event_engine/trace.h" #include "src/core/lib/event_engine/trace.h"
#include "src/core/lib/event_engine/utils.h" #include "src/core/lib/event_engine/utils.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
#ifdef GRPC_POSIX_SOCKET_TCP #ifdef GRPC_POSIX_SOCKET_TCP
@ -465,12 +466,10 @@ EventEngine::TaskHandle PosixEventEngine::RunAfterInternal(
std::unique_ptr<EventEngine::DNSResolver> PosixEventEngine::GetDNSResolver( std::unique_ptr<EventEngine::DNSResolver> PosixEventEngine::GetDNSResolver(
EventEngine::DNSResolver::ResolverOptions const& /*options*/) { EventEngine::DNSResolver::ResolverOptions const& /*options*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool PosixEventEngine::IsWorkerThread() { bool PosixEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); }
GPR_ASSERT(false && "unimplemented");
}
bool PosixEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) { bool PosixEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) {
#ifdef GRPC_POSIX_SOCKET_TCP #ifdef GRPC_POSIX_SOCKET_TCP
@ -523,8 +522,8 @@ bool PosixEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) {
} }
return connection_cancel_success; return connection_cancel_success;
#else // GRPC_POSIX_SOCKET_TCP #else // GRPC_POSIX_SOCKET_TCP
GPR_ASSERT(false && grpc_core::Crash(
"EventEngine::CancelConnect is not supported on this platform"); "EventEngine::CancelConnect is not supported on this platform");
#endif // GRPC_POSIX_SOCKET_TCP #endif // GRPC_POSIX_SOCKET_TCP
} }
@ -546,7 +545,7 @@ EventEngine::ConnectionHandle PosixEventEngine::Connect(
(*socket).mapped_target_addr, (*socket).mapped_target_addr,
std::move(memory_allocator), options, timeout); std::move(memory_allocator), options, timeout);
#else // GRPC_POSIX_SOCKET_TCP #else // GRPC_POSIX_SOCKET_TCP
GPR_ASSERT(false && "EventEngine::Connect is not supported on this platform"); grpc_core::Crash("EventEngine::Connect is not supported on this platform");
#endif // GRPC_POSIX_SOCKET_TCP #endif // GRPC_POSIX_SOCKET_TCP
} }
@ -562,8 +561,8 @@ PosixEventEngine::CreateListener(
std::move(memory_allocator_factory), poller_manager_->Poller(), std::move(memory_allocator_factory), poller_manager_->Poller(),
shared_from_this()); shared_from_this());
#else // GRPC_POSIX_SOCKET_TCP #else // GRPC_POSIX_SOCKET_TCP
GPR_ASSERT(false && grpc_core::Crash(
"EventEngine::CreateListener is not supported on this platform"); "EventEngine::CreateListener is not supported on this platform");
#endif // GRPC_POSIX_SOCKET_TCP #endif // GRPC_POSIX_SOCKET_TCP
} }

@ -203,6 +203,8 @@ class PosixEngineListener
#else // GRPC_POSIX_SOCKET_TCP #else // GRPC_POSIX_SOCKET_TCP
#include "src/core/lib/gprpp/crash.h"
class PosixEngineListener class PosixEngineListener
: public grpc_event_engine::experimental::EventEngine::Listener { : public grpc_event_engine::experimental::EventEngine::Listener {
public: public:
@ -210,12 +212,12 @@ class PosixEngineListener
~PosixEngineListener() override = default; ~PosixEngineListener() override = default;
absl::StatusOr<int> Bind(const grpc_event_engine::experimental::EventEngine:: absl::StatusOr<int> Bind(const grpc_event_engine::experimental::EventEngine::
ResolvedAddress& /*addr*/) override { ResolvedAddress& /*addr*/) override {
GPR_ASSERT(false && grpc_core::Crash(
"EventEngine::Listener::Bind not supported on this platform"); "EventEngine::Listener::Bind not supported on this platform");
} }
absl::Status Start() override { absl::Status Start() override {
GPR_ASSERT(false && grpc_core::Crash(
"EventEngine::Listener::Start not supported on this platform"); "EventEngine::Listener::Start not supported on this platform");
} }
}; };

@ -31,6 +31,7 @@
#include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/posix_engine/tcp_socket_utils.h"
#include "src/core/lib/event_engine/tcp_socket_utils.h" #include "src/core/lib/event_engine/tcp_socket_utils.h"
#include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/socket_mutator.h" #include "src/core/lib/iomgr/socket_mutator.h"
@ -288,7 +289,7 @@ absl::StatusOr<int> ListenerContainerAddAllLocalAddresses(
(void)listener_sockets; (void)listener_sockets;
(void)options; (void)options;
(void)requested_port; (void)requested_port;
GPR_ASSERT(false && "System does not support ifaddrs"); grpc_core::Crash("System does not support ifaddrs");
#endif #endif
} }
@ -353,25 +354,24 @@ absl::StatusOr<ListenerSocketsContainer::ListenerSocket>
CreateAndPrepareListenerSocket(const PosixTcpOptions& /*options*/, CreateAndPrepareListenerSocket(const PosixTcpOptions& /*options*/,
const grpc_event_engine::experimental:: const grpc_event_engine::experimental::
EventEngine::ResolvedAddress& /*addr*/) { EventEngine::ResolvedAddress& /*addr*/) {
GPR_ASSERT( grpc_core::Crash(
false &&
"CreateAndPrepareListenerSocket is not supported on this platform"); "CreateAndPrepareListenerSocket is not supported on this platform");
} }
absl::StatusOr<int> ListenerContainerAddWildcardAddresses( absl::StatusOr<int> ListenerContainerAddWildcardAddresses(
ListenerSocketsContainer& /*listener_sockets*/, ListenerSocketsContainer& /*listener_sockets*/,
const PosixTcpOptions& /*options*/, int /*requested_port*/) { const PosixTcpOptions& /*options*/, int /*requested_port*/) {
GPR_ASSERT(false && grpc_core::Crash(
"ListenerContainerAddWildcardAddresses is not supported on this " "ListenerContainerAddWildcardAddresses is not supported on this "
"platform"); "platform");
} }
absl::StatusOr<int> ListenerContainerAddAllLocalAddresses( absl::StatusOr<int> ListenerContainerAddAllLocalAddresses(
ListenerSocketsContainer& /*listener_sockets*/, ListenerSocketsContainer& /*listener_sockets*/,
const PosixTcpOptions& /*options*/, int /*requested_port*/) { const PosixTcpOptions& /*options*/, int /*requested_port*/) {
GPR_ASSERT(false && grpc_core::Crash(
"ListenerContainerAddAllLocalAddresses is not supported on this " "ListenerContainerAddAllLocalAddresses is not supported on this "
"platform"); "platform");
} }
#endif // GRPC_POSIX_SOCKET_UTILS_COMMON #endif // GRPC_POSIX_SOCKET_UTILS_COMMON

@ -29,6 +29,7 @@
#include <grpc/event_engine/event_engine.h> #include <grpc/event_engine/event_engine.h>
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON #ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
@ -753,31 +754,31 @@ PosixSocketWrapper::CreateAndPrepareTcpClientSocket(
#else // GRPC_POSIX_SOCKET_UTILS_COMMON #else // GRPC_POSIX_SOCKET_UTILS_COMMON
absl::StatusOr<int> PosixSocketWrapper::SetSocketRcvLowat(int /*bytes*/) { absl::StatusOr<int> PosixSocketWrapper::SetSocketRcvLowat(int /*bytes*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketZeroCopy() { absl::Status PosixSocketWrapper::SetSocketZeroCopy() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketNonBlocking(int /*non_blocking*/) { absl::Status PosixSocketWrapper::SetSocketNonBlocking(int /*non_blocking*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketCloexec(int /*close_on_exec*/) { absl::Status PosixSocketWrapper::SetSocketCloexec(int /*close_on_exec*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketReuseAddr(int /*reuse*/) { absl::Status PosixSocketWrapper::SetSocketReuseAddr(int /*reuse*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketLowLatency(int /*low_latency*/) { absl::Status PosixSocketWrapper::SetSocketLowLatency(int /*low_latency*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketReusePort(int /*reuse*/) { absl::Status PosixSocketWrapper::SetSocketReusePort(int /*reuse*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
void PosixSocketWrapper::ConfigureDefaultTcpUserTimeout(bool /*enable*/, void PosixSocketWrapper::ConfigureDefaultTcpUserTimeout(bool /*enable*/,
@ -786,49 +787,49 @@ void PosixSocketWrapper::ConfigureDefaultTcpUserTimeout(bool /*enable*/,
void PosixSocketWrapper::TrySetSocketTcpUserTimeout( void PosixSocketWrapper::TrySetSocketTcpUserTimeout(
const PosixTcpOptions& /*options*/, bool /*is_client*/) { const PosixTcpOptions& /*options*/, bool /*is_client*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketNoSigpipeIfPossible() { absl::Status PosixSocketWrapper::SetSocketNoSigpipeIfPossible() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketIpPktInfoIfPossible() { absl::Status PosixSocketWrapper::SetSocketIpPktInfoIfPossible() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketIpv6RecvPktInfoIfPossible() { absl::Status PosixSocketWrapper::SetSocketIpv6RecvPktInfoIfPossible() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketSndBuf(int /*buffer_size_bytes*/) { absl::Status PosixSocketWrapper::SetSocketSndBuf(int /*buffer_size_bytes*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketRcvBuf(int /*buffer_size_bytes*/) { absl::Status PosixSocketWrapper::SetSocketRcvBuf(int /*buffer_size_bytes*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::SetSocketMutator( absl::Status PosixSocketWrapper::SetSocketMutator(
grpc_fd_usage /*usage*/, grpc_socket_mutator* /*mutator*/) { grpc_fd_usage /*usage*/, grpc_socket_mutator* /*mutator*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PosixSocketWrapper::ApplySocketMutatorInOptions( absl::Status PosixSocketWrapper::ApplySocketMutatorInOptions(
grpc_fd_usage /*usage*/, const PosixTcpOptions& /*options*/) { grpc_fd_usage /*usage*/, const PosixTcpOptions& /*options*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool PosixSocketWrapper::SetSocketDualStack() { bool PosixSocketWrapper::SetSocketDualStack() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool PosixSocketWrapper::IsSocketReusePortSupported() { bool PosixSocketWrapper::IsSocketReusePortSupported() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool PosixSocketWrapper::IsIpv6LoopbackAvailable() { bool PosixSocketWrapper::IsIpv6LoopbackAvailable() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::StatusOr<PosixSocketWrapper> PosixSocketWrapper::CreateDualStackSocket( absl::StatusOr<PosixSocketWrapper> PosixSocketWrapper::CreateDualStackSocket(
@ -836,14 +837,14 @@ absl::StatusOr<PosixSocketWrapper> PosixSocketWrapper::CreateDualStackSocket(
/* socket_factory */, /* socket_factory */,
const experimental::EventEngine::ResolvedAddress& /*addr*/, int /*type*/, const experimental::EventEngine::ResolvedAddress& /*addr*/, int /*type*/,
int /*protocol*/, DSMode& /*dsmode*/) { int /*protocol*/, DSMode& /*dsmode*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::StatusOr<PosixSocketWrapper::PosixSocketCreateResult> absl::StatusOr<PosixSocketWrapper::PosixSocketCreateResult>
PosixSocketWrapper::CreateAndPrepareTcpClientSocket( PosixSocketWrapper::CreateAndPrepareTcpClientSocket(
const PosixTcpOptions& /*options*/, const PosixTcpOptions& /*options*/,
const EventEngine::ResolvedAddress& /*target_addr*/) { const EventEngine::ResolvedAddress& /*target_addr*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
#endif // GRPC_POSIX_SOCKET_UTILS_COMMON #endif // GRPC_POSIX_SOCKET_UTILS_COMMON

@ -316,12 +316,14 @@ void TcpSetWriteTimestampsCallback(
#else // GRPC_LINUX_ERRQUEUE #else // GRPC_LINUX_ERRQUEUE
#include "src/core/lib/gprpp/crash.h"
namespace grpc_event_engine { namespace grpc_event_engine {
namespace experimental { namespace experimental {
void TcpSetWriteTimestampsCallback( void TcpSetWriteTimestampsCallback(
absl::AnyInvocable<void(void*, Timestamps*, absl::Status)> /*fn*/) { absl::AnyInvocable<void(void*, Timestamps*, absl::Status)> /*fn*/) {
GPR_ASSERT(false && "Timestamps callback is not enabled for this platform"); grpc_core::Crash("Timestamps callback is not enabled for this platform");
} }
} // namespace experimental } // namespace experimental

@ -19,8 +19,7 @@
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include <grpc/support/log.h> // IWYU pragma: keep #include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#ifdef GRPC_LINUX_EVENTFD #ifdef GRPC_LINUX_EVENTFD
@ -105,13 +104,15 @@ EventFdWakeupFd::CreateEventFdWakeupFd() {
#else // GRPC_LINUX_EVENTFD #else // GRPC_LINUX_EVENTFD
absl::Status EventFdWakeupFd::Init() { GPR_ASSERT(false && "unimplemented"); } #include "src/core/lib/gprpp/crash.h"
absl::Status EventFdWakeupFd::Init() { grpc_core::Crash("unimplemented"); }
absl::Status EventFdWakeupFd::ConsumeWakeup() { absl::Status EventFdWakeupFd::ConsumeWakeup() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status EventFdWakeupFd::Wakeup() { GPR_ASSERT(false && "unimplemented"); } absl::Status EventFdWakeupFd::Wakeup() { grpc_core::Crash("unimplemented"); }
bool EventFdWakeupFd::IsSupported() { return false; } bool EventFdWakeupFd::IsSupported() { return false; }

@ -20,8 +20,7 @@
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include <grpc/support/log.h> // IWYU pragma: keep #include "src/core/lib/gprpp/crash.h" // IWYU pragma: keep
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_WAKEUP_FD #ifdef GRPC_POSIX_WAKEUP_FD
@ -131,13 +130,13 @@ absl::StatusOr<std::unique_ptr<WakeupFd>> PipeWakeupFd::CreatePipeWakeupFd() {
#else // GRPC_POSIX_WAKEUP_FD #else // GRPC_POSIX_WAKEUP_FD
absl::Status PipeWakeupFd::Init() { GPR_ASSERT(false && "unimplemented"); } absl::Status PipeWakeupFd::Init() { grpc_core::Crash("unimplemented"); }
absl::Status PipeWakeupFd::ConsumeWakeup() { absl::Status PipeWakeupFd::ConsumeWakeup() {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::Status PipeWakeupFd::Wakeup() { GPR_ASSERT(false && "unimplemented"); } absl::Status PipeWakeupFd::Wakeup() { grpc_core::Crash("unimplemented"); }
bool PipeWakeupFd::IsSupported() { return false; } bool PipeWakeupFd::IsSupported() { return false; }

@ -26,6 +26,7 @@
#include "src/core/lib/event_engine/trace.h" #include "src/core/lib/event_engine/trace.h"
#include "src/core/lib/event_engine/windows/iocp.h" #include "src/core/lib/event_engine/windows/iocp.h"
#include "src/core/lib/event_engine/windows/win_socket.h" #include "src/core/lib/event_engine/windows/win_socket.h"
#include "src/core/lib/gprpp/crash.h"
namespace grpc_event_engine { namespace grpc_event_engine {
namespace experimental { namespace experimental {
@ -94,8 +95,8 @@ Poller::WorkResult IOCP::Work(EventEngine::Duration timeout,
if (completion_key == (ULONG_PTR)&kick_token_) { if (completion_key == (ULONG_PTR)&kick_token_) {
return Poller::WorkResult::kKicked; return Poller::WorkResult::kKicked;
} }
gpr_log(GPR_ERROR, "Unknown custom completion key: %p", completion_key); grpc_core::Crash(
abort(); absl::StrFormat("Unknown custom completion key: %p", completion_key));
} }
if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) { if (GRPC_TRACE_FLAG_ENABLED(grpc_event_engine_trace)) {
gpr_log(GPR_DEBUG, "IOCP::%p got event on OVERLAPPED::%p", this, gpr_log(GPR_DEBUG, "IOCP::%p got event on OVERLAPPED::%p", this,

@ -43,9 +43,9 @@ constexpr int64_t kDefaultTargetReadSize = 8192;
constexpr int kMaxWSABUFCount = 16; constexpr int kMaxWSABUFCount = 16;
void AbortOnEvent(absl::Status) { void AbortOnEvent(absl::Status) {
GPR_ASSERT(false && grpc_core::Crash(
"INTERNAL ERROR: Asked to handle read/write event with an invalid " "INTERNAL ERROR: Asked to handle read/write event with an invalid "
"callback"); "callback");
} }
} // namespace } // namespace
@ -63,8 +63,7 @@ WindowsEndpoint::WindowsEndpoint(
sockaddr addr; sockaddr addr;
int addr_len = sizeof(addr); int addr_len = sizeof(addr);
if (getsockname(socket_->socket(), &addr, &addr_len) < 0) { if (getsockname(socket_->socket(), &addr, &addr_len) < 0) {
gpr_log(GPR_ERROR, "Unrecoverable error: Failed to get local socket name."); grpc_core::Crash("Unrecoverable error: Failed to get local socket name.");
abort();
} }
local_address_ = EventEngine::ResolvedAddress(&addr, addr_len); local_address_ = EventEngine::ResolvedAddress(&addr, addr_len);
local_address_string_ = *ResolvedAddressToURI(local_address_); local_address_string_ = *ResolvedAddressToURI(local_address_);

@ -32,6 +32,7 @@
#include "src/core/lib/event_engine/utils.h" #include "src/core/lib/event_engine/utils.h"
#include "src/core/lib/event_engine/windows/iocp.h" #include "src/core/lib/event_engine/windows/iocp.h"
#include "src/core/lib/event_engine/windows/windows_engine.h" #include "src/core/lib/event_engine/windows/windows_engine.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time.h"
@ -133,22 +134,20 @@ EventEngine::TaskHandle WindowsEventEngine::RunAfterInternal(
std::unique_ptr<EventEngine::DNSResolver> WindowsEventEngine::GetDNSResolver( std::unique_ptr<EventEngine::DNSResolver> WindowsEventEngine::GetDNSResolver(
EventEngine::DNSResolver::ResolverOptions const& /*options*/) { EventEngine::DNSResolver::ResolverOptions const& /*options*/) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
bool WindowsEventEngine::IsWorkerThread() { bool WindowsEventEngine::IsWorkerThread() { grpc_core::Crash("unimplemented"); }
GPR_ASSERT(false && "unimplemented");
}
bool WindowsEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) { bool WindowsEventEngine::CancelConnect(EventEngine::ConnectionHandle handle) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
EventEngine::ConnectionHandle WindowsEventEngine::Connect( EventEngine::ConnectionHandle WindowsEventEngine::Connect(
OnConnectCallback on_connect, const ResolvedAddress& addr, OnConnectCallback on_connect, const ResolvedAddress& addr,
const EndpointConfig& args, MemoryAllocator memory_allocator, const EndpointConfig& args, MemoryAllocator memory_allocator,
Duration deadline) { Duration deadline) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
absl::StatusOr<std::unique_ptr<EventEngine::Listener>> absl::StatusOr<std::unique_ptr<EventEngine::Listener>>
@ -157,7 +156,7 @@ WindowsEventEngine::CreateListener(
absl::AnyInvocable<void(absl::Status)> on_shutdown, absl::AnyInvocable<void(absl::Status)> on_shutdown,
const EndpointConfig& config, const EndpointConfig& config,
std::unique_ptr<MemoryAllocatorFactory> memory_allocator_factory) { std::unique_ptr<MemoryAllocatorFactory> memory_allocator_factory) {
GPR_ASSERT(false && "unimplemented"); grpc_core::Crash("unimplemented");
} }
} // namespace experimental } // namespace experimental

@ -24,6 +24,8 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
void* gpr_malloc(size_t size) { void* gpr_malloc(size_t size) {
void* p; void* p;
if (size == 0) return nullptr; if (size == 0) return nullptr;

@ -33,6 +33,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/strerror.h"
static int ncpus = 0; static int ncpus = 0;

@ -30,6 +30,7 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
static long ncpus = 0; static long ncpus = 0;

@ -22,6 +22,8 @@
#include <grpc/support/cpu.h> #include <grpc/support/cpu.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
unsigned gpr_cpu_num_cores(void) { unsigned gpr_cpu_num_cores(void) {
SYSTEM_INFO si; SYSTEM_INFO si;
GetSystemInfo(&si); GetSystemInfo(&si);

@ -21,11 +21,14 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "absl/strings/str_cat.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/atm.h> #include <grpc/support/atm.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h" #include "src/core/lib/gprpp/global_config.h"
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING #ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
@ -48,8 +51,13 @@ static gpr_atm g_min_severity_to_print = GPR_LOG_SEVERITY_UNSET;
static gpr_atm g_min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_UNSET; static gpr_atm g_min_severity_to_print_stacktrace = GPR_LOG_SEVERITY_UNSET;
void gpr_unreachable_code(const char* reason, const char* file, int line) { void gpr_unreachable_code(const char* reason, const char* file, int line) {
gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "UNREACHABLE CODE: %s", reason); grpc_core::Crash(absl::StrCat("UNREACHABLE CODE: ", reason),
abort(); grpc_core::SourceLocation(file, line));
}
void gpr_assertion_failed(const char* filename, int line, const char* message) {
grpc_core::Crash(absl::StrCat("ASSERTION FAILED: ", message),
grpc_core::SourceLocation(filename, line));
} }
const char* gpr_log_severity_string(gpr_log_severity severity) { const char* gpr_log_severity_string(gpr_log_severity severity) {

@ -28,6 +28,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
static android_LogPriority severity_to_log_priority(gpr_log_severity severity) { static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
switch (severity) { switch (severity) {
case GPR_LOG_SEVERITY_DEBUG: case GPR_LOG_SEVERITY_DEBUG:

@ -44,6 +44,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/examine_stack.h" #include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity); int gpr_should_log_stacktrace(gpr_log_severity severity);

@ -35,6 +35,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/examine_stack.h" #include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity); int gpr_should_log_stacktrace(gpr_log_severity severity);

@ -30,6 +30,7 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/examine_stack.h" #include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity); int gpr_should_log_stacktrace(gpr_log_severity severity);

@ -35,6 +35,7 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
char* gpr_strdup(const char* src) { char* gpr_strdup(const char* src) {
char* dst; char* dst;

@ -33,6 +33,8 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
void gpr_mu_init(gpr_mu* mu) { void gpr_mu_init(gpr_mu* mu) {
static_assert(sizeof(gpr_mu) == sizeof(absl::Mutex), static_assert(sizeof(gpr_mu) == sizeof(absl::Mutex),
"gpr_mu and Mutex must be the same size"); "gpr_mu and Mutex must be the same size");

@ -29,6 +29,8 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
void gpr_mu_init(gpr_mu* mu) { void gpr_mu_init(gpr_mu* mu) {
#ifdef GRPC_ASAN_ENABLED #ifdef GRPC_ASAN_ENABLED
GPR_ASSERT(pthread_mutex_init(&mu->mutex, nullptr) == 0); GPR_ASSERT(pthread_mutex_init(&mu->mutex, nullptr) == 0);

@ -27,6 +27,8 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
void gpr_mu_init(gpr_mu* mu) { void gpr_mu_init(gpr_mu* mu) {
InitializeCriticalSection(&mu->cs); InitializeCriticalSection(&mu->cs);
mu->locked = 0; mu->locked = 0;

@ -27,6 +27,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
int gpr_time_cmp(gpr_timespec a, gpr_timespec b) { int gpr_time_cmp(gpr_timespec a, gpr_timespec b) {
int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec); int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
GPR_ASSERT(a.clock_type == b.clock_type); GPR_ASSERT(a.clock_type == b.clock_type);

@ -32,6 +32,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
static struct timespec timespec_from_gpr(gpr_timespec gts) { static struct timespec timespec_from_gpr(gpr_timespec gts) {
struct timespec rv; struct timespec rv;
if (sizeof(time_t) < sizeof(int64_t)) { if (sizeof(time_t) < sizeof(int64_t)) {

@ -29,6 +29,7 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/crash.h"
#ifndef GPR_CYCLE_COUNTER_CUSTOM #ifndef GPR_CYCLE_COUNTER_CUSTOM
#if GPR_CYCLE_COUNTER_RDTSC_32 || GPR_CYCLE_COUNTER_RDTSC_64 #if GPR_CYCLE_COUNTER_RDTSC_32 || GPR_CYCLE_COUNTER_RDTSC_64

@ -30,6 +30,7 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/crash.h"
static LARGE_INTEGER g_start_time = []() { static LARGE_INTEGER g_start_time = []() {
LARGE_INTEGER x; LARGE_INTEGER x;

@ -31,6 +31,7 @@
#include "src/core/lib/gpr/string_windows.h" #include "src/core/lib/gpr/string_windows.h"
#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/crash.h"
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) {
FILE* result = NULL; FILE* result = NULL;

@ -31,6 +31,7 @@
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/strerror.h"
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) { FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) {

@ -30,6 +30,7 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/gpr/tmpfile.h" #include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/tchar.h" #include "src/core/lib/gprpp/tchar.h"
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) { FILE* gpr_tmpfile(const char* prefix, char** tmp_filename_out) {

@ -0,0 +1,33 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/crash.h"
#include <stdlib.h>
#include <string>
#include <grpc/support/log.h>
namespace grpc_core {
void Crash(absl::string_view message, SourceLocation location) {
gpr_log(location.file(), location.line(), GPR_LOG_SEVERITY_ERROR, "%s",
std::string(message).c_str());
abort();
}
} // namespace grpc_core

@ -0,0 +1,34 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_CORE_LIB_GPRPP_CRASH_H
#define GRPC_CORE_LIB_GPRPP_CRASH_H
#include <grpc/support/port_platform.h>
#include "absl/strings/string_view.h"
#include "src/core/lib/gprpp/debug_location.h"
namespace grpc_core {
// Crash the program after printing `message`.
// ::grpc_core:: prefix to SourceLocation is required to work around a symbol
// mismatch bug on MSVC.
[[noreturn]] void Crash(absl::string_view message,
::grpc_core::SourceLocation location = {});
} // namespace grpc_core
#endif // GRPC_CORE_LIB_GPRPP_CRASH_H

@ -24,6 +24,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/stat.h" #include "src/core/lib/gprpp/stat.h"
#include "src/core/lib/gprpp/strerror.h" #include "src/core/lib/gprpp/strerror.h"

@ -30,6 +30,7 @@
#include <grpc/support/thd_id.h> #include <grpc/support/thd_id.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"

@ -23,6 +23,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h" #include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"

@ -26,6 +26,7 @@
#include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/gprpp/crash.h"
namespace grpc_core { namespace grpc_core {

@ -27,6 +27,7 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/manual_constructor.h" #include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/mpscq.h" #include "src/core/lib/gprpp/mpscq.h"

@ -27,6 +27,7 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/mpscq.h" #include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/iomgr_internal.h"

@ -37,6 +37,7 @@
#include "src/core/lib/event_engine/channel_args_endpoint_config.h" #include "src/core/lib/event_engine/channel_args_endpoint_config.h"
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/socket_utils_posix.h" #include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h" #include "src/core/lib/iomgr/tcp_posix.h"

@ -28,6 +28,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/address_utils/sockaddr_utils.h" #include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h" #include "src/core/lib/iomgr/socket_windows.h"

@ -29,6 +29,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/gprpp/crash.h"
#ifdef GPR_WINDOWS #ifdef GPR_WINDOWS
#include <grpc/support/log_windows.h> #include <grpc/support/log_windows.h>
#endif #endif

@ -33,6 +33,7 @@
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/spinlock.h" #include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/status_helper.h" #include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"

@ -20,6 +20,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/port.h" #include "src/core/lib/iomgr/port.h"
// This polling engine is only relevant on linux kernels supporting epoll // This polling engine is only relevant on linux kernels supporting epoll

@ -35,6 +35,7 @@
#include <string> #include <string>
#include "absl/strings/str_cat.h" #include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
@ -42,6 +43,7 @@
#include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/block_annotate.h" #include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/iomgr/ev_poll_posix.h"
@ -521,10 +523,9 @@ static void notify_on_locked(grpc_fd* fd, grpc_closure** st,
maybe_wake_one_watcher_locked(fd); maybe_wake_one_watcher_locked(fd);
} else { } else {
// upcallptr was set to a different closure. This is an error! // upcallptr was set to a different closure. This is an error!
gpr_log(GPR_ERROR, grpc_core::Crash(
"User called a notify_on function with a previous callback still " "User called a notify_on function with a previous callback still "
"pending"); "pending");
abort();
} }
} }
@ -1426,8 +1427,7 @@ int phony_poll(struct pollfd fds[], nfds_t nfds, int timeout) {
if (timeout == 0) { if (timeout == 0) {
return real_poll_function(fds, nfds, 0); return real_poll_function(fds, nfds, 0);
} else { } else {
gpr_log(GPR_ERROR, "Attempted a blocking poll when declared non-polling."); grpc_core::Crash("Attempted a blocking poll when declared non-polling.");
GPR_ASSERT(false);
return -1; return -1;
} }
} }

@ -26,12 +26,15 @@
#include <string.h> #include <string.h>
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h" #include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/ev_epoll1_linux.h" #include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_poll_posix.h" #include "src/core/lib/iomgr/ev_poll_posix.h"
@ -187,9 +190,8 @@ void grpc_event_engine_init(void) {
gpr_free(strings); gpr_free(strings);
if (g_event_engine == nullptr) { if (g_event_engine == nullptr) {
gpr_log(GPR_ERROR, "No event engine could be initialized from %s", grpc_core::Crash(absl::StrFormat(
value.get()); "No event engine could be initialized from %s", value.get()));
abort();
} }
}); });
g_event_engine->init_engine(); g_event_engine->init_engine();

@ -20,9 +20,12 @@
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "absl/strings/str_format.h"
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/error.h" #include "src/core/lib/iomgr/error.h"
@ -85,13 +88,12 @@ void ExecCtx::Run(const DebugLocation& location, grpc_closure* closure,
} }
#ifndef NDEBUG #ifndef NDEBUG
if (closure->scheduled) { if (closure->scheduled) {
gpr_log(GPR_ERROR, Crash(absl::StrFormat(
"Closure already scheduled. (closure: %p, created: [%s:%d], " "Closure already scheduled. (closure: %p, created: [%s:%d], "
"previously scheduled at: [%s: %d], newly scheduled at [%s: %d]", "previously scheduled at: [%s: %d], newly scheduled at [%s: %d]",
closure, closure->file_created, closure->line_created, closure, closure->file_created, closure->line_created,
closure->file_initiated, closure->line_initiated, location.file(), closure->file_initiated, closure->line_initiated, location.file(),
location.line()); location.line()));
abort();
} }
closure->scheduled = true; closure->scheduled = true;
closure->file_initiated = location.file(); closure->file_initiated = location.file();
@ -110,12 +112,11 @@ void ExecCtx::RunList(const DebugLocation& location, grpc_closure_list* list) {
grpc_closure* next = c->next_data.next; grpc_closure* next = c->next_data.next;
#ifndef NDEBUG #ifndef NDEBUG
if (c->scheduled) { if (c->scheduled) {
gpr_log(GPR_ERROR, Crash(absl::StrFormat(
"Closure already scheduled. (closure: %p, created: [%s:%d], " "Closure already scheduled. (closure: %p, created: [%s:%d], "
"previously scheduled at: [%s: %d], newly scheduled at [%s:%d]", "previously scheduled at: [%s: %d], newly scheduled at [%s:%d]",
c, c->file_created, c->line_created, c->file_initiated, c, c->file_created, c->line_created, c->file_initiated,
c->line_initiated, location.file(), location.line()); c->line_initiated, location.file(), location.line()));
abort();
} }
c->scheduled = true; c->scheduled = true;
c->file_initiated = location.file(); c->file_initiated = location.file();

@ -30,6 +30,7 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/gpr/time_precise.h" #include "src/core/lib/gpr/time_precise.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/debug_location.h" #include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/fork.h" #include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/time.h" #include "src/core/lib/gprpp/time.h"

@ -28,6 +28,7 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h" #include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/iomgr_internal.h"

@ -32,6 +32,7 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/fork.h" #include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/ev_posix.h" #include "src/core/lib/iomgr/ev_posix.h"

@ -27,6 +27,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/grpc_if_nametoindex.h" #include "src/core/lib/iomgr/grpc_if_nametoindex.h"
uint32_t grpc_if_nametoindex(char* name) { uint32_t grpc_if_nametoindex(char* name) {

@ -24,6 +24,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/grpc_if_nametoindex.h" #include "src/core/lib/iomgr/grpc_if_nametoindex.h"
uint32_t grpc_if_nametoindex(char* name) { uint32_t grpc_if_nametoindex(char* name) {

@ -32,6 +32,7 @@
#include "src/core/lib/debug/stats.h" #include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h" #include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/iocp_windows.h" #include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/iomgr_internal.h" #include "src/core/lib/iomgr/iomgr_internal.h"
@ -78,8 +79,7 @@ grpc_iocp_work_status grpc_iocp_work(grpc_core::Timestamp deadline) {
// We were awoken from a kick. // We were awoken from a kick.
return GRPC_IOCP_WORK_KICK; return GRPC_IOCP_WORK_KICK;
} }
gpr_log(GPR_ERROR, "Unknown custom completion key."); grpc_core::Crash("Unknown custom completion key.");
abort();
} }
socket = (grpc_winsocket*)completion_key; socket = (grpc_winsocket*)completion_key;

@ -31,6 +31,7 @@
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h" #include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/global_config.h" #include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/gprpp/thd.h" #include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/buffer_list.h" #include "src/core/lib/iomgr/buffer_list.h"

@ -24,6 +24,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/iocp_windows.h" #include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset_windows.h" #include "src/core/lib/iomgr/pollset_windows.h"

@ -28,6 +28,7 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h" #include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/block_annotate.h" #include "src/core/lib/iomgr/block_annotate.h"
grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator, grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator,

@ -23,6 +23,7 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace; extern grpc_core::DebugOnlyTraceFlag grpc_polling_trace;
@ -148,10 +149,9 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
} }
// There is already a closure!. This indicates a bug in the code // There is already a closure!. This indicates a bug in the code
gpr_log(GPR_ERROR, Crash(
"LockfreeEvent::NotifyOn: notify_on called with a previous " "LockfreeEvent::NotifyOn: notify_on called with a previous "
"callback still pending"); "callback still pending");
abort();
} }
} }
} }

@ -20,9 +20,13 @@
#include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/polling_entity.h"
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/lib/gprpp/crash.h"
grpc_polling_entity grpc_polling_entity_create_from_pollset_set( grpc_polling_entity grpc_polling_entity_create_from_pollset_set(
grpc_pollset_set* pollset_set) { grpc_pollset_set* pollset_set) {
grpc_polling_entity pollent; grpc_polling_entity pollent;
@ -70,8 +74,8 @@ void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity* pollent,
GPR_ASSERT(pollent->pollent.pollset_set != nullptr); GPR_ASSERT(pollent->pollent.pollset_set != nullptr);
grpc_pollset_set_add_pollset_set(pss_dst, pollent->pollent.pollset_set); grpc_pollset_set_add_pollset_set(pss_dst, pollent->pollent.pollset_set);
} else { } else {
gpr_log(GPR_ERROR, "Invalid grpc_polling_entity tag '%d'", pollent->tag); grpc_core::Crash(
abort(); absl::StrFormat("Invalid grpc_polling_entity tag '%d'", pollent->tag));
} }
} }
@ -90,7 +94,7 @@ void grpc_polling_entity_del_from_pollset_set(grpc_polling_entity* pollent,
GPR_ASSERT(pollent->pollent.pollset_set != nullptr); GPR_ASSERT(pollent->pollent.pollset_set != nullptr);
grpc_pollset_set_del_pollset_set(pss_dst, pollent->pollent.pollset_set); grpc_pollset_set_del_pollset_set(pss_dst, pollent->pollent.pollset_set);
} else { } else {
gpr_log(GPR_ERROR, "Invalid grpc_polling_entity tag '%d'", pollent->tag); grpc_core::Crash(
abort(); absl::StrFormat("Invalid grpc_polling_entity tag '%d'", pollent->tag));
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save