apache / apache/arrow-nanoarrow

Add an optional stack trace to ArrowError

Open
#567 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
249
Forks
68
Avg merge
2d 16h
Merged PRs (30d)
12

Description

It's frequently difficult to tell where error codes were first set, even with the message in ArrowError. It'd be possible to modify NANOARROW_RETURN_NOT_OK() to append file names, line numbers, etc to an ArrowError to produce a stack trace of the error code.

ArrowError would need to be expanded to hold this information, since currently its message can only be [1024 bytes](https://github.com/bkietz/arrow-nanoarrow/blob/ba985df9f9b5e1aaa402b51ab176df9079e37f65/src/nanoarrow/common/inline_types.h#L217-L222) (fine for individual methods but stack traces would exceed that easily). Either that limit could be increased or we could add an optional `void* stack_trace;` member to the struct whose lifetime is managed separately. (Or we could make ArrowError a type which manages memory but that's probably not desirable because we'd need to add `ArrowError{Init,Reset}` everywhere.)

Given the added complexity, this would probably need to be an optional feature (controlled by a cmake `option()`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ArrowError in src/nanoarrow/common/inline_types.h and the NANOARROW_RETURN_NOT_OK() macro to understand the current error representation and propagation. Review the proposed CMake option and decide how optional stack-trace storage should fit the existing ArrowError lifetime model; done means the chosen design is implemented without changing default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
backend, build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.