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

Open
#657 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start with the JNI/Gandiva library-loading path and the Java default RTLD_LOCAL behavior described in the issue; compare it with the JNA approach and the related Apache Arrow issue. Reproduce the sinh failure involving sinhl on an affected Linux platform, then verify that LLVM-generated code can resolve Gandiva's imported system symbols.

Written by the indexing model from the issue text.

Description

Type: bug
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

Dominant language
Java
Stars
95
Forks
154
Avg merge
2d 10h
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-java

All issues in apache/arrow-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.