Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/approve-trivial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ jobs:
scope: DataDog/java-profiler
policy: self.approve-trivial.approve-pr
- name: Auto-approve PR
uses: hmarr/auto-approve-action@8f929096a962e83ccdfa8afcf855f39f12d4dac7 # v4
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0
with:
github-token: ${{ steps.octo-sts.outputs.token }}
script: |
await github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
21 changes: 14 additions & 7 deletions .github/workflows/create-next-milestone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ jobs:
steps:
- name: Get next minor version
id: semvers
uses: WyriHaximus/github-action-next-semvers@18aa9ed4152808ab99b88d71f5481e41f8d89930 # 1.2.1
with:
version: ${{ github.event.milestone.title }}
env:
MILESTONE_TITLE: ${{ github.event.milestone.title }}
run: |
MAJOR=$(echo "$MILESTONE_TITLE" | cut -d. -f1)
MINOR=$(echo "$MILESTONE_TITLE" | cut -d. -f2)
echo "minor=${MAJOR}.$((MINOR + 1)).0" >> "$GITHUB_OUTPUT"
- name: Create next milestone
uses: WyriHaximus/github-action-create-milestone@6f8e11bb23890a15c6cc520abf7a36510dfd0f94 # 1.2.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0
with:
title: ${{ steps.semvers.outputs.minor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createMilestone({
owner: context.repo.owner,
repo: context.repo.repo,
title: '${{ steps.semvers.outputs.minor }}'
})
21 changes: 14 additions & 7 deletions .github/workflows/increment-milestones-on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ jobs:
- name: Get next minor version
if: fromJSON(steps.milestone.outputs.result)
id: semvers
uses: WyriHaximus/github-action-next-semvers@18aa9ed4152808ab99b88d71f5481e41f8d89930 # 1.2.1
with:
version: ${{steps.milestoneTitle.outputs.result}}
env:
MILESTONE_TITLE: ${{ steps.milestoneTitle.outputs.result }}
run: |
MAJOR=$(echo "$MILESTONE_TITLE" | cut -d. -f1)
MINOR=$(echo "$MILESTONE_TITLE" | cut -d. -f2)
echo "minor=${MAJOR}.$((MINOR + 1)).0" >> "$GITHUB_OUTPUT"
- name: Create next milestone
if: fromJSON(steps.milestone.outputs.result)
uses: WyriHaximus/github-action-create-milestone@6f8e11bb23890a15c6cc520abf7a36510dfd0f94 # 1.2.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 9.0.0
with:
title: ${{ steps.semvers.outputs.minor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createMilestone({
owner: context.repo.owner,
repo: context.repo.repo,
title: '${{ steps.semvers.outputs.minor }}'
})
34 changes: 3 additions & 31 deletions ddprof-lib/src/main/cpp/buffers.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,22 @@ class Buffer {

void reset() { _offset = 0; }

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void put(const char *v, u32 len) {
assert(static_cast<int>(_offset + len) < limit());
memcpy(_data + _offset, v, len);
_offset += (int)len;
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
// RecordingBuffer extends _data[] beyond its declared size via struct layout;
// suppress bounds sanitizer on all architectures to avoid false positives.
__attribute__((no_sanitize("bounds")))
#endif
void put8(char v) {
assert(_offset < limit());
_data[_offset++] = v;
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void put16(short v) {
assert(_offset + 2 < limit());
*(short *)(_data + _offset) = htons(v);
Expand All @@ -97,11 +90,8 @@ class Buffer {
// java-profiler/ddprof-lib/src/main/cpp/buffers.h:92:34: runtime error:
// store to misaligned address 0x7f3c446ec81e for type 'int', which
// requires 4 byte alignment 0x7f3c446ec81e: note: pointer points here
__attribute__((no_sanitize("undefined")))
#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("undefined")))
__attribute__((no_sanitize("bounds")))
#endif
void put32(int v) {
assert(_offset + 4 < limit());
*(int *)(_data + _offset) = htonl(v);
Expand All @@ -113,10 +103,7 @@ class Buffer {
// 'u64', which requires 8 byte alignment
// 0x766bb5a1e814: note: pointer points here
__attribute__((no_sanitize("undefined")))
#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void put64(u64 v) {
assert(_offset + 8 < limit());
*(u64 *)(_data + _offset) = OS::hton64(v);
Expand All @@ -135,10 +122,7 @@ class Buffer {
put32(u.i);
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void putVar32(u32 v) {
assert(_offset + 5 < limit());
while (v > 0x7f) {
Expand All @@ -149,10 +133,7 @@ class Buffer {
assert(_offset < limit());
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void putVar64(u64 v) {
assert(_offset + 9 < limit());
int iter = 0;
Expand Down Expand Up @@ -185,27 +166,18 @@ class Buffer {
}
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void putUtf8(const char *v, u32 len) {
len = len < MAX_STRING_LENGTH ? len : MAX_STRING_LENGTH;
put8(3);
putVar32(len);
put(v, len);
}

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void put8(int offset, char v) { _data[offset] = v; }

#ifdef __aarch64__
// the trickery of RecordingBuffer extending Buffer::_data array may trip off asan on aarch64
__attribute__((no_sanitize("bounds")))
#endif
void putVar32(int offset, u32 v) {
assert(offset + 4 < limit());
_data[offset] = v | 0x80;
Expand Down
48 changes: 24 additions & 24 deletions ddprof-lib/src/test/cpp/remoteargs_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,33 @@ TEST_F(RemoteArgsTest, RemoteSymbolicationNoValue) {
}

TEST_F(RemoteArgsTest, RemoteSymbolicationNumericValues) {
Arguments args;

// Test numeric 1 (should enable)
Error error = args.parse("remotesym=1");
EXPECT_FALSE(error);
EXPECT_TRUE(args._remote_symbolication);

// Test numeric 0 (should disable)
args = Arguments();
error = args.parse("remotesym=0");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);
{
Arguments args;
Error error = args.parse("remotesym=1");
EXPECT_FALSE(error);
EXPECT_TRUE(args._remote_symbolication);
}
{
Arguments args;
Error error = args.parse("remotesym=0");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);
}
}

TEST_F(RemoteArgsTest, RemoteSymbolicationNoVariant) {
Arguments args;

// Test "no" (should disable)
Error error = args.parse("remotesym=no");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);

// Test "n" (should disable)
args = Arguments();
error = args.parse("remotesym=n");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);
{
Arguments args;
Error error = args.parse("remotesym=no");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);
}
{
Arguments args;
Error error = args.parse("remotesym=n");
EXPECT_FALSE(error);
EXPECT_FALSE(args._remote_symbolication);
}
}

TEST_F(RemoteArgsTest, RemoteSymbolicationInvalidValue) {
Expand Down
Loading