Skip to content

Commit 41d7bfc

Browse files
authored
Merge branch 'main' into nicholas.hulston/fix-span-link-optional-fields
2 parents 418f00b + 2679922 commit 41d7bfc

File tree

92 files changed

+3227
-2133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3227
-2133
lines changed

Cargo.lock

Lines changed: 40 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ resolver = "2"
5858
[workspace.package]
5959
rust-version = "1.78.0"
6060
edition = "2021"
61-
version = "15.0.0"
61+
version = "16.0.3"
6262
license = "Apache-2.0"
6363

6464
[profile.dev]
@@ -73,6 +73,12 @@ opt-level = "s" # optimize for size
7373
[profile.release.package.datadog-serverless-trace-mini-agent]
7474
strip = true
7575

76+
[profile.bench]
77+
codegen-units = 1
78+
debug = false
79+
incremental = false
80+
opt-level = 3
81+
7682
# https://camshaft.github.io/bolero/library-installation.html
7783
[profile.fuzz]
7884
inherits = "dev"

LICENSE-3rdparty.yml

Lines changed: 40 additions & 6 deletions
Large diffs are not rendered by default.

bin_tests/src/bin/crashtracker_bin_test.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ fn main() -> anyhow::Result<()> {
1313
mod unix {
1414
use anyhow::Context;
1515
use bin_tests::modes::behavior::get_behavior;
16+
use nix::{
17+
sys::signal::{kill, raise, Signal},
18+
unistd::Pid,
19+
};
1620
use std::env;
1721
use std::path::Path;
1822

@@ -24,8 +28,9 @@ mod unix {
2428
const TEST_COLLECTOR_TIMEOUT_MS: u32 = 10_000;
2529

2630
#[inline(never)]
27-
unsafe fn deref_ptr(p: *mut u8) {
31+
unsafe fn deref_ptr(p: *mut u8) -> u8 {
2832
*std::hint::black_box(p) = std::hint::black_box(1);
33+
*std::hint::black_box(p)
2934
}
3035

3136
pub fn main() -> anyhow::Result<()> {
@@ -34,6 +39,7 @@ mod unix {
3439
let receiver_binary = args.next().context("Unexpected number of arguments")?;
3540
let output_dir = args.next().context("Unexpected number of arguments")?;
3641
let mode_str = args.next().context("Unexpected number of arguments")?;
42+
let crash_typ = args.next().context("Missing crash type")?;
3743
anyhow::ensure!(args.next().is_none(), "unexpected extra arguments");
3844

3945
let stderr_filename = format!("{output_dir}/out.stderr");
@@ -54,6 +60,7 @@ mod unix {
5460
create_alt_stack: true,
5561
use_alt_stack: true,
5662
resolve_frames: crashtracker::StacktraceCollection::WithoutSymbols,
63+
signals: crashtracker::default_signals(),
5764
endpoint,
5865
timeout_ms: TEST_COLLECTOR_TIMEOUT_MS,
5966
unix_socket_path: Some("".to_string()),
@@ -95,11 +102,22 @@ mod unix {
95102
behavior.post(output_dir)?;
96103

97104
crashtracker::begin_op(crashtracker::OpTypes::ProfilerCollectingSample)?;
98-
unsafe {
99-
deref_ptr(std::ptr::null_mut::<u8>());
105+
match crash_typ.as_str() {
106+
"kill_sigabrt" => kill(Pid::this(), Signal::SIGABRT)?,
107+
"kill_sigill" => kill(Pid::this(), Signal::SIGILL)?,
108+
"kill_sigbus" => kill(Pid::this(), Signal::SIGBUS)?,
109+
"kill_sigsegv" => kill(Pid::this(), Signal::SIGSEGV)?,
110+
"null_deref" => {
111+
let x = unsafe { deref_ptr(std::ptr::null_mut::<u8>()) };
112+
println!("{x}");
113+
}
114+
"raise_sigabrt" => raise(Signal::SIGABRT)?,
115+
"raise_sigill" => raise(Signal::SIGILL)?,
116+
"raise_sigbus" => raise(Signal::SIGBUS)?,
117+
"raise_sigsegv" => raise(Signal::SIGSEGV)?,
118+
_ => anyhow::bail!("Unexpected crash_typ: {crash_typ}"),
100119
}
101120
crashtracker::end_op(crashtracker::OpTypes::ProfilerCollectingSample)?;
102-
103121
Ok(())
104122
}
105123
}

0 commit comments

Comments
 (0)