Skip to content

ion_reader_step_out assertion fails on incomplete container #355

@rmarrowstone

Description

@rmarrowstone

ion_reader_next indicates the end of a container by setting the passed ION_TYPE reference to tid_EOF, regardless of whether the end of that container was expected (and the container valid) or the stream incomplete.

When a caller attempts to step out of the container, the ION_ASSERT condition in _ion_reader_binary_step_out is true. Depending on whether ion-c is built in debug or release this may result in a failed assertion or an infinite loop.

It seems totally reasonable for me as a user that I should be able to try to step out of the container in this case, and reliably get an error in the case of premature stream end.

This is the apparent cause of amazon-ion/ion-python#398

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions