Skip to content

[C++][Gandiva] Fix incorrect error messages #50109

Description

@lriggs

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

Three small, independent bugs in Gandiva's runtime error messages: in two cases the message misrepresents what actually failed, and in one case a copy-paste error left the wrong function name in a message.

What changed

  1. levenshtein reported OOM as a length error
    cpp/src/gandiva/precompiled/string_ops.cc:1738-1742 — when gdv_fn_context_arena_malloc returned null (i.e. memory allocation failed), the function set the error to "String length must be greater than 0". The condition is an OOM, not a length issue.

  2. levenshtein length-bound message was off by one
    cpp/src/gandiva/precompiled/string_ops.cc:1702-1708 — the precondition is in1_len < 0 || in2_len < 0, which rejects only negative lengths (zero is valid). The message said "must be greater than 0", implying zero was rejected too.

  3. gdv_fn_aes_decrypt reported the wrong direction
    cpp/src/gandiva/gdv_function_stubs.cc:411 — inside the AES decrypt function, the OOM message said "Could not allocate memory for returning aes encrypt cypher text". Pure copy-paste from the sibling encrypt function.

Component(s)

Gandiva
C++

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions