title: LLVM Clang address sanitizer on Linux with Matlab
body: <p>I tried to use address sanitizer for debug Matlab Mex code. I need invoke Matlab and then run matlab scripts to call Mex function. I did below configuration.</p>
  <pre><code>export LD_PRELOAD=/llvm_lib_path/libclang_rt.asan-x86_64.so
  export ASAN_OPTIONS=alloc_dealloc_mismatch=0:halt_on_error=false:verbosity=1
  </code></pre>
  <p>But when I invoke Matlab, it hang up soon and can not launch the GUI.</p>
  <p>I did the similar thing in MacOs and work as expected.</p>
  <p>With verbosity=1, i can saw the sanitizer stopped at</p>
  <pre><code>==30485==T27 TSDDtor
  
  ==30485==T27 exited
  
  ==30485==T28: stack [0x2b2b6d23e000,0x2b2b6d43cdc0) size 0x1fedc0; local=0x2b2b6d43ccd4
  
  ==30485==T28 TSDDtor
  
  ==30485==T28 exited
  
  ==30485==T29: stack [0x2b2b6d23e000,0x2b2b6d43cdc0) size 0x1fedc0; local=0x2b2b6d43ccd4
  
  ==30485==T29 TSDDtor
  
  ==30485==T29 exited
  
  ==30485==T30: stack [0x2b2b6d23e000,0x2b2b6d43cdc0) size 0x1fedc0; local=0x2b2b6d43ccd4
  
  ==30485==T30 TSDDtor
  
  ==30485==T30 exited
  </code></pre>
  <p>Any thoughts?</p>