-
Notifications
You must be signed in to change notification settings - Fork 937
Build and run tests on Alpine #1226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Async-Profiler complains about missing debug symbols: Can we base the new target on zulu-openjdk-alpine? It seems that people are already using AP on that image: zulu-openjdk/zulu-openjdk#76 |
Why not Corretto then? It also has Alpine images |
Missed that, thanks |
The new |
Right, it seems that Alpine libc in this image does not preserve frame pointers, but even worse, it does not include DWARF unwinding info either. I see the following options:
|
I noticed that the following change: diff --git a/src/mallocTracer.cpp b/src/mallocTracer.cpp
index a7d0724..9082754 100644
--- a/src/mallocTracer.cpp
+++ b/src/mallocTracer.cpp
@@ -56,7 +56,7 @@ extern "C" void* malloc_hook(size_t size) {
extern "C" void* calloc_hook(size_t num, size_t size) {
void* ret = _orig_calloc(num, size);
- if (MallocTracer::running() && ret && num && size) {
+ if (!OS::isMusl() && MallocTracer::running() && ret && num && size) {
MallocTracer::recordMalloc(ret, num * size);
}
return ret;
@@ -140,11 +140,11 @@ void MallocTracer::patchLibraries() {
cc->patchImport(im_realloc, (void*)realloc_hook);
cc->patchImport(im_free, (void*)free_hook);
cc->patchImport(im_aligned_alloc, (void*)aligned_alloc_hook);
+ cc->patchImport(im_calloc, (void*)calloc_hook);
if (!OS::isMusl()) {
// On musl, calloc() calls malloc() internally, and posix_memalign() calls aligned_alloc().
// Skip the following hooks to prevent double-accounting.
- cc->patchImport(im_calloc, (void*)calloc_hook);
cc->patchImport(im_posix_memalign, (void*)posix_memalign_hook);
}
} fixes the problem: /async-profiler # grep test.nativemem.Native.calloc x.txt
test/nativemem/CallsMallocCalloc.main;test/nativemem/Native.calloc;Java_test_nativemem_Native_calloc;calloc;malloc_hook 10000735 but I can't understand why. |
This is because |
I see, thanks. Could this also be a solution? We could have two different versions of |
Sounds interesting. This may be a simple and effective way to solve the problem. |
please ping here when prerequisite PRs are merged. |
We're only missing #1254 here |
make COMMIT_TAG=${GITHUB_SHA:0:7} FAT_BINARY=true release coverage -j | ||
;; | ||
alpine*) | ||
make COMMIT_TAG=$HASH release coverage -j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is $HASH
for this case and ${GITHUB_SHA:0:7}
for other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git merge
troubles, fixed in 4618514
java-version: 11 | ||
java-distribution: corretto | ||
image: "public.ecr.aws/async-profiler/asprof-builder-arm:latest" | ||
image: public.ecr.aws/async-profiler/asprof-builder-arm:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Alpine, we need to test binaries that were built on Debian.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: ubuntu-latest | ||
image: public.ecr.aws/async-profiler/asprof-builder-x86:latest | ||
- runson: | ||
display: alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will artifacts from this build be published in a release? They should not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought Alpine should have its own artifacts, fixed in 91e17e2
make COMMIT_TAG=${GITHUB_SHA:0:7} FAT_BINARY=true release coverage -j | ||
make COMMIT_TAG=$HASH FAT_BINARY=true release coverage -j | ||
;; | ||
alpine*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we no longer build on alpine, this case is not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and same for setup-java a bit above, thanks: 2cd2700
Description
In this PR I add a new Alpine build/test target.
Related issues
Fixes #1136
Motivation and context
Find musl-specific issues early.
How has this been tested?
GHA
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.