Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <fcntl.h> |
| 18 | #include <stdio.h> |
| 19 | #include <stdlib.h> |
| 20 | #include <sys/stat.h> |
| 21 | #include <sys/types.h> |
| 22 | #include <unistd.h> |
| 23 | |
| 24 | #include <array> |
| 25 | #include <deque> |
| 26 | #include <unordered_map> |
| 27 | |
| 28 | #include <event2/event.h> |
| 29 | #include <event2/listener.h> |
| 30 | #include <event2/thread.h> |
| 31 | |
| 32 | #include <android-base/logging.h> |
| 33 | #include <android-base/stringprintf.h> |
| 34 | #include <android-base/unique_fd.h> |
| 35 | #include <cutils/sockets.h> |
| 36 | |
Josh Gao | 55f79a5 | 2017-03-06 12:24:07 -0800 | [diff] [blame] | 37 | #include "debuggerd/handler.h" |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 38 | #include "dump_type.h" |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 39 | #include "protocol.h" |
| 40 | #include "util.h" |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 41 | |
| 42 | #include "intercept_manager.h" |
| 43 | |
| 44 | using android::base::StringPrintf; |
| 45 | using android::base::unique_fd; |
| 46 | |
| 47 | static InterceptManager* intercept_manager; |
| 48 | |
| 49 | enum CrashStatus { |
| 50 | kCrashStatusRunning, |
| 51 | kCrashStatusQueued, |
| 52 | }; |
| 53 | |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 54 | struct Crash; |
| 55 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 56 | class CrashQueue { |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 57 | public: |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 58 | CrashQueue(const std::string& dir_path, const std::string& file_name_prefix, size_t max_artifacts, |
| 59 | size_t max_concurrent_dumps) |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 60 | : file_name_prefix_(file_name_prefix), |
| 61 | dir_path_(dir_path), |
| 62 | dir_fd_(open(dir_path.c_str(), O_DIRECTORY | O_RDONLY | O_CLOEXEC)), |
| 63 | max_artifacts_(max_artifacts), |
| 64 | next_artifact_(0), |
| 65 | max_concurrent_dumps_(max_concurrent_dumps), |
| 66 | num_concurrent_dumps_(0) { |
| 67 | if (dir_fd_ == -1) { |
| 68 | PLOG(FATAL) << "failed to open directory: " << dir_path; |
| 69 | } |
| 70 | |
| 71 | // NOTE: If max_artifacts_ <= max_concurrent_dumps_, then theoretically the |
| 72 | // same filename could be handed out to multiple processes. |
| 73 | CHECK(max_artifacts_ > max_concurrent_dumps_); |
| 74 | |
| 75 | find_oldest_artifact(); |
| 76 | } |
| 77 | |
| 78 | unique_fd get_output_fd() { |
| 79 | unique_fd result; |
| 80 | char buf[PATH_MAX]; |
| 81 | snprintf(buf, sizeof(buf), "%s%02d", file_name_prefix_.c_str(), next_artifact_); |
| 82 | // Unlink and create the file, instead of using O_TRUNC, to avoid two processes |
| 83 | // interleaving their output in case we ever get into that situation. |
| 84 | if (unlinkat(dir_fd_, buf, 0) != 0 && errno != ENOENT) { |
| 85 | PLOG(FATAL) << "failed to unlink tombstone at " << dir_path_ << buf; |
| 86 | } |
| 87 | |
| 88 | result.reset(openat(dir_fd_, buf, O_CREAT | O_EXCL | O_WRONLY | O_APPEND | O_CLOEXEC, 0640)); |
| 89 | if (result == -1) { |
| 90 | PLOG(FATAL) << "failed to create tombstone at " << dir_path_ << buf; |
| 91 | } |
| 92 | |
| 93 | next_artifact_ = (next_artifact_ + 1) % max_artifacts_; |
| 94 | return result; |
| 95 | } |
| 96 | |
| 97 | bool maybe_enqueue_crash(Crash* crash) { |
| 98 | if (num_concurrent_dumps_ == max_concurrent_dumps_) { |
| 99 | queued_requests_.push_back(crash); |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | void maybe_dequeue_crashes(void (*handler)(Crash* crash)) { |
| 107 | while (!queued_requests_.empty() && num_concurrent_dumps_ < max_concurrent_dumps_) { |
| 108 | Crash* next_crash = queued_requests_.front(); |
| 109 | queued_requests_.pop_front(); |
| 110 | handler(next_crash); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | void on_crash_started() { ++num_concurrent_dumps_; } |
| 115 | |
| 116 | void on_crash_completed() { --num_concurrent_dumps_; } |
| 117 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 118 | static CrashQueue* const tombstone; |
| 119 | static CrashQueue* const java_trace; |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 120 | |
| 121 | private: |
| 122 | void find_oldest_artifact() { |
| 123 | size_t oldest_tombstone = 0; |
| 124 | time_t oldest_time = std::numeric_limits<time_t>::max(); |
| 125 | |
| 126 | for (size_t i = 0; i < max_artifacts_; ++i) { |
| 127 | std::string path = android::base::StringPrintf("%s/%s%02zu", dir_path_.c_str(), |
| 128 | file_name_prefix_.c_str(), i); |
| 129 | struct stat st; |
| 130 | if (stat(path.c_str(), &st) != 0) { |
| 131 | if (errno == ENOENT) { |
| 132 | oldest_tombstone = i; |
| 133 | break; |
| 134 | } else { |
| 135 | PLOG(ERROR) << "failed to stat " << path; |
| 136 | continue; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | if (st.st_mtime < oldest_time) { |
| 141 | oldest_tombstone = i; |
| 142 | oldest_time = st.st_mtime; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | next_artifact_ = oldest_tombstone; |
| 147 | } |
| 148 | |
| 149 | const std::string file_name_prefix_; |
| 150 | |
| 151 | const std::string dir_path_; |
| 152 | const int dir_fd_; |
| 153 | |
| 154 | const size_t max_artifacts_; |
| 155 | int next_artifact_; |
| 156 | |
| 157 | const size_t max_concurrent_dumps_; |
| 158 | size_t num_concurrent_dumps_; |
| 159 | |
| 160 | std::deque<Crash*> queued_requests_; |
| 161 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 162 | DISALLOW_COPY_AND_ASSIGN(CrashQueue); |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 163 | }; |
| 164 | |
| 165 | // Whether java trace dumps are produced via tombstoned. |
Narayan Kamath | ca5e908 | 2017-06-02 15:42:06 +0100 | [diff] [blame^] | 166 | static constexpr bool kJavaTraceDumpsEnabled = true; |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 167 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 168 | /* static */ CrashQueue* const CrashQueue::tombstone = |
| 169 | new CrashQueue("/data/tombstones", "tombstone_" /* file_name_prefix */, 10 /* max_artifacts */, |
| 170 | 1 /* max_concurrent_dumps */); |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 171 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 172 | /* static */ CrashQueue* const CrashQueue::java_trace = |
| 173 | (kJavaTraceDumpsEnabled ? new CrashQueue("/data/anr", "anr_" /* file_name_prefix */, |
| 174 | 64 /* max_artifacts */, 4 /* max_concurrent_dumps */) |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 175 | : nullptr); |
| 176 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 177 | // Ownership of Crash is a bit messy. |
| 178 | // It's either owned by an active event that must have a timeout, or owned by |
| 179 | // queued_requests, in the case that multiple crashes come in at the same time. |
| 180 | struct Crash { |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 181 | ~Crash() { event_free(crash_event); } |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 182 | |
| 183 | unique_fd crash_fd; |
| 184 | pid_t crash_pid; |
| 185 | event* crash_event = nullptr; |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 186 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 187 | DebuggerdDumpType crash_type; |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 188 | }; |
| 189 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 190 | static CrashQueue* get_crash_queue(const Crash* crash) { |
| 191 | if (crash->crash_type == kDebuggerdJavaBacktrace) { |
| 192 | return CrashQueue::java_trace; |
| 193 | } |
| 194 | |
| 195 | return CrashQueue::tombstone; |
| 196 | } |
| 197 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 198 | // Forward declare the callbacks so they can be placed in a sensible order. |
| 199 | static void crash_accept_cb(evconnlistener* listener, evutil_socket_t sockfd, sockaddr*, int, void*); |
| 200 | static void crash_request_cb(evutil_socket_t sockfd, short ev, void* arg); |
| 201 | static void crash_completed_cb(evutil_socket_t sockfd, short ev, void* arg); |
| 202 | |
Josh Gao | 807a458 | 2017-03-30 14:51:55 -0700 | [diff] [blame] | 203 | static void perform_request(Crash* crash) { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 204 | unique_fd output_fd; |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 205 | if (!intercept_manager->GetIntercept(crash->crash_pid, crash->crash_type, &output_fd)) { |
| 206 | output_fd = get_crash_queue(crash)->get_output_fd(); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | TombstonedCrashPacket response = { |
| 210 | .packet_type = CrashPacketType::kPerformDump |
| 211 | }; |
| 212 | ssize_t rc = send_fd(crash->crash_fd, &response, sizeof(response), std::move(output_fd)); |
| 213 | if (rc == -1) { |
| 214 | PLOG(WARNING) << "failed to send response to CrashRequest"; |
| 215 | goto fail; |
| 216 | } else if (rc != sizeof(response)) { |
| 217 | PLOG(WARNING) << "crash socket write returned short"; |
| 218 | goto fail; |
| 219 | } else { |
| 220 | // TODO: Make this configurable by the interceptor? |
| 221 | struct timeval timeout = { 10, 0 }; |
| 222 | |
| 223 | event_base* base = event_get_base(crash->crash_event); |
| 224 | event_assign(crash->crash_event, base, crash->crash_fd, EV_TIMEOUT | EV_READ, |
| 225 | crash_completed_cb, crash); |
| 226 | event_add(crash->crash_event, &timeout); |
| 227 | } |
Josh Gao | 1307824 | 2017-03-30 14:42:46 -0700 | [diff] [blame] | 228 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 229 | get_crash_queue(crash)->on_crash_started(); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 230 | return; |
| 231 | |
| 232 | fail: |
| 233 | delete crash; |
| 234 | } |
| 235 | |
| 236 | static void crash_accept_cb(evconnlistener* listener, evutil_socket_t sockfd, sockaddr*, int, |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 237 | void*) { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 238 | event_base* base = evconnlistener_get_base(listener); |
| 239 | Crash* crash = new Crash(); |
| 240 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 241 | // TODO: Make sure that only java crashes come in on the java socket |
| 242 | // and only native crashes on the native socket. |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 243 | struct timeval timeout = { 1, 0 }; |
| 244 | event* crash_event = event_new(base, sockfd, EV_TIMEOUT | EV_READ, crash_request_cb, crash); |
| 245 | crash->crash_fd.reset(sockfd); |
| 246 | crash->crash_event = crash_event; |
| 247 | event_add(crash_event, &timeout); |
| 248 | } |
| 249 | |
| 250 | static void crash_request_cb(evutil_socket_t sockfd, short ev, void* arg) { |
| 251 | ssize_t rc; |
| 252 | Crash* crash = static_cast<Crash*>(arg); |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 253 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 254 | TombstonedCrashPacket request = {}; |
| 255 | |
| 256 | if ((ev & EV_TIMEOUT) != 0) { |
| 257 | LOG(WARNING) << "crash request timed out"; |
| 258 | goto fail; |
| 259 | } else if ((ev & EV_READ) == 0) { |
| 260 | LOG(WARNING) << "tombstoned received unexpected event from crash socket"; |
| 261 | goto fail; |
| 262 | } |
| 263 | |
| 264 | rc = TEMP_FAILURE_RETRY(read(sockfd, &request, sizeof(request))); |
| 265 | if (rc == -1) { |
| 266 | PLOG(WARNING) << "failed to read from crash socket"; |
| 267 | goto fail; |
| 268 | } else if (rc != sizeof(request)) { |
| 269 | LOG(WARNING) << "crash socket received short read of length " << rc << " (expected " |
| 270 | << sizeof(request) << ")"; |
| 271 | goto fail; |
| 272 | } |
| 273 | |
| 274 | if (request.packet_type != CrashPacketType::kDumpRequest) { |
| 275 | LOG(WARNING) << "unexpected crash packet type, expected kDumpRequest, received " |
| 276 | << StringPrintf("%#2hhX", request.packet_type); |
| 277 | goto fail; |
| 278 | } |
| 279 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 280 | crash->crash_type = request.packet.dump_request.dump_type; |
| 281 | if (crash->crash_type < 0 || crash->crash_type > kDebuggerdAnyIntercept) { |
| 282 | LOG(WARNING) << "unexpected crash dump type: " << crash->crash_type; |
| 283 | goto fail; |
| 284 | } |
| 285 | |
| 286 | if (crash->crash_type != kDebuggerdJavaBacktrace) { |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 287 | crash->crash_pid = request.packet.dump_request.pid; |
| 288 | } else { |
| 289 | // Requests for java traces are sent from untrusted processes, so we |
| 290 | // must not trust the PID sent down with the request. Instead, we ask the |
| 291 | // kernel. |
| 292 | ucred cr = {}; |
| 293 | socklen_t len = sizeof(cr); |
| 294 | int ret = getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cr, &len); |
| 295 | if (ret != 0) { |
| 296 | PLOG(ERROR) << "Failed to getsockopt(..SO_PEERCRED)"; |
| 297 | goto fail; |
| 298 | } |
| 299 | |
| 300 | crash->crash_pid = cr.pid; |
| 301 | } |
| 302 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 303 | LOG(INFO) << "received crash request for pid " << crash->crash_pid; |
| 304 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 305 | if (get_crash_queue(crash)->maybe_enqueue_crash(crash)) { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 306 | LOG(INFO) << "enqueueing crash request for pid " << crash->crash_pid; |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 307 | } else { |
Josh Gao | 807a458 | 2017-03-30 14:51:55 -0700 | [diff] [blame] | 308 | perform_request(crash); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | return; |
| 312 | |
| 313 | fail: |
| 314 | delete crash; |
| 315 | } |
| 316 | |
| 317 | static void crash_completed_cb(evutil_socket_t sockfd, short ev, void* arg) { |
| 318 | ssize_t rc; |
| 319 | Crash* crash = static_cast<Crash*>(arg); |
| 320 | TombstonedCrashPacket request = {}; |
| 321 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 322 | get_crash_queue(crash)->on_crash_completed(); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 323 | |
| 324 | if ((ev & EV_READ) == 0) { |
| 325 | goto fail; |
| 326 | } |
| 327 | |
| 328 | rc = TEMP_FAILURE_RETRY(read(sockfd, &request, sizeof(request))); |
| 329 | if (rc == -1) { |
| 330 | PLOG(WARNING) << "failed to read from crash socket"; |
| 331 | goto fail; |
| 332 | } else if (rc != sizeof(request)) { |
| 333 | LOG(WARNING) << "crash socket received short read of length " << rc << " (expected " |
| 334 | << sizeof(request) << ")"; |
| 335 | goto fail; |
| 336 | } |
| 337 | |
| 338 | if (request.packet_type != CrashPacketType::kCompletedDump) { |
| 339 | LOG(WARNING) << "unexpected crash packet type, expected kCompletedDump, received " |
| 340 | << uint32_t(request.packet_type); |
| 341 | goto fail; |
| 342 | } |
| 343 | |
| 344 | fail: |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 345 | CrashQueue* queue = get_crash_queue(crash); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 346 | delete crash; |
| 347 | |
| 348 | // If there's something queued up, let them proceed. |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 349 | queue->maybe_dequeue_crashes(perform_request); |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | int main(int, char* []) { |
Josh Gao | 8830c95 | 2017-03-06 12:23:55 -0800 | [diff] [blame] | 353 | umask(0137); |
| 354 | |
Josh Gao | 55f79a5 | 2017-03-06 12:24:07 -0800 | [diff] [blame] | 355 | // Don't try to connect to ourselves if we crash. |
| 356 | struct sigaction action = {}; |
| 357 | action.sa_handler = [](int signal) { |
| 358 | LOG(ERROR) << "received fatal signal " << signal; |
| 359 | _exit(1); |
| 360 | }; |
| 361 | debuggerd_register_handlers(&action); |
| 362 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 363 | int intercept_socket = android_get_control_socket(kTombstonedInterceptSocketName); |
| 364 | int crash_socket = android_get_control_socket(kTombstonedCrashSocketName); |
| 365 | |
| 366 | if (intercept_socket == -1 || crash_socket == -1) { |
| 367 | PLOG(FATAL) << "failed to get socket from init"; |
| 368 | } |
| 369 | |
| 370 | evutil_make_socket_nonblocking(intercept_socket); |
| 371 | evutil_make_socket_nonblocking(crash_socket); |
| 372 | |
| 373 | event_base* base = event_base_new(); |
| 374 | if (!base) { |
| 375 | LOG(FATAL) << "failed to create event_base"; |
| 376 | } |
| 377 | |
| 378 | intercept_manager = new InterceptManager(base, intercept_socket); |
| 379 | |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 380 | evconnlistener* tombstone_listener = evconnlistener_new( |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 381 | base, crash_accept_cb, CrashQueue::tombstone, -1, LEV_OPT_CLOSE_ON_FREE, crash_socket); |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 382 | if (!tombstone_listener) { |
| 383 | LOG(FATAL) << "failed to create evconnlistener for tombstones."; |
| 384 | } |
| 385 | |
| 386 | if (kJavaTraceDumpsEnabled) { |
| 387 | const int java_trace_socket = android_get_control_socket(kTombstonedJavaTraceSocketName); |
| 388 | if (java_trace_socket == -1) { |
| 389 | PLOG(FATAL) << "failed to get socket from init"; |
| 390 | } |
| 391 | |
| 392 | evutil_make_socket_nonblocking(java_trace_socket); |
| 393 | evconnlistener* java_trace_listener = evconnlistener_new( |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 394 | base, crash_accept_cb, CrashQueue::java_trace, -1, LEV_OPT_CLOSE_ON_FREE, java_trace_socket); |
Narayan Kamath | 922f6b2 | 2017-05-15 15:59:30 +0100 | [diff] [blame] | 395 | if (!java_trace_listener) { |
| 396 | LOG(FATAL) << "failed to create evconnlistener for java traces."; |
| 397 | } |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | LOG(INFO) << "tombstoned successfully initialized"; |
| 401 | event_base_dispatch(base); |
| 402 | } |