Skip to content

[C++][Gandiva] Gandiva crashes when casting a large batch from int32 to decimal with JIT optimization disabled #55277

Closed

Description

@dmitry-chirkov-dremio

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

To reproduce:

  1. Create 524,288 int32 rows.
  2. Build a projector with one cast to decimal128(10, 0).
  3. Use gandiva::Configuration(false).
  4. Evaluate the batch.

This crashes with SIGSEGV on macOS ARM64 with LLVM 21.1.7. With optimization enabled, it passes. Evaluation should work with either setting.

DecimalIR::CallDecimalFunction creates two stack slots for the decimal result. These allocations are inside the record loop, so each row uses more stack. The stack is only released when the function returns. DecimalIR::AddLarge has the same allocation pattern.

Moving the allocations to the function entry block should fix the crash.

AI tools helped with the investigation, fix, and tests.

Component(s)

C++, Gandiva

Activity

  1. changed the title [-]Gandiva crashes when casting a large batch from int32 to decimal with JIT optimization disabled[/-] [+][C++][Gandiva] Gandiva crashes when casting a large batch from int32 to decimal with JIT optimization disabled[/+] on Oct 27, 2026
  2. added 2 commits that reference this issue on Oct 27, 2026
  3. added a commit that references this issue on Nov 3, 2026
  4. added a commit that references this issue on Nov 3, 2026
  5. added a commit that references this issue on Nov 11, 2026
  6. added this to the 27.0.0 milestone on Nov 11, 2026
  7. kou commented on Nov 11, 2026

    @kou
    Member

    Issue resolved by pull request 55278
    #55278

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions