Age | Commit message (Collapse) | Author | Files | Lines |
|
Conditioning the interceptors
by SANITIZER_TIZEN and SANITIZER_RISCV64
Change-Id: I53eb96d6b58f2c22ad3db5c1b56186173fa4e5c1
Signed-off-by: yaroslav <y.yamshchiko@samsung.com>
|
|
Previously sleep interval length of BackgroundThread was determined by a
hardcoded value, thus limiting time resolution of dependent tools, such
as Heap Profiler. This commit implements simple algorithm which
remembers last several sleeps (namely 2), their durations and whether or
not they were followed by some interesting events (i.e. delivery of some
memory usage statistics). Then it tries to predict an optimal sleep
length for the next time, changing it dynamically.
Change-Id: Ia95cc5ac60ff9ac9edaa8b7b99e319c0bce80ea7
Signed-off-by: Andrey Drobyshev <a.drobyshev@samsung.com>
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: yaroslav <y.yamshchiko@samsung.com>
|
|
In the previos heap profiler implementation HeapProfile instance was
created every time BackgroundThread wanted to collect statistical data.
This commit simply applies the singleton pattern: now there's only one
HeapProfile object which can both decide wether it's time to collect the
statistics and print profiling data.
Change-Id: I509de33174ff0114428d66394e0ef06116b0a9a9
Signed-off-by: Andrey Drobyshev <a.drobyshev@samsung.com>
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: yaroslav <y.yamshchiko@samsung.com>
|
|
Upstream sanitizers for riscv64 only support 39-bit address space accordingly
to RISC-V 64 specification.
But when executed under qemu-user-riscv64 on x86_64 host the address space
bitness mismatches which leads to internal stack errors inside AddrInMem()
checks. And the check fails correctly: x86_64 bit host kernel allocates the
stack in High Mem segment like 0x7fe000000000 which just does not fit into the
39-bit memory model.
This patch switches the sanitizer to dynamic detection of address space, which
might formally violate the spec, but allows sanitized binaries to be executed
under qemu-user-riscv64 on x86_64 host.
Change-Id: I55946dc612cc73bf5f60c34e53296eab74622f4f
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Change-Id: I8fee2abc1f50ab61ea3a179ad33d4bfa247c3f5a
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|
|
related commits :
- bffde000fc38be874c6cda245e9d2f7dfc7a5afa
- 170fe0f7ae46cfa40069ab9b42f288d5f359dbbf
Change-Id: I544d08d0ca0a32c9fe4ffdce06b1b17b673c233c
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|
|
Change-Id: I01c4e139c67289f1398de7583091ad20ee851bbe
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|
|
Currently the sed command line is wrong for sed in configure script and
therefore composition of -Os with -Wl,-O1 results into wrong command line.
Change-Id: I0a0e8e908956e0435f3f404373aec9e6648eb2f7
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
https://github.sec.samsung.net/RS-TizenStudio/tizen-gnu-toolchain-upgrade/issues/46
Change-Id: I43c3919dd7e297cc62c632be5176d26b2181a821
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|
|
Change-Id: I7427bea84bf7593ac72c27d24148ad6296616fad
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Change-Id: Ic247cb33f17743fa597b3a74baf7cf31c075165d
|
|
The LSan library has very big static TLS section
Problem:
- LSan library could not be loaded dynamically because it had a very
big static TLS section.
AllocatorCache: ~15KB for 32bit
~53KB for 64bit
Solution:
- Store in the TLS section only a pointer to the AllocatorCache and
dynamically allocate memory for it.
Change-Id: I6e90e6682e277c90825938f5732867b6564d62b4
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
|
|
Set frame pointer to the predictable location in the stack frame
for arm with THUMB2 mode.
Denis Khalikov <d.khalikov@partner.samsung.com>
* config/arm/arm.c (arm_emit_multi_reg_pop_no_return): New function.
(arm_compute_initial_elimination_offset): Add support for
TARGET_THUMB_STACK_UNWIND.
(arm_expand_prologue): Emit function prologue related to
TARGET_THUMB_STACK_UNWIND.
(thumb2_expand_return): Emit function epilogue related to
TARGET_THUMB_STACK_UNWIND.
(arm_expand_epilogue): Emit function epilogue related to
TARGET_THUMB_STACK_UNWIND.
* config/arm/arm.h (TARGET_THUMB_STACK_UNWIND): New define.
(INITIAL_ELIMINATION_OFFSET): Add support for
TARGET_THUMB_STACK_UNWIND.
* config/arm/arm.opt: Add compile-time option THUMB_FP.
* gcc/testsuite/c-c++-common/asan/fast-unwind-thumb.c: New tests.
Change-Id: I45a68a1216f3115c5199e5cea14c344fabe11fc1
|
|
List of interceptors:
__strcat_chk,
__strncat_chk,
__strcpy_chk,
__strncpy_chk.
__poll_chk,
__ppoll_chk,
__read_chk,
__recv_chk,
__recvfrom_chk,
__pread_chk,
__pread64_chk.
__getgroups_chk,
__getcwd_chk,
__realpath_chk,
__confstr_chk.
__mbstowcs_chk,
__mbsrtowcs_chk,
__mbsnrtowcs_chk,
__wcstombs_chk,
__wcsrtombs_chk,
__wcsnrtombs_chk,
__wcrtomb_chk,
__ttyname_r_chk.
Change-Id: I16ef4d2d80089b96e5c51ea5160b706b35f9ce18
|
|
Differential Revision: https://reviews.llvm.org/D40951
Change-Id: I7c32945659da4cf80e995370cb26fb063bb7930c
|
|
The LLVM test has been rewritten to be able to run inside GCC test suite.
Change-Id: Ifaf9e3681ddacfaad73a314a01ab3c6c7704d40b
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Don't overwrite exit code in LSan when running on top of ASan in recovery mode
to avoid breakage of users code due to found leaks.
Change-Id: I172f59734837d3df350c9e586ace2547ae9f3f23
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
ChangeLog.Tizen is to keep track of private patches for Tizen GCC.
Change-Id: I2fbde58d410ab4a7ddbda361be86a48de9d891e3
|
|
gcc/
* tree.def: Add STATEMENT_LIST_END tree code.
* tree.c: Add STATEMENT_LIST_END handling as TS_COMMON.
* gimplify.c (gimplify_expr): Use STATEMENT_LIST_END location to
provide right information for try_finally_expr.
* tree-eh.c (lower_try_finally_onedest): Set finally location
* c-family/c-semantics.c (pop_stmt_list): Support single-statement
lists extraction with STATEMENT_LIST_END in the end.
* fold-const.c (operand_equal_p): Add STATEMENT_LIST_END support.
gcc/cp/
* parser.c (cp_parser_compound_statement): Use STATEMENT_LIST_END
to keep the location of closing brace.
* pt.c: Handle STATEMENT_LIST_END.
* constraint.cc (check_function_concept): Handle concept definitions
with STATEMENT_LIST_END.
* error.c (dump_expr): Add STATEMENT_LIST_END support.
gcc/testsuite/
* g++.dg/ext/statement-list-end.C: New.
Change-Id: Id22e953b97b52d0f2a2ba44065337a59639578db
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
In case systemd was build with UBSan we should
ensure that /proc is mounted, to prevent booting
error.
Change-Id: I52016a5e440f311c85f6fe2cad1dfd7966976651
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
|
|
libsanitizer/
* asan/asan_flags.cc: Switch on leak detection for 64-bit target.
* lsan/lsan.cc: Likewise.
* sanitizer_common/sanitizer_flags.inc: Likewise.
Neither the OBS build nor sanitized firmware build are affected.
When Tizen application developer enables ASan for his own package only and run
it in 64-bit emulator (without any additional setup) ASan will report leaks
additionally to all other error messages.
Change-Id: Id16017e9bbe5221778330287c707bdf1846f0760
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
libsanitizer/
* sanitizer_common/sanitizer_coverage_libcdep_new.cc
(__sanitizer_cov_trace_pc): New function.
Change-Id: I1ead302ccb56c8f20d1a6e29a7cdef8963fa4090
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
|
|
The MaybeMountProcFS uses SanitizerToolName in its failure messages so we
need it defined at this point.
Change-Id: I6a568e1ebf3d646ecfbdb53fd8e48910e9b66559
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
Allow nice host builds with Tizen libasan.
|
|
code from {A, UB}San to sanitizer_common code.
Add -fno-omit-frame-pointer -U_FORTIFY_SOURCE to lsan-force-options because
LSan heavily relies on frame pointers. Disable LSan in QEMU builds through
LSAN_OPTIONS file. Refactor Tizen specific patches in ASan and UBSan.
Change-Id: I5365daee191dd1f61229757b8f47d102390d59a0
|
|
Some ASan tests fail due to:
1) Unable to unwind malloc trace.
2) Return invalid code due to hant_on_error=false enabled by default.
Let's fix this.
Change-Id: I634c5bff0e21a693a4168eaa12f443cee114a83e
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
Set detect_leaks and halt_on_error to false by default because mic
installs asan-build-env package too late.
Change-Id: I497f1f8e6a1e9425e40c8087ea50b14d176a04ce
|
|
It seems that we have lots of redundant MaybeMountProcFS, in particular
each mapped sanitized shared library calls it from AsanInitializer constructor.
Remove redudant MaybeMountProcFS calls from AsanInitializer and __asan_init.
Also, it seems that under qemu-aarch64 opening /proc/self/maps for reading
might be very expensive, so replace OpenFile("/proc/self/maps", RdOnly) with
FileExists("/proc/self/maps") in MaybeMountProcFS to avoid expensive calls.
Change-Id: I8ba28dbbc102be519fa2b284520509f601ec5cf7
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
Change-Id: I84fc05f8672a17ee7c862595d9c25c86c9f18f27
|
|
qemu-aarch64. Adjust halt_on_error tests.
gcc/testsuite/
* c-c++-common/asan/pr64820.c: Adjust output patterns.
* c-c++-common/asan/halt_on_error-1.c: Adjust.
* c-c++-common/asan/halt_on_error-1.c: Likewise.
|
|
This commit fixes undefined reference error from libasan.so:
/lib/libasan.so: undefined reference to `lsan_check_in_progress'
occurred due to ASan runtime embeds part of LSan runtime and
misses lsan_check_in_progress symbol. To overcome the issue, just move
lsan_check_in_progress definition to lsan_common.cc.
Change-Id: I9ed7f4d490d525bbf7ce054285afaec24716f35a
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
Some allocators may use mmap for their local pools that may cause false positive
reports because LSan currently doesn't intercept mmap call mainly due to its
complexity (we don't know whether a particular mmap would contain live pointers).
However for some cases (e.g. anonymous rw mmaps) we can guess that they would
contain live pointers thus we can add them into root regions. Thus, now we
intercept mmap/munmap calls, add anonymous rw mappings into root regions and
call real mmap.
Change-Id: Ie0bde91497a31ab670f15d67b34d328969dc0981
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
This change tries to reduce memory consumption of {A, L}Saned image by hacking
primary allocator internals:
* Reduce region size 2^20 -> 2^17.
* Make largest chunk size in primary allocator 2^17 -> 2^16.
The change appears to be quite useful for LSan'ed image:
Stock version:
total used free shared buffers cached
Mem: 964 828 136 3 4 92
Patched version:
total used free shared buffers cached
Mem: 964 688 275 5 13 185
Change-Id: I80b95f7dfb5a7be0e7208567a31606a3d027256c
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
|
|
There are processes which are executed with root permissions and then
change the user during run on target.
Without setting up the file mode to 0777 trying to write log causes
write error and process exits.
Change-Id: I88c6738625d67f4db2efea76cc8928d4f58b6e7c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Change-Id: I65d37582e6b5c3d54f8628e96edbaf4cbfc7c337
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
|
|
The sha1 contains intentional unaligned access
Change-Id: I5bb6d0c9bf274e8ed0fe4c87c341dee054623202
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Since our ASan does not fail application on error by default we should
switch this behaviour on explicitly to keep testsuite work.
Change-Id: I4344f82427bc62a40604a75f5f09f62333b6782d
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
|
|
Without setting up the file mode explicitly its impossible to read the
logs by users in OBS.
Change-Id: Icaa540b434fc6266cbd0b1ad3391e21b8cbb692f
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
The binary name is needed for reporting with log_path since PID is not
always enough to identify the process right.
Change-Id: Ibefe22bac9f4d2a89eaacb40e6d7dc860b08d5f9
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
* Read LSAN_OPTIONS from /LSAN_OPTIONS file.
* Add MaybeMountProcFS stuff for LSan. This would allow us to preload
liblsan.so even for systemd when /proc/ isn't mounted yet.
* Add ARM and x86 ports for LSan.
* Add PointsIntoChunk method to protect against segfault when pointer
points to metadata.
* Make cf.exitcode = 0 by default.
commit a6549ffda72b4f84bbd2c763640181eaeccf6582
Change-Id: I20b10bd29f4ed25e78a61b70dfb82b12c1be352e
|
|
Backport from VDLinux 5. Optionally mount /proc in __asan_init to allow
systemd sanitization.
2014-10-21 Yury Gribov <y.gribov@samsung.com>
JIRA: MAVDT-64
* libsanitizer/asan/asan_rtl.cc (MaybeMountProcFS): New function.
(__asan_init): Call MaybeMountProcFS.
Mount /proc not only in AsanInitInternal, but also in __asan_init and AsanInitializer to
ensure we have proc mounted when needed.
* libsanitizer/asan/asan_rtl.cc (__asan_init): Call MaybeMountProcFS.
* (AsanInitializer): Likewise.
Set address space unlimited if it is not.
* libsanitizer/asan/asan_rtl.cc (MaybeDisableUlimit): New function.
(AsanInitInternal): Call it.
Read ASan and UBSan options from predefined file if it is available.
* libsanitizer/asan/asan_flags.cc: Read ASAN_OPTIONS from predefined
file if available.
* libsanitizer/ubsan/ubsan_flags.cc: Likewise.
Change-Id: Ibfa7a3bb032f757e28cf7baac19882a8e4367cae
|
|
Change-Id: Icf28ce7c590f459e6e7a851d9de0ac5b997cce34
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|
|
At least until a decision on system-wide %_libdir for RISC-V 64 is made
Change-Id: I509acf5263a3f06afd4395b4d72b931789e44454
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Change-Id: I377f05d4a027040f22b9c22d361efd9865584132
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
This reverts commit 15f23fa790a5c3396ce177981d8395152b679266.
|
|
Change-Id: I5495f7a6c39462b22f3470380982f5ae1bbd48b1
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Now the library is built by default
Change-Id: I60d5f8a4b82d54556ecf8f70deb597a7047371aa
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
|
|
Change-Id: I64c7fc98d709773616da57490647f5a1ae0ea53d
|
|
* gmp-6.1.2 -> 6.2.1
* mpfr-4.0.2 -> 4.2.0
* mpc-1.1.0 -> 1.3.1
Change-Id: Iffc8a68e30dfff976e1b8628f64bcc406b778148
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
|