Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not mask function in closed source library #356

Closed
ramosian-glider opened this issue Sep 1, 2015 · 7 comments
Closed

can not mask function in closed source library #356

ramosian-glider opened this issue Sep 1, 2015 · 7 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 356

>What steps will reproduce the problem?
1. Compile attached example: gmake
2. Run: LD_LIBRARY_PATH="./" ./app
3. it stops on function "f"

>What is the expected output? What do you see instead?
At least not abort/exit after call function "f" 

>What version of the product are you using? On what operating system?
I try clang 3.5.0 and gcc 4.9.2

I used close source library (linux shared library) with my application, that I can
not fix/recompile. I want ignore errors from it (sometimes it calls strncpy with the
same pointers as input and output).

I tried add __attribute__((__no_sanitize_address__)) to its definitions,
I tried add __attribute__((__no_sanitize_address__)) to my function (which compiled
with -fsanitize=address) that call function from close source library.
I tried clang "-fsanitize-blacklist=blacklist.txt", and in blacklist.txt I mentioned
bad function from close source library, plus my function with call bad function from
close source library.

Neither of these variants can mask problem, and allow me to debug my code.

In attachment file is simple gnu make based project, that demonstrate problem.

Reported by dushistov on 2014-11-12 22:09:46


- _Attachment: [asan_bug1.tar](https://storage.googleapis.com/google-code-attachments/address-sanitizer/issue-356/comment-0/asan_bug1.tar)_
@ramosian-glider
Copy link
Member Author

Try ASAN_OPTIONS=replace_str=0 as a workaround. 
We are planing a better support for this case, but I don't have an ETA:
https://groups.google.com/forum/#!topic/address-sanitizer/M6jmTnYbRRY

Reported by konstantin.s.serebryany on 2014-11-13 00:39:18

@ramosian-glider
Copy link
Member Author

>Try ASAN_OPTIONS=replace_str=0 

This helps, thanks, but does this disable string.h checks for all of my app?

Can not find any note about replace_str here: https://code.google.com/p/address-sanitizer/wiki/Flags
, is it some secret option for privy councillors?

Reported by dushistov on 2014-11-13 01:02:06

@ramosian-glider
Copy link
Member Author

>> This helps, thanks, but does this disable string.h checks for all of my app?

Yes, at least some of them. 
See here for the exact list: 
http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?revision=216184&view=markup&pathrev=216184

The flag is deliberately undocumented, we don't want users to rely on it.

CC-ed Kuba. Kuba, any ETA for the asan interceptor suppressions?
Are you still working on those? 


Reported by konstantin.s.serebryany on 2014-11-13 01:17:40

@ramosian-glider
Copy link
Member Author

Yes, working on that. Can't say any specific date, though.

Reported by kuba.brecka on 2014-11-13 01:47:07

@ramosian-glider
Copy link
Member Author

Suppressions had landed in r223508. Though we need to document them. Would the llvm
webpage be the appropriate place? (For now, http://reviews.llvm.org/D6280 has the best
documentation.)

Reported by zaks.anna on 2015-02-17 05:38:35

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:06:35

  • Labels added: ProjectAddressSanitizer

@kcc
Copy link
Contributor

kcc commented Dec 1, 2015

Should be fixed: http://clang.llvm.org/docs/AddressSanitizer.html#suppressing-reports-in-external-libraries
Open new bugs if something is still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants