Skip to content

Commit

Permalink
janus: +default sanitizer options
Browse files Browse the repository at this point in the history
mom-informative stack unwind if leak detected in so-module

====================================================================================== default:
Indirect leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f36052b0b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    meetecho#1 0x7f3603af545c  (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x345c)
    meetecho#2 0x7f3602808b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7f36052b0b50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    meetecho#1 0x7f3603afa61a in json_object (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x861a)
    meetecho#2 0x7f3602808b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
SUMMARY: AddressSanitizer: 200 byte(s) leaked in 2 allocation(s).

====================================================================================== no_fast_unwind:
Indirect leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x7f3554f8fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    meetecho#1 0x7f35537d445c  (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x345c)
    meetecho#2 0x7f35537d9646 in json_object (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x8646)
    meetecho#3 0x55928c01143a in main /home/dima/work/janus.github/src/janus.c:3269
    meetecho#4 0x7f35524e7b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    meetecho#5 0x55928bfc74c9 in _start (/home/dima/work/janus.github/cmake-gcc/janus+0x1364c9)
Indirect leak of 72 byte(s) in 1 object(s) allocated from:
    #0 0x7f3554f8fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50)
    meetecho#1 0x7f35537d961a in json_object (/usr/lib/x86_64-linux-gnu/libjansson.so.4+0x861a)
    meetecho#2 0x55928c01143a in main /home/dima/work/janus.github/src/janus.c:3269
    meetecho#3 0x7f35524e7b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    meetecho#4 0x55928bfc74c9 in _start (/home/dima/work/janus.github/cmake-gcc/janus+0x1364c9)
SUMMARY: AddressSanitizer: 200 byte(s) leaked in 2 allocation(s).
  • Loading branch information
DmitryYudin committed Sep 17, 2018
1 parent 1033059 commit 3300332
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/janus.c
Expand Up @@ -3247,6 +3247,14 @@ static gboolean install_transport(janus_transport *janus_transport)
return TRUE;
}

#if __SANITIZE_ADDRESS__
/* disable fast_unwind to enable correct stack view if reported memory was allocated in *.so module */
const char *__asan_default_options(void);
const char *__asan_default_options(void) {
return "symbolize=1:fast_unwind_on_malloc=0";
}
#endif

/* Main */
gint main(int argc, char *argv[])
{
Expand Down

0 comments on commit 3300332

Please sign in to comment.