Summary: | [asan] is not intercepting aligned_alloc | ||
---|---|---|---|
Product: | gcc | Reporter: | Lars Gullik Bjønnes <larsbj> |
Component: | sanitizer | Assignee: | Kostya Serebryany <kcc> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dodji, dvyukov, eugeni.stepanov, jakub, kcc, tavianator |
Priority: | P3 | ||
Version: | 5.0 | ||
Target Milestone: | 5.0 | ||
Host: | Target: | ||
Build: | Known to work: | 5.0 | |
Known to fail: | Last reconfirmed: | 2014-07-04 00:00:00 |
Description
Lars Gullik Bjønnes
2014-07-03 23:00:48 UTC
Interesting. This is a relatively new c11 feature. On older Linux distros this does not compile nor link: aligned_alloc.c: In function ‘main’: aligned_alloc.c:5:3: warning: implicit declaration of function ‘aligned_alloc’ [-Wimplicit-function-declaration] void * p = aligned_alloc(128, 1024); ... /tmp/ccJJcsqx.o: In function `main': aligned_alloc.c:(.text+0x13): undefined reference to `aligned_alloc' On Ubuntu 14.04 it behaves as you describe and indeed we need to add an interceptor. The tricky part is to add a test that will work on older distros Just declare it yourself? If libasan always contains the aligned_alloc symbol, then the testcase will link even when system glibc does not contain it... yep, that's the plan... http://llvm.org/viewvc/llvm-project?view=revision&revision=212322 implements aligned_alloc support on Linux. I will let others implement Android/Windows/Mac support if relevant. This will reach GCC with the next libsanitizer merge (not sure when), or feel free to cherry pick in a couple of days (to make sure it works well) Fixed. |