ahmedabu98 opened a new pull request, #41486:
URL: https://github.com/apache/beam/pull/41486

   On ARM machines like Apple Silicon Macs, the shell JAR that 
`scripts/beam-sql.sh` builds crashes the JVM the first time a Google Cloud 
client sets up TLS. Writing to an Iceberg table on GCS is enough:
   
   ```
   could not find method serverCertificateRequested
   ...
   ./scripts/beam-sql.sh: line 500: 69988 Abort trap: 6           java -cp 
"${CP}" "${MAIN_CLASS}" "${SQLLINE_ARGS[@]}"
   ```
   
   The JAR mixes two versions of Conscrypt:
   
   * `beam-sdks-java-extensions-sql-jdbc` is a fat JAR that bundles Conscrypt 
2.6.2, native libraries included.
   * The other dependencies the script adds bring in 
`conscrypt-openjdk-uber:2.5.2`, which `beam-model-pipeline`'s POM declares.
   * The shade step keeps the first copy of each file, so 2.5.2's classes win. 
2.5.2 ships no ARM native libraries, so the only ARM library in the JAR is 
2.6.2's.
   
   When gax-httpjson loads Conscrypt, the 2.6.2 native library looks for 
`serverCertificateRequested(int[])`, finds 2.5.2's 
`serverCertificateRequested()` instead, and aborts. On x86_64 the native 
library comes from 2.5.2 as well, so the versions match and nothing breaks.
   
   This PR excludes `org.conscrypt` from the dependencies the script adds, so 
the only Conscrypt in the JAR is the one bundled in the jdbc JAR.
   
   To check it, I ran the shade plugin the script uses (3.5.1) on the real 
artifacts. Without the exclusion, the JAR pairs 2.5.2's callback class with 
2.6.2's `osx-aarch_64` library. With it, all of Conscrypt comes from 2.6.2. A 
JAR merged the same way also crashes with this message on Linux once it's given 
the 2.6.2 native library.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to