Skip to content
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

[23.0] JFR enabled native-image builds with JDK 17.0.11+1 fail #684

Closed
jerboaa opened this issue Feb 28, 2024 · 2 comments
Closed

[23.0] JFR enabled native-image builds with JDK 17.0.11+1 fail #684

jerboaa opened this issue Feb 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Feb 28, 2024

Description

We see the following error when generating a native-image with --enable-monitoring=jfr:

 Error: Could not find target method: public void com.oracle.svm.core.jfr.Target_jdk_jfr_internal_JVM.setMethodSamplingInterval(long,long)

How To Reproduce

Steps to reproduce the behavior:

$ cat LastModified.java
import java.nio.file.*;
import java.util.Map;
import java.nio.file.attribute.BasicFileAttributes;

public class LastModified {
    public static void main(String[] args) throws Exception {
	Path p = Path.of(args[0]);
        var attrs = Files.readAttributes(p, BasicFileAttributes.class);
	Map<String, Object> ats = Files.readAttributes(p, "basic:*", java.nio.file.LinkOption.NOFOLLOW_LINKS);
        System.out.printf(
            "   follow-symlink - symlink? %s%ncreated  (a): %s%nmodified (a): %s%n",
	    Boolean.valueOf(Files.isSymbolicLink(p)).toString(),
            attrs.creationTime(),
            attrs.lastModifiedTime()
        );
        System.out.printf(
            "no-follow-symlink - symlink? %s%ncreated  (b): %s%nmodified (b): %s%n",
	    Boolean.valueOf(Files.isSymbolicLink(p)).toString(),
            ats.get("creationTime"),
            ats.get("lastModifiedTime")
        );
    }
}
$ javac LastModified.java
$ native-image --version
native-image 17.0.11-beta 2024-04-16
OpenJDK Runtime Environment Mandrel-23.0.4-dev (build 17.0.11-beta+4-ea)
OpenJDK 64-Bit Server VM Mandrel-23.0.4-dev (build 17.0.11-beta+4-ea, mixed mode)
$ native-image --enable-monitoring=jfr LastModified lm-jfr
========================================================================================================================
GraalVM Native Image: Generating 'lm-jfr' (executable)...
========================================================================================================================
[1/8] Initializing...
                                                                                    (0.0s @ 0.06GB)
Error: Could not find target method: public void com.oracle.svm.core.jfr.Target_jdk_jfr_internal_JVM.setMethodSamplingInterval(long,long)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
------------------------------------------------------------------------------------------------------------------------
                         0.1s (5.0% of total time) in 6 GCs | Peak RSS: 0.38GB | CPU load: 4.68
========================================================================================================================
Finished generating 'lm-jfr' in 1.3s.

Expected behavior

Native image generation works with --enable-monitoring=jfr

Additional context

Also seen here:
https://github.com/graalvm/mandrel/actions/runs/8068592571/job/22043083502?pr=683#step:11:20671

@jerboaa jerboaa added the bug Something isn't working label Feb 28, 2024
@jerboaa
Copy link
Collaborator Author

jerboaa commented Feb 28, 2024

Seems to be caused by JDK-8288663 new in JDK 17.0.11+1.

@jerboaa jerboaa self-assigned this Feb 28, 2024
@jerboaa
Copy link
Collaborator Author

jerboaa commented Mar 5, 2024

Closed with: #686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant