Fix asan failure

reviewable/pr7771/r11
Yuchen Zeng 8 years ago
parent e02cbebd02
commit 6a167b6e86
  1. 1
      src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
  2. 10
      src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_fallback.c
  3. 2
      src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
  4. 3
      src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
  5. 10
      src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper_fallback.c

@ -291,6 +291,7 @@ static void dns_ares_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
if (r->resolved_result != NULL) {
grpc_channel_args_destroy(exec_ctx, r->resolved_result);
}
grpc_pollset_set_destroy(r->interested_parties);
gpr_free(r->name_to_resolve);
gpr_free(r->default_port);
grpc_channel_args_destroy(exec_ctx, r->channel_args);

@ -32,7 +32,8 @@
*/
#include <grpc/support/port_platform.h>
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
#include "src/core/lib/iomgr/port.h"
#if !(GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET))
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"
@ -43,7 +44,7 @@ struct grpc_ares_ev_driver {
void grpc_ares_ev_driver_start(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver) {}
void *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
ares_channel *grpc_ares_ev_driver_get_channel(grpc_ares_ev_driver *ev_driver) {
return NULL;
}
@ -52,7 +53,6 @@ grpc_error *grpc_ares_ev_driver_create(grpc_ares_ev_driver **ev_driver,
return GRPC_ERROR_NONE;
}
void grpc_ares_ev_driver_destroy(grpc_exec_ctx *exec_ctx,
grpc_ares_ev_driver *ev_driver) {}
void grpc_ares_ev_driver_destroy(grpc_ares_ev_driver *ev_driver) {}
#endif /* GRPC_NATIVE_ADDRESS_RESOLVE */
#endif /* !(GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET)) */

@ -45,8 +45,6 @@
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/block_annotate.h"
#include "src/core/lib/support/string.h"
typedef struct fd_node {

@ -46,15 +46,12 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/block_annotate.h"
#include "src/core/lib/support/string.h"
static gpr_once g_basic_init = GPR_ONCE_INIT;

@ -34,21 +34,23 @@
/* TODO(zyc): remove this fallback after we can build c-ares on windows */
#include <grpc/support/port_platform.h>
#ifdef GRPC_NATIVE_ADDRESS_RESOLVE
#if !(GRPC_ARES == 1)
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h"
void grpc_resolve_address_ares_impl(grpc_exec_ctx *exec_ctx, const char *name,
const char *default_port,
grpc_ares_ev_driver *ev_driver,
grpc_pollset_set *interested_parties,
grpc_closure *on_done,
grpc_resolved_addresses **addrs) {
grpc_resolve_address(exec_ctx, name, default_port, on_done, addrs);
grpc_resolve_address(exec_ctx, name, default_port, interested_parties,
on_done, addrs);
}
void (*grpc_resolve_address_ares)(
grpc_exec_ctx *exec_ctx, const char *name, const char *default_port,
grpc_ares_ev_driver *ev_driver, grpc_closure *on_done,
grpc_pollset_set *interested_parties, grpc_closure *on_done,
grpc_resolved_addresses **addrs) = grpc_resolve_address_ares_impl;
grpc_error *grpc_ares_init(void) { return GRPC_ERROR_NONE; }

Loading…
Cancel
Save