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 — Fix UnsatisfiedLinkError when tmpdir is set to a relative path by Baraa-Hasheesh · Pull Request #1515 · async-profiler/async-profiler

Conversation

@Baraa-Hasheesh

@Baraa-Hasheesh Baraa-Hasheesh commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Description

Simple fix for issue where the user might select a relative path for temporary directories using the java.io.tmpdir property

Related issues

#1451

Motivation and context

allow profiler release to run with process that overrides the java.io.tmpdir

How has this been tested?

I wanted to add an integration test somewhere but it wasn't straight forward to do so,
Adding tests would require doing some extra operations in make file & copying around resources to make it doable (specially due to the String resourceName = "/" + getPlatformTag() + "/libasyncProfiler.so"; line)

Test was done in manual capacity

Before change

java -Djava.io.tmpdir=./tmp-here -classpath /workplace/bhashesh/testing-profiler/target/classes:/local/home/bhashesh/.m2/repository/tools/profiler/async-profiler/4.2/async-profiler-4.2.jar org.example.App 

Exception in thread "main" java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: ./tmp-here/libasyncProfiler-5647789745460810263.so
        at java.base/java.lang.Runtime.load0(Runtime.java:764)
        at java.base/java.lang.System.load(System.java:1646)
        at one.profiler.AsyncProfiler.getInstance(AsyncProfiler.java:45)
        at one.profiler.AsyncProfiler.getInstance(AsyncProfiler.java:26)
        at org.example.App.main(App.java:13)

After change

java -Djava.io.tmpdir=./tmp-here -classpath /workplace/bhashesh/testing-profiler/target/classes:/local/home/bhashesh/.m2/repository/tools/profiler/async-profiler/4.2/async-profiler-4.2.jar org.example.App 

Hello World! 4.1-f9b7810

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
@Baraa-Hasheesh
use getAbsolutePath instead of getPath
b9773c2
@apangin apangin changed the title use getAbsolutePath instead of getPath Fix UnsatisfiedLinkError when tmpdir is set to a relative path Oct 1, 2025
@apangin
apangin merged commit 6453ccc into async-profiler:master Oct 1, 2025
@Baraa-Hasheesh Baraa-Hasheesh mentioned this pull request Oct 1, 2025
java.lang.UnsatisfiedLinkError is thrown when using Java API #1451
Closed
jbachorik pushed a commit to DataDog/async-profiler that referenced this pull request Jan 2, 2026
@Baraa-Hasheesh @jbachorik
Fix UnsatisfiedLinkError when tmpdir is set to a relative path (async…
2735fc4
…-profiler#1515)
jbachorik pushed a commit to DataDog/async-profiler that referenced this pull request Jan 6, 2026
@Baraa-Hasheesh @jbachorik
Fix UnsatisfiedLinkError when tmpdir is set to a relative path (async…
941b55b
…-profiler#1515)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

2 participants

@Baraa-Hasheesh @apangin
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.