Skip to content

Commit afa13dd

Browse files
authored
Merge branch 'main' into pfournillon/improve-container-tests
2 parents 6462618 + 4011bf7 commit afa13dd

23 files changed

Lines changed: 1960 additions & 347 deletions

File tree

.gitlab/reliability/.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ variables:
4141
- out.log
4242
reports:
4343
dotenv: build.env
44-
expire_in: 1 day
44+
expire_in: 7 days
4545

4646
reliability-amd64:
4747
extends: .reliability_job
@@ -99,7 +99,7 @@ reliability-aarch64:
9999
- out.log
100100
reports:
101101
dotenv: build.env
102-
expire_in: 1 day
102+
expire_in: 7 days
103103

104104
reliability-chaos-amd64:
105105
extends: .reliability_chaos_job

AGENTS.md

Lines changed: 45 additions & 336 deletions
Large diffs are not rendered by default.

build-logic/conventions/src/main/kotlin/com/datadoghq/native/config/ConfigurationPresets.kt

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object ConfigurationPresets {
5151
configureTsan(this, currentPlatform, currentArch, version, rootDir, compiler)
5252
}
5353
register("fuzzer") {
54-
configureFuzzer(this, currentPlatform, currentArch, version, rootDir)
54+
configureFuzzer(this, currentPlatform, currentArch, version, rootDir, compiler)
5555
}
5656
}
5757

@@ -222,9 +222,13 @@ object ConfigurationPresets {
222222
// HeapBaseMinAddress is not accepted by JDK <= 11 (constraint violation);
223223
// those JDKs rely on the vm.mmap_rnd_bits=8 CI-level mitigation instead.
224224
if (PlatformUtils.testJvmMajorVersion() >= 12) {
225+
// HeapBaseMinAddress=64MB leaves ~1.9GB of address space below the
226+
// shadow region (0x7fff7000); 1024m keeps heap+CompressedClassSpace
227+
// well within that margin while giving forkEvery-restarted JVMs
228+
// enough headroom to avoid "Java heap space" OOMs seen in nightly CI.
225229
config.testJvmArgs.addAll(listOf(
226230
"-XX:HeapBaseMinAddress=0x4000000",
227-
"-Xmx512m",
231+
"-Xmx1024m",
228232
"-XX:CompressedClassSpaceSize=256m"
229233
))
230234
}
@@ -309,7 +313,8 @@ object ConfigurationPresets {
309313
platform: Platform,
310314
architecture: Architecture,
311315
version: String,
312-
rootDir: File
316+
rootDir: File,
317+
compiler: String = "gcc"
313318
) {
314319
config.platform.set(platform)
315320
config.architecture.set(architecture)
@@ -335,7 +340,28 @@ object ConfigurationPresets {
335340
when (platform) {
336341
Platform.LINUX -> {
337342
config.compilerArgs.set(fuzzerCompilerArgs + commonLinuxCompilerArgs(version))
338-
config.linkerArgs.set(commonLinuxLinkerArgs() + fuzzerLinkerArgs)
343+
344+
// commonLinuxLinkerArgs() carries -Wl,-z,defs, which forbids the
345+
// undefined __asan_*/__ubsan_* symbols the instrumented objects
346+
// reference. -fsanitize=address only links the runtime into
347+
// executables, not shared libraries, so the fuzzer .so needs the
348+
// runtime linked explicitly — same treatment (and rationale) as the
349+
// asan config. On clang this resolves both __asan_* and __ubsan_*
350+
// from one clang_rt.asan runtime; on gcc it adds -lubsan.
351+
val libasan = PlatformUtils.locateLibasan(compiler)
352+
val fuzzerRuntimeArgs = if (libasan != null) {
353+
val asanLibDir = File(libasan).parent
354+
val asanLibName = File(libasan).nameWithoutExtension.removePrefix("lib")
355+
val ubsanLibs = if (asanLibName.startsWith("clang_rt")) emptyList()
356+
else listOf("-lubsan")
357+
listOf("-L$asanLibDir", "-l$asanLibName",
358+
"-Wl,-rpath,$asanLibDir") +
359+
ubsanLibs +
360+
fuzzerLinkerArgs
361+
} else {
362+
fuzzerLinkerArgs
363+
}
364+
config.linkerArgs.set(commonLinuxLinkerArgs() + fuzzerRuntimeArgs)
339365

340366
config.testEnvironment.apply {
341367
put("ASAN_OPTIONS", "allocator_may_return_null=1:detect_stack_use_after_return=0:handle_segv=0:abort_on_error=1:symbolize=1:suppressions=$rootDir/gradle/sanitizers/asan.supp")

build-logic/conventions/src/main/kotlin/com/datadoghq/profiler/ProfilerTestPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ class ProfilerTestPlugin : Plugin<Project> {
321321
// https://github.com/eclipse-openj9/openj9/issues/23514
322322
!PlatformUtils.isTestJvmJ9()
323323
}
324-
// The ASAN test JVM is pinned to -Xmx512m (see ConfigurationPresets.kt)
324+
// The ASAN test JVM is pinned to -Xmx1024m (see ConfigurationPresets.kt)
325325
// to keep the heap below ASan's shadow-memory region. Without forking,
326326
// Gradle reuses one JVM for the whole suite, and per-test allocations
327327
// (JFR recordings, JMC object models) accumulate until it OOMs late in

ddprof-lib/src/main/cpp/hotspot/hotspotStackFrame_aarch64.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#include <string.h>
1010
#include "hotspot/hotspotStackFrame.h"
11+
// The VMNMethod accessors used below are inline in vmStructs.h and assert via crashProtectionActive()
12+
// / cast_to(), both of which are defined in vmStructs.inline.h. Without this include, assertion-enabled
13+
// builds (the gtest targets) leave those symbols unresolved at link time.
14+
#include "hotspot/vmStructs.inline.h"
1115

1216
static inline bool isSTP(instruction_t insn) {
1317
// stp xn, xm, [sp, #-imm]!

ddprof-lib/src/main/cpp/hotspot/hotspotStackFrame_x64.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
#include <string.h>
1010
#include "hotspot/hotspotStackFrame.h"
11+
// See the note in hotspotStackFrame_aarch64.cpp: the VMNMethod accessors need vmStructs.inline.h
12+
// for crashProtectionActive() / cast_to() so assertion-enabled builds link.
13+
#include "hotspot/vmStructs.inline.h"
1114

1215
__attribute__((no_sanitize("address"))) bool HotspotStackFrame::unwindStub(instruction_t* entry, const char* name, uintptr_t& pc, uintptr_t& sp, uintptr_t& fp) {
1316
instruction_t* ip = (instruction_t*)pc;

0 commit comments

Comments
 (0)