Async profiler (windows): "Could not find compiler TLS offsets for VMThread. Unsupported JVM?" using AdoptOpenJDK 1.8.0_292-b10 : IDEA-270240

Profiling command line application does not work with AdoptOpenJDK 1.8.0_292-b10, showing the following output in the console:

Could not find compiler TLS offsets for VMThread. Unsupported JVM?

C detected

Using AdoptOpenJDK 11.0.11+9 does work.

By the way, I love the work you (Kirill) have done for the Windows port, and will be playing with this a lot.

It would be good to be aware of any limitations in the current version though, so as not to report irrelevant issues.

Attachments5

dlllibasyncProfiler_with_fix_for_java8

image1.pngimage1

setup_sdk_with_pdb.pngsetup_sdk_with_pdb

set-jdk-for-RC.pngset-jdk-for-RC

whoa.pngwhoa

Activity settings

User avatar

Taras Tielkes

Commented over 2 years ago

Another thing I wanted to check: is Windows 7 a supported platform?

I've encountered crashes within libasyncProfiler.dll on my old Windows 7 laptop, while profiling on Java 11.

IDEA YouTrack Updater

Updated over 2 years ago

Included in builds: 213.1862

Kirill Timofeev

Updated over 2 years ago

resolved date: 3 Aug 2021

State: Submitted → Fixed

User avatar

Kirill Timofeev

Commented over 2 years ago

@Taras Tielkes Thanks for your report and sorry for such a long response, it takes some time to finally deliver the fix
The problem was related not to the windows version itself but to the target JVM version. Now, I believe, the problem is fixed and the updated agent libasyncProfiler will arrive in 2021.2.1 bugfix update.

User avatar

Kirill Timofeev

Commented over 2 years ago

@Taras Tielkes
Speaking about Windows 7 support, I attached the new version of the libasyncProfiler.dll (with this problem related to java8 being fixed), could you please check if it works fine on your Windows 7 machine?
To do this you need to download the attached library and set up a new(!) profiler configuration with the library provided as an agent:
image1.png.

If your java 11 (or java8) will still crash please attach crashdump (or at least crash text dump) and I will take a look.

dlllibasyncProfiler_with_fix_for_java8

image1.pngimage1

Kirill Timofeev

Updated over 2 years ago

resolved date: 3 Aug 2021

Included in builds: 213.1862

State: Fixed → Wait for Reply

User avatar

Taras Tielkes

Commented over 2 years ago

Hi @Kirill Timofeev, great to hear!

I am happy to (re)test on the Windows 7 machine, however, you've attached the dll with incorrect visibility :)

State: Wait for Reply → Submitted

User avatar

Kirill Timofeev

Commented over 2 years ago

here-we-go-again.jpg

updated the dll visivility

State: Submitted → Wait for Reply

User avatar

Taras Tielkes

Commented over 2 years ago

On Windows 10, profiling using both Java 8 and Java 11 (both somewhat recent AdoptOpenJDK releases) works well with the attached library.

On Windows 7, when attempting to attach and profile on jdk-11.0.11+9 (with the attached library), I see the following console output repeated:

[WARN] Can't winApiTlsSetThread, error code: 0

Profiling started

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

[WARN] Can't winApiTlsSetThread, error code: 0

With Profiler error: Invalid file format: Empty chunk as the end result.

This is a different application being profiled on the Windows 7 machine though.

I'll continue experimentation and will share results here.

State: Wait for Reply → Submitted

User avatar

Kirill Timofeev

Commented over 2 years ago

Well, technically IntelliJ IDEA does not support Windows 7:
https://www.jetbrains.com/help/idea/installation-guide.html

Operating system
Microsoft Windows 8 or later

So, the question is, how urgent is Windows 7 support for async-profiler for you? Do you use Windows 7 for you day-to-day work?

Kirill Timofeev

Updated over 2 years ago

State: Submitted → Wait for Reply

User avatar

Taras Tielkes

Commented over 2 years ago

Hi @Kirill Timofeev, I would say it is not urgent at all, my main workstation and laptop are on Windows 10. I assume you (as in "JetBrains") have reliable statistics, on how many stragglers there are left using IDEA on Windows 7.

The old workstation and laptop (which are on Windows 7) I sometimes still use in some test scenarios of our product. Sometimes for testing it is nice to have old machines :)

I was also somewhat curious from a technical perspective, as the core Win32 process/thread APIs have not evolved that much since Windows 7 (at least as far as I am aware).

Given that the new dll works for me on Windows 10, please feel free to close this ticket.

State: Wait for Reply → Submitted

User avatar

Taras Tielkes

Commented over 2 years ago

One more question, btw: are you planning to do some work to resolve the native stack frames (using DIA or such)? At the moment IDEA only shows module(dll) name in the native stack frames in flame graph.

User avatar

Kirill Timofeev

Commented over 2 years ago

I was also somewhat curious from a technical perspective, as the core Win32 process/thread APIs have not evolved that much since Windows 7 (at least as far as I am aware).

Yep, that was exactly my thoughts.
However, to be honest I use Win32 API in such an obsucre way, that basically anything can be broken on older Windows :)

One more question, btw: are you planning to do some work to resolve the native stack frames (using DIA or such)? At the moment IDEA only shows module(dll) name in the native stack frames in flame graph.

Yep, for sure. There are still some things to do: both on IDEA side and win-async-profiler side.
Actually, the current version of win-async-profiler can already resolve native symbols if corresponding pdb files are located just near the dll files (We are using libdia, that is bundled with win-async-profiler)
To have native stack resolved you could download openjdk-jdk11-windows-x86_64-server-release.zip from https://builds.shipilev.net/openjdk-jdk11/, extract it somewhere, and setup as SDK:
setup_sdk_with_pdb.png
Then you need your RC to use this sdk:
set-jdk-for-RC.png
and finally, you could start the profiler:
whoa.png

Please note, that you could run almost any configuration on the provided JDK, event Gradle or Maven.

The tricky part is if there are no PDB files near the dlls and we need to do symbols lookup from async-profiler and downloading them from the IDEA side if the lookup failed.
I believe all these issues will be solved in the nearest future and the update will be available in some of the bug-fix updates for 2021.2.

Show more

setup_sdk_with_pdb.pngsetup_sdk_with_pdb

set-jdk-for-RC.pngset-jdk-for-RC

whoa.pngwhoa

2

User avatar

Kirill Timofeev

Commented over 2 years ago

And thanks a lot for your feedback!

Kirill Timofeev

Updated over 2 years ago

resolved date: 3 Aug 2021

State: Submitted → Fixed

User avatar

Kirill Timofeev

Commented over 2 years ago

Close this issue as fixed, windows 7 support for win-async-profiler is out of the scope of the future plans.

User avatar

Taras Tielkes

Commented over 2 years ago

I'm using this feature practically every day, so more feedback will come ;)

User avatar

Taras Tielkes

Commented over 2 years ago

@Kirill Timofeev I tried your steps above, using the JDK build from Aleksey Shipilëv, and the results make me very happy.

Are you planning to improve resolution for Windows modules in native stack frames as well?

User avatar

Kirill Timofeev

Commented over 2 years ago

Are you planning to improve resolution for Windows modules in native stack frames as well?

Yep. Microsoft publishes Windows modules debug symbols on their public symbol server. We could download them easily, however, we surely do not want to do this from your JVM process that is being profiled. We will download them from IDEA process, store them in the specifc location, and after that our profiler will be able to resolve the symbols "in place" before saving the dump.

User avatar

Taras Tielkes

Commented over 2 years ago

Very good to hear, add an ability to visually classify stack frames (https://youtrack.jetbrains.com/issue/IDEA-272480#focus=Comments-27-4994849.0-0 / https://youtrack.jetbrains.com/issue/IDEA-223684), and we'll be "Profiling with pleasure"™

M M

Commented over 2 years ago

@Kirill Timofeev The issue still exists in 2021.2.1 (Build #IU-212.5080.55, built on August 24, 2021) on Windows 10, OpenJDK 1.8.0_301

libasyncProfiler.dll that you attached to this ticket helped when used as instructed in one of the comments above.

User avatar

Taras Tielkes

Commented over 2 years ago

@Kirill Timofeev Is allocation profiling supported on Windows?

I tried setting the agent options to interval=1ms,event=cpu,alloc=1m (using latest 2021.3 EAP build), but on startup of the process saw this output in the console:

[ERROR] AllocTracer is unsupported on Windows

Egor Ushakov

Updated about 2 years ago

Available in: 2021.3 Beta

User avatar

Taras Tielkes

Commented about 2 years ago

@Kirill Timofeev I assume the resolving using symbol servers is scheduled for IDEA 2022.x? I saw relevant commits in the github repository, but did not see any UI to enable it.

IDEA YouTrack Updater

Updated about 2 years ago

Available in: 2021.3 Beta → 2021.3

lity

Commented about 2 years ago

Sorry, I still meet this issue on IDEA 2021.2.3(Build #IU0212.5757.46),Windows 10 and Oracle JDK 1.8.0_311-b11. How to solve this?

User avatarUser avatar

Anna Ivanova

Commented about 2 years ago

@lity , could you please try the latest version 2021.3.1?
The fix should be available starting from 2021.3

lity

Commented about 2 years ago

@Anna Ivanova oh,it's ok.Thanks

Anna Kutarba

Updated about 1 year ago

Affected versions: 212.3116.43 → 2021.2 (212.4746.92)


原网址: 访问
创建于: 2024-02-23 15:53:57
目录: default
标签: 无

请先后发表评论
  • 最新评论
  • 总共0条评论