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 — Native image blocklist violations, Netty 4.2.11/12 regression, Polyglot (JS) · Issue #16607 · netty/netty

Native image blocklist violations, Netty 4.2.11/12 regression, Polyglot (JS) #16607

New issue
Copy link
New issue
Copy link
Closed
#16664
Closed
Native image blocklist violations, Netty 4.2.11/12 regression, Polyglot (JS)#16607
#16664
Copy link
Milestone
4.2.13.Final

Description

@adamdickmeiss
adamdickmeiss
opened on Apr 7, 2026
Issue body actions

Program based on Vert.x, Netty and using Polyglot (JS). After upgrading from Vert.x from 5.0.8 to 5.0.10 (Netty 4.2.10.Final -> 4.2.12.Final), the build fails with "Blocklist violations", such as:

mvn package

....

=== Found 7 compilation blocklist violations ===

Blocklisted method
   java.lang.invoke.MethodHandle.linkToStatic(Object, Object, int, long, MemberName) (target: java.lang.invoke.MethodHandle.linkToStatic(Object, Object, int, long, MemberName))
trace:
  at com.oracle.truffle.js.runtime.array.TypedArray$BigUint64Array.setBufferElementLongImpl(TypedArray.java:1462) [bci: 11]
  at com.oracle.truffle.js.runtime.array.TypedArray$TypedBigIntArray.setBufferElement(TypedArray.java:1290) [bci: 14]
  at com.oracle.truffle.js.builtins.ArrayPrototypeBuiltins$JSArraySliceNode.sliceGeneric(ArrayPrototypeBuiltins.java:1036) [bci: 347]
  at com.oracle.truffle.js.builtins.ArrayPrototypeBuiltinsFactory$JSArraySliceNodeGen.execute(ArrayPrototypeBuiltinsFactory.java:684) [bci: 71]
  at com.oracle.truffle.js.builtins.AsyncIteratorPrototypeBuiltins$AsyncIteratorAwaitNode$AsyncIteratorIfAbruptReturnNode.execute(AsyncIteratorPrototypeBuiltins.java:264) [bci: 13]
  at com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:830) [bci: 5]
  at com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:754) [bci: 40]
  [Root]

java version "25.0.2" 2026-01-20 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 25.0.2+10.1 (build 25.0.2+10-LTS-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 25.0.2+10.1 (build 25.0.2+10-LTS-jvmci-b01, mixed mode, sharing)

The complete program can be found here: https://github.com/adamdickmeiss/vertx-graalvm-native-image-log4j . FWIW, the actual "bigger" program with the issue is found here: https://github.com/indexdata/reservoir .

I have executed git bisect with a variable Netty in 4.2.11.Final-SNAPSHOT and found that the first failing commit is:

0ee9723
part of:
#16207

Activity

  1. chrisvest commented on Apr 10, 2026

    @chrisvest
    chrisvest
    on Apr 10, 2026
    Member
    More actions

    Can you take a look, @Songdoeon ?

    Reacted by DoeonSong
  2. Songdoeon commented on Apr 11, 2026

    @Songdoeon
    Songdoeon
    on Apr 11, 2026
    Contributor
    More actions

    I looked into this.

    Cause

    PR #16207 removed the UNSAFE_UNAVAILABILITY_CAUSE == null guard from initializeVarHandle():

    // Before: Unsafe available → immediate return, VarHandleFactory never loaded
    if (UNSAFE_UNAVAILABILITY_CAUSE == null || javaVersion() < 9 || isNativeImage()) {
        return false;
    }
    
    // After: proceeds further even when Unsafe is available
    if (javaVersion() < 9 || isNativeImage()) {
        return false;
    }

    This makes VarHandle-related code reachable during native-image static analysis, even when Unsafe is available.

    VarHandle operations (invokeExact(), .get(), .set()) are signature-polymorphic methods that resolve through MethodHandle.linkToStatic, which Truffle's runtime compiler cannot handle triggering the compilation blocklist violations when Polyglot is on the classpath.

    Possible fix

    Restore the UNSAFE_UNAVAILABILITY_CAUSE == null guard so VarHandle code stays unreachable when Unsafe is available.

  3. adamdickmeiss commented on Apr 13, 2026

    @adamdickmeiss
    adamdickmeiss
    on Apr 13, 2026
    Author
    More actions

    Tested that modification with the project. Now builds fine.

  4. chrisvest commented on Apr 15, 2026

    @chrisvest
    chrisvest
    on Apr 15, 2026
    Member
    More actions

    @adamdickmeiss thanks for confirming.

    @Songdoeon are you interested in making a PR with that fix?

    Reacted by DoeonSong
  5. normanmaurer
    closed this as completedin #16664on Apr 21, 2026
  6. normanmaurer
    added a commit that references this issue on Apr 21, 2026

    Skip VarHandle init when unaligned access is supported (#16664)

    6b16cda
  7. normanmaurer
    added this to the 4.2.13.Final milestone on Apr 21, 2026
  8. normanmaurer
    added a commit that references this issue on Apr 21, 2026

    Skip VarHandle init when unaligned access is supported (#16664) (#16676)

    d88be5f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      • 4.2.13.Final

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.