Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash due to assertion error with some inputs #20

Closed
kjellwinblad opened this issue May 5, 2022 · 0 comments · Fixed by #22
Closed

Crash due to assertion error with some inputs #20

kjellwinblad opened this issue May 5, 2022 · 0 comments · Fixed by #22

Comments

@kjellwinblad
Copy link
Contributor

The jq library crashes when given the following input: jq:process_json("include \"hej\";.", "{\"hej\": 42}").

See:

$ rebar3 shell
Eshell V12.3  (abort with ^G)
1> jq:process_json("include \"hej\";.", "{\"hej\": 42}").
erlang_jq_port: src/jv.c:369: jv jv_array_concat(jv, jv): Assertion `jv_get_kind(b) == JV_KIND_ARRAY' failed.
                                                                                                             =ERROR REPORT==== 5-May-2022::09:56:00.544287 ===
jq port program responsed in unexepected way (state = #{id => 6,
                                                        port => #Port<0.14>,
                                                        processed_json_calls =>
                                                            0,
                                                        restart_period =>
                                                            1000000} error_class error reason {unexpected_response_from_port,
                                                                                               {error,
                                                                                                port_exited_during_op,
                                                                                                #Port<0.14>,
                                                                                                normal}} , restarting)
{error,{misbehaving_port_program,error,
                                 {unexpected_response_from_port,{error,port_exited_during_op,
                                                                       #Port<0.14>,normal}}}}
kjellwinblad added a commit to kjellwinblad/jq that referenced this issue May 9, 2022
This commit fixes emqx#20

It also fixes error handling so that error messages reported by calls
to jq_report_error from within the jq library are included in the
error return value and are not printed.
kjellwinblad added a commit to kjellwinblad/jq that referenced this issue May 9, 2022
This commit fixes emqx#20

It also fixes error handling so that error messages reported by calls
to jq_report_error from within the jq library are included in the
error return value and are not printed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant