dmd/druntime/test
Vladimir Panteleev 7cdae6e3bb
Add Valgrind GC integration (#15304)
* rt.minfo: Avoid calling realloc with size 0

This is not portable, and memcheck complains about this.

* Add C Valgrind API

Add the BSD-licensed C header files which provide the API for
controlling Valgrind from within programs executed under it.

The files are from Valgrind v3.21.0.

* Add some D bindings for the Valgrind C API

We will use these in the GC implementation to tell Valgrind which
memory operations are OK or not.

* Silence Valgrind warnings caused by GC marking

Allow the conservative GC to scan memory, whether it has been
initialized by the application or not.

* Add test suite for Valgrind

* Unify VALGRIND with MEMSTOMP

The two share the same goal: mark memory which should not be accessed
any more.

* Mask "invalid" access to free lists

The GC stores free lists in the cells of the objects on the list.

We would like to allow the GC to work with these lists, but still
raise a warning if application code attempts to access them.

* Distinguish between writable and unwritable invalidation

Freshly allocated memory should be writable but not readable.

Explicitly deallocated or GC-ed memory should be neither readable or
writable.

* Add use-after-free test

* Invalidate freshly-allocated memory

* Integrate VALGRIND with SENTINEL

* Fix reporting of arrays of structs with destructors

* Re-invalidate reused blocks during malloc/calloc

* Add Changelog entry

* .pre-commit-config.yaml: Exempt vendored files

* etc.valgrind.valgrind: Propagate return values of the vbits functions

* etc.valgrind.valgrind: Add documentation for functions

Copy/adapt the documentation in memcheck.h.

* druntime/test/valgrind: Add no_use_after_gc test

* ci/cirrusci.sh: Install Valgrind on Linux

Run the Druntime Valgrind integration tests.

libc6-dbg is needed to allow Valgrind to redirect certain functions.

* etc.valgrind.valgrind: Add @nogc

Although the GC is the primary user, this is not a restriction of
these Valgrind API wrappers.

* druntime/test/valgrind: Fix no_use_after_gc test with -release

Trick the optimizer to pretend we're doing something with the result
of those invalid memory accesses.
2023-06-15 01:01:42 -07:00
..
aa Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
allocations [stable] druntime: Fix InvalidMemoryOperation error on Windows when throwing exceptions from finalizers (#14901) 2023-02-22 11:17:24 +02:00
betterc Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
config Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
coverage Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
cpuid Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
cycles Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
exceptions fix issue 23859 - [REG 2.103] Throwing while in a deep callstack causes memory corruption (#15127) 2023-04-25 22:32:16 +03:00
gc fix Issue 23593 - core.thread: suspendAll doesn't wait for all if current thread has detached itself. 2022-12-31 02:12:56 +01:00
hash Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
imports Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
init_fini Fix build script paths to work with new merged repository structure 2022-07-09 23:49:27 +02:00
lifetime Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
profile Translate _d_newitem{U,T,iT} to a single template (#14664) 2023-05-12 11:29:10 +03:00
shared Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
stdcpp druntime: Demangle C++ symbols if a standard library is already loaded 2022-10-29 10:59:46 +01:00
thread Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
traits Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
typeinfo Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
unittest Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
uuid Fix build script paths to work with new merged repository structure 2022-07-09 23:49:27 +02:00
valgrind Add Valgrind GC integration (#15304) 2023-06-15 01:01:42 -07:00
.gitignore Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00
common.mak ci: Update cirrus macOS image to M1-based runners (#14772) 2023-01-03 01:23:03 +02:00
nogc.d Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00