[ 
https://issues.apache.org/jira/browse/SPARK-56955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Zsolt Piros reassigned SPARK-56955:
------------------------------------------

    Assignee: Attila Zsolt Piros

> Arrow/Netty memory allocator fails on JDK 25 (affects spark-shell --remote)
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-56955
>                 URL: https://issues.apache.org/jira/browse/SPARK-56955
>             Project: Spark
>          Issue Type: Bug
>          Components: Connect
>    Affects Versions: 4.2.0
>            Reporter: Anupam Yadav
>            Assignee: Attila Zsolt Piros
>            Priority: Major
>              Labels: pull-request-available
>
> On JDK 25, spark-shell --remote fails to start due to Arrow/Netty memory 
> allocator incompatibility.
> *Reproduced locally* on JDK 25 (Amazon Corretto 25.0.3) -- test passes on JDK 
> 17 and 21 but fails consistently on JDK 25.
> *Error:*
> {code}
> Exception in thread "main" java.lang.ExceptionInInitializerError
>   at 
> org.apache.arrow.memory.netty.DefaultAllocationManagerFactory.<clinit>(DefaultAllocationManagerFactory.java:26)
> ...
> Caused by: java.lang.UnsupportedOperationException
>   at 
> org.sparkproject.connect.client.io.netty.buffer.EmptyByteBuf.memoryAddress(EmptyByteBuf.java:961)
>   at 
> org.sparkproject.connect.client.io.netty.buffer.DuplicatedByteBuf.memoryAddress(DuplicatedByteBuf.java:115)
>   at 
> org.sparkproject.connect.client.io.netty.buffer.UnsafeDirectLittleEndian.<init>(UnsafeDirectLittleEndian.java:45)
>   at 
> org.sparkproject.connect.client.io.netty.buffer.PooledByteBufAllocatorL.<init>(PooledByteBufAllocatorL.java:47)
> {code}
> *Environment:*
> - JDK 25 (Amazon Corretto 25.0.3, also OpenJDK 25.0.3 on UBI 10 per 
> dongjoon-hyun)
> - JDK 17 and 21: not affected
> *Root cause:* Netty's {{EmptyByteBuf.memoryAddress()}} throws 
> {{UnsupportedOperationException}} on JDK 25. Arrow's 
> {{DefaultAllocationManagerFactory}} calls this during static initialization 
> via {{PooledByteBufAllocatorL}}. This affects any code path that initializes 
> Arrow (Spark Connect client, vectorized readers, etc.).
> *Workaround:* adding "--sun-misc-unsafe-memory-access=allow" as JDK flag 
> switches off this checks on JDK 25 (see JEP 498 for details)
> *Root fix:* Requires Arrow/Netty dependency update to a version that supports 
> JDK 25.
> Originally reported by dongjoon-hyun on PR #55720.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to