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

Receiving header block fragments referring to invalid indexes causes a crash #46

Open
psalin opened this issue Jan 17, 2021 · 0 comments

Comments

@psalin
Copy link
Collaborator

psalin commented Jan 17, 2021

Currently, this can be reproduced by running the unary concurrency test that causes #45. This results in a couple of headers being undefined because of invalid indexes, which in turn causes the trace below:

=ERROR REPORT==== 17-Jan-2021::10:50:34.719500 ===
** State machine <0.731.0> terminating
** Last event = {cast,{recv_h,[{<<":status">>,<<"200">>},
                               undefined,undefined,
                               {<<"user-agent">>,<<"grpc-erlang/0.1.0">>}]}}
** When server state  = {half_closed_local,
                         {stream_state,117,<0.666.0>,
                          {gen_tcp,#Port<0.134>},
                          idle,
                          {[],[]},
                          [{<<":method">>,<<"POST">>},
                           {<<":path">>,
                            <<"/routeguide.RouteGuide/GetFeature">>},
                           {<<":scheme">>,<<"http">>},
                           {<<":authority">>,<<"localhost:8080">>},
                           {<<"grpc-encoding">>,<<"identity">>},
                           {<<"grpc-message-type">>,<<"routeguide.Point">>},
                           {<<"content-type">>,<<"application/grpc+proto">>},
                           {<<"user-agent">>,<<"grpc-erlang/0.9.2">>},
                           {<<"te">>,<<"trailers">>}],
                          undefined,0,false,false,[],[],undefined,false,false,
                          undefined,undefined,
                          #{buffer => <<>>,client_pid => <0.639.0>,
                            ctx =>
                             {ctx,
                              #{grpc_client_method =>
                                 <<"/routeguide.RouteGuide/GetFeature">>},
                              undefined},
                            marshal_fun =>
                             #Fun<routeguide_route_guide_client.0.7492253>,
                            path => <<"/routeguide.RouteGuide/GetFeature">>,
                            service => 'routeguide.RouteGuide',stats => #{},
                            stats_handler => undefined,stream_id => 117,
                            unmarshal_fun =>
                             #Fun<routeguide_route_guide_client.1.7492253>},
                          grpcbox_client_stream,client}}
** Reason for termination = error:function_clause
** Callback mode = state_functions
** Stacktrace =
**  [{h2_stream,'-no_upper_names/1-fun-0-',
                [undefined],
                [{file,"grpcbox/_build/default/lib/chatterbox/src/h2_stream.erl"},
                 {line,828}]},
     {lists,all,2,[{file,"lists.erl"},{line,1213}]},
     {h2_stream,is_valid_headers,2,
                [{file,"grpcbox/_build/default/lib/chatterbox/src/h2_stream.erl"},
                 {line,818}]},
     {h2_stream,half_closed_local,3,
                [{file,"grpcbox/_build/default/lib/chatterbox/src/h2_stream.erl"},
                 {line,589}]},
     {gen_statem,loop_state_callback,11,[{file,"gen_statem.erl"},{line,1159}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]
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

No branches or pull requests

1 participant