Commit graph

9 commits

Author SHA1 Message Date
Martin Kinkelin
ff698ba103 Convert posix.mak to generic Makefile
Usable on Windows too, with a GNU make.
2023-12-09 15:59:14 +01:00
Martin Kinkelin
c847abc42a Remove deprecated compiler Makefiles 2023-12-09 15:59:14 +01:00
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
Iain Buclaw
f382114888 Makefile: stub out all auto-tester-build and auto-tester-test recipes 2023-01-03 01:23:03 +02:00
Johan Engelen
68ca0b8d6e Force makefile to x86 on Apple ARM cpu (dmd does not support ARM) 2022-10-22 19:46:32 +02:00
Geod24
cd205fcb52 druntime: Do not build C files with verbose flag 2022-07-10 03:31:08 +02:00
Geod24
f0a8c569b5 Remove now unused CI files / duplicated LICENSE file 2022-07-10 03:28:27 +02:00
Iain Buclaw
09d04945bd Fix build script paths to work with new merged repository structure
Co-Authored-By: Geod24 <pro.mathias.lang@gmail.com>
Co-Authored-By: Martin Kinkelin <noone@nowhere.com>
Co-Authored-By: Vladimir Panteleev <git@cy.md>
2022-07-09 23:49:27 +02:00
Iain Buclaw
69ab16a7e8 Merge dlang/druntime repository into dlang/dmd 2022-07-09 18:53:15 +02:00