Fix infinite recursion of memory probes handling 14/189114/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 10 Sep 2018 16:21:49 +0000 (19:21 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Sep 2018 11:13:51 +0000 (14:13 +0300)
commitc6528edcd5d96ca8159d0c41db6d08b5c48f9e2a
tree651b440b5747f1704d21ac111e3757791bf9cb0a
parent787c1003c12232849d7da51fb57518c8488c7468
Fix infinite recursion of memory probes handling

Problem:
  During the processing of the realloc_handler () call,
  there is a recursive loop in the free_handler() call:
    -> plt@realloc() -> realloc_handler() -> lsan_get_sym() -> dlsym() ->
       plt@free() -> free_handler() -> lsan_get_sym() -> dlsym() ->
       plt@free() -> free_handler() -> lsan_get_sym() -> dlsym() ->
       plt@free() -> free_handler() -> lsan_get_sym() -> dlsym() ->
       ...

Solution:
  Find all LSan symbols during library initialization instead of lazy
  symbol search.

Change-Id: Idce7de857a468645be51c21386726ac2a37c1ade
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
helper/libdaprobe.c
helper/lsan_open.c
include/lsan_open.h
probe_memory/libdamemalloc.c
probe_thread/libdathread.c