Skip to content

Crash on halt_error #2533

@stoat1

Description

@stoat1

Describe the bug
It crashes on the given input and program containing among others operator ? and function halt_error.

To Reproduce

jq <</// '(.[]? | halt_error(42)), .'
["foo"]
42
"bar"
///

Expected behavior
Some output and maybe some errors with reference to the input and/or the program.

jq: error (at <something>, line 1): Cannot blah-blah function halt_error/0 jibber-jabber number (42)

Actual behavior
Some output and an error with reference to the source code of jq and exit code is set to 134.

foo42
jq: src/jv_print.c:125: jvp_dump_string: Assertion `c != -1' failed.

Environment (please complete the following information):

  • Linux
  • jq-1.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions