Commit 5ea13370 authored by Sachin Kadloor's avatar Sachin Kadloor Committed by Pavlo Kushnir

SocketAddress logging

Summary:
Better logging in SocketAddress

Test Plan: run it

Reviewed By: qwu@fb.com

Subscribers: ps, bmatheny, xning

FB internal diff: D1644573

Tasks: 5406091

Signature: t1:1644573:1414626398:1e23ee85ec8ee0be89cb6bdc07da23978b4d988a
parent cbed222c
......@@ -29,6 +29,9 @@
#include <errno.h>
#include <sstream>
#include <string>
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
namespace {
......@@ -543,6 +546,14 @@ size_t SocketAddress::hash() const {
break;
case AF_UNSPEC:
default:
void *array[20];
size_t size;
// get void*'s for all entries on the stack
size = backtrace(array, 20);
// print out all the frames to stderr
fprintf(stderr, "Exception: \n");
backtrace_symbols_fd(array, size, STDERR_FILENO);
LOG(FATAL) << "Invalid ip address: " << describe();
throw std::invalid_argument(
"SocketAddress: unsupported address family "
"for hashing");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment