Disinfection warning

For several days, I get the following problem when running Address Sanitizer in Xcode 7.3. Error messages printed on the Xcode console when the Sanitizer detected a problem (which was actually suppressed by the file):

== 13392 == WARNING: Cannot write character to fd 55

== 13392 == WARNING: Cannot write character to fd 55

== 13392 == WARNING: Cannot write character to fd 55

== 13392 == WARNING: Cannot write character to fd 55

== 13392 == ATTENTION: Failed to use and restart the external character!

I found error messages in the repository, but so far I can’t explain what is happening. Obviously, the internal write function does not work, but I have no idea what causes this. Any ideas?

https://github.com/Microsoft/compiler-rt/blob/master/lib/sanitizer_common/sanitizer_symbolizer_process_libcdep.cc#L100

+6
source share
1 answer

ASAN is out of your way. The following was done outside of Xcode to see if I could show an error, and it was easy if the path was undefined. I assume that Xcode cannot find it where it looks, or, as in the following case, the ASAN path is undefined.

If you try to do this by adding and removing it from your path, the error will disappear, but the line numbers will also disappear, i.e. if you want to see the actual error message again, you need to use

unset ASAN_SYMBOLIZER_PATH 

not

 ASAN_SYMBOLIZER_PATH= 

Create a c program as follows:

 int main(void){ int a[3]; a[3] = 4; return 0; } 

Compile it, please ignore the warnings ...

 gcc -std=c11 -Wall -g3 -fno-omit-frame-pointer -fsanitize=address broken_asan_test.c ./a.out 

You should see something like this ...

 ================================================================= ==29192==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff5ad1052c at pc 0x000104eefe78 bp 0x7fff5ad104f0 sp 0x7fff5ad104e8 WRITE of size 4 at 0x7fff5ad1052c thread T0 #0 0x104eefe77 in atos[29193]: [fatal] 'pid_for_task' failed: (os/kern) failure (5) (+0x100000e77) ==29192==WARNING: Can't write to symbolizer at fd 3 #1 0x7fff940495ac in atos[29206]: [fatal] 'pid_for_task' failed: (os/kern) failure (5) (+0x35ac) #2 0x0 (<unknown module>) 

Pay attention to this line.

 ==29192==WARNING: Can't write to symbolizer at fd 3 

Change adding character to your path ...

 export ASAN_SYMBOLIZER_PATH=/usr/local/Cellar/llvm/3.6.2/bin/llvm-symbolizer 

and the error will disappear ...

 ================================================================= ==29312==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff55ac450c at pc 0x00010a13be78 bp 0x7fff55ac44d0 sp 0x7fff55ac44c8 WRITE of size 4 at 0x7fff55ac450c thread T0 #0 0x10a13be77 in main (/git/ghub/doc/c/./a.out+0x100000e77) #1 0x7fff940495ac in start (/usr/lib/system/libdyld.dylib+0x35ac) #2 0x0 (<unknown module>) 
+3
source

All Articles