GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Liberica to the CI on Alpaquita musl by krk · Pull Request #1466 · async-profiler/async-profiler

Conversation

@krk

@krk krk commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

Motivation and context

We can consider including more distributions in the GHA CI.

How has this been tested?

CI


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@apangin

apangin commented Sep 8, 2025

Copy link
Copy Markdown
Collaborator

What value does this particular configuration add? Do you know any errors that other configurations don't catch?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk

krk commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

Testing a commit that could potentially fail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk krk changed the title Add Liberica to the CI on AL2023 Add Liberica to the CI on Alpaquita musl Sep 9, 2025
@krk

krk commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

Please see https://github.com/async-profiler/async-profiler/actions/runs/17581662920/job/49939353504?pr=1466 for failures about malloc tracer with the gcc version in alpaquita.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@krk

krk commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

All 4 failures are about calloc in nativemem tests.

NativememTests.canAgentTraceMallocCalloc (args: once) (agentArgs: start,nativemem,total,collapsed,file=%f)
NativememTests.canAgentTraceMallocCalloc/VM (args: once) (agentArgs: start,nativemem,total,cstack=vm,collapsed,file=%f)
NativememTests.canAsprofTraceAllNoLeak
NativememTests.canAsprofTraceMallocCalloc

Looks like the same root cause as #1226 (comment), cannot sample calloc.

Note that the calloc_hook_dummy workaround not applicable in this case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Baraa-Hasheesh

Baraa-Hasheesh commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

@krk I've checked the issue here & the root cause for the failures is that on Alpaquita musl calloc doesn't call malloc internally

        if (OS::isMusl()) {
            // On musl, calloc() calls malloc() internally, and posix_memalign() calls aligned_alloc().
            // Use dummy hooks to prevent double-accounting. Dummy frames from AP are introduced
            // to preserve the frame link to the original caller (see #1226).
            cc->patchImport(im_calloc, (void*)calloc_hook_dummy);
            cc->patchImport(im_posix_memalign, (void*)posix_memalign_hook_dummy);
        } else {
            cc->patchImport(im_calloc, (void*)calloc_hook);
            cc->patchImport(im_posix_memalign, (void*)posix_memalign_hook);
        }

We assume that if MUSL that calloc would always call malloc internally which seems to be incorrect in this case

Just change the cc->patchImport(im_calloc, (void*)calloc_hook_dummy); to cc->patchImport(im_calloc, (void*)calloc_hook); & it should work (Not a proper fix, but you can try it)

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin

apangin commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

It turns out that in this Alpaquita docker image musl is statically linked with mimalloc (!) which behaves differently from musl's built-in malloc implementation. So, it's not enough to check if the current process runs with glibc or musl, because libc itself can be built with an alternative implementation :-/

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin apangin mentioned this pull request Sep 21, 2025
Detect if calloc calls malloc #1500
Merged
apangin
apangin reviewed Sep 23, 2025
View reviewed changes
Comment thread .github/workflows/test-and-publish-nightly.yml Outdated
image: public.ecr.aws/bellsoft/alpaquita-linux-gcc:15.2-musl
asprof-binaries-job: linux-x64
before-checkout: |
apk add liberica21-jdk util-linux-misc

@apangin apangin Sep 23, 2025

Copy link
Copy Markdown
Collaborator

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.

Instead of installing these every time, wouldn't it be better to prepare an image with all the tools in place? That's what we do for other OS distributions.
This is especially relevant in the light of HTTP 504 failures during apk add I saw in the previous runs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

krk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@krk krk Sep 25, 2025

Copy link
Copy Markdown
Contributor Author

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 do after #1502 is merged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@krk
Add Liberica to the CI on Alpaquita musl
7757b14
@krk
krk force-pushed the liberica branch from a8f7026 to 7757b14 Compare September 30, 2025 10:47
@krk

krk commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

Force-pushed to resolve the conflict.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin
apangin merged commit 861f4f4 into async-profiler:master Sep 30, 2025
jbachorik pushed a commit to DataDog/async-profiler that referenced this pull request Jan 2, 2026
@krk @jbachorik
Add Liberica to the CI on Alpaquita musl (async-profiler#1466)
034e84e
jbachorik pushed a commit to DataDog/async-profiler that referenced this pull request Jan 6, 2026
@krk @jbachorik
Add Liberica to the CI on Alpaquita musl (async-profiler#1466)
fb35876
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@apangin apangin apangin left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@krk @apangin @Baraa-Hasheesh
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.