apache / apache/arrow-java

[JNI][Gandiva] LLVM generated code can't access some system functions on certain platforms

未关闭
#657 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Type: bug
主要语言
Java
星标
94
派生
152
平均合并
3 天 16 小时
30 天内合并 PR
11

描述

### Describe the bug, including details regarding any error messages, version, and platform.

When linux loads libraries there are different options for symbols visibility like: RTLD_LOCAL, RTLD_GLOBAL. Default in Java is RTLD_LOCAL which makes all symbols inside Gandiva library only visible to the Gandiva library.

The problem is when LLVM compiles code and loads it into Java process that code won't be able to find any symbols imported by Gandiva. One example is 'sinhl' from libgcc which causes sinh function to fail when it is present in SQL query executed by Dremio using Gandiva engine. By importing JNA package we can control how to load Gandiva library and set Global symbol visibility.

See also: https://github.com/apache/arrow/issues/40839

贡献指南

打开贡献指南

调研方向

从 issue 中描述的 JNI/Gandiva 库加载路径和 Java 默认的 RTLD_LOCAL 行为入手;将其与 JNA 方案及相关的 Apache Arrow issue 进行比较。在受影响的 Linux 平台上复现涉及 sinhl 的 sinh 失败,然后验证 LLVM 生成的代码能够解析 Gandiva 导入的系统符号。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。