Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Erwa crashes when sending "big" string #31

Closed
ethrbh opened this issue May 4, 2016 · 6 comments
Closed

Erwa crashes when sending "big" string #31

ethrbh opened this issue May 4, 2016 · 6 comments
Assignees
Labels

Comments

@ethrbh
Copy link
Contributor

ethrbh commented May 4, 2016

hello,

I am using erwa as dependency for my project, and I found a fault in erwa, or I did someting wrong. The encoder type I have set is json in both "erlang" and "web/javascript side". The problem is that erwa crashes

erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135

when I try send "big" string from Erlang client to WEB client. Please see details data below. Please also let me know this is a fault or I did something wrong.

The version of erwa I use is this:

ethrbh@ethrbh-VirtualBox:/mnt/ethrbh/private/projects/github/igs/deps/erwa(master)> git log
commit fdd1a1431613b84c289ee436747754bfc3a137ea
Author: Robert Balogh <ethrbh@gmail.com>
Date:   Tue Apr 26 11:40:17 2016 +0200

    Use cowboy-1.1.x as dependency instead of using master
...

ethrbh@ethrbh-VirtualBox:/mnt/ethrbh/private/projects/github/igs/deps/erwa(master)> cat .git/refs/heads/master
fdd1a1431613b84c289ee436747754bfc3a137ea
ethrbh@ethrbh-VirtualBox:/mnt/ethrbh/private/projects/github/igs/deps/erwa(master)> 

And here is the crash

(igs@ethrbh-VirtualBox)1> (igs@ethrbh-VirtualBox)1> @@@@@ Sending big string to WEB client {string,"10:55*10:58*11:01*11:04*11:07*11:10*11:14*11:17*11:20*11:23*11:26*11:29*11:33*11:36*11:39*11:42*11:45*11:48*11:52*11:55*11:58*12:01*12:04*12:07*12:11*12:14*12:17*12:20*12:23*12:26*12:30*12:33*12:36*12:39*12:42*12:45*12:49*12:52*12:55*12:58*13:01*13:04*13:08*13:11*13:14*13:17*13:20*13:23*13:27*13:30*13:33*13:36*13:39*13:42*13:46*13:49*13:52*13:55*13:58*14:01*14:05*14:08*14:11*14:14*14:17*14:20*14:24*14:27*14:30*14:33*14:36*14:39*14:43*14:46*14:49*14:52*14:55*14:58*15:02*15:05*15:08*15:11*15:14*15:17*15:21*15:24*15:27*15:30*15:33*15:36*15:40*15:43*15:46*15:49*15:52*15:55*15:59*16:02*16:05*16:08*16:11*16:14*16:18*16:21*16:24*16:27*16:30*16:33*16:37*16:40*16:43*16:46*16:49*16:52*16:56*16:59*17:02*17:05*17:08*17:11*17:15*17:18*17:21*17:24*17:27*17:30*17:34*17:37*17:40*17:43*17:46*17:49*17:53*17:56*17:59*18:02*18:05*18:08*18:12*18:15*18:18*18:21*18:24*18:27*18:31*18:34*18:37*18:40*18:43*18:46*18:50*18:53*18:56*18:59*19:02*19:05*19:09*19:12*19:15*19:18*19:21*19:24*19:28*19:31*19:34*19:37*19:40*19:43*19:47*19:50*19:53*19:56*19:59*20:02*20:06*20:09*20:12*20:15*20:18*20:21*20:25*20:28*20:31*20:34*20:37*20:40*20:44*20:47*20:50*20:53*20:56*20:59*21:03*21:06*21:09*21:12*21:15*21:18*21:22*21:25*21:28*21:31*21:34*21:37*21:41*21:44*21:47*21:50*21:53*21:56*22:00*22:03*22:06*22:09*22:12*22:15*22:19*22:22*22:25*22:28*22:31*22:34*22:38*22:41*22:44*22:47*22:50*22:53*22:57*23:00*23:03*23:06*23:09*23:12*23:16*23:19*23:22*23:25*23:28*23:31*23:35*23:38*23:41*23:44*23:47*23:50*23:54*23:57"}

11:18:29.599 [error] gen_server <0.524.0> terminated with reason: no match of right hand value {[],{state,#Port<0.3685>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,17,133,91,55,48,44,53,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,57,44,52,56,44,53,56,44,53,51,44,53,51,44,52,50,44,52,57,44,52,56,44,53,56,44,53,51,44,53,54,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,52,57,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,50,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,53,44,52,50,44,52,57,44,52,57,44,53,56,44,52,57,44,52,56,44,52,50,44,52,57,44,52,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135
11:18:29.618 [error] CRASH REPORT Process <0.524.0> with 0 neighbours exited with reason: no match of right hand value {[],{state,#Port<0.3685>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,17,133,91,55,48,44,53,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,57,44,52,56,44,53,56,44,53,51,44,53,51,44,52,50,44,52,57,44,52,56,44,53,56,44,53,51,44,53,54,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,52,57,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,50,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,53,44,52,50,44,52,57,44,52,57,44,53,56,44,52,57,44,52,56,44,52,50,44,52,57,44,52,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135 in gen_server:terminate/7 line 826

11:18:29.619 [error] Ranch listener erwa_tcp terminated with reason: no match of right hand value {[],{state,#Port<0.3685>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,17,133,91,55,48,44,53,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,57,44,52,56,44,53,56,44,53,51,44,53,51,44,52,50,44,52,57,44,52,56,44,53,56,44,53,51,44,53,54,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,52,57,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,50,44,52,50,44,52,57,44,52,57,44,53,56,44,52,56,44,53,53,44,52,50,44,52,57,44,52,57,44,53,56,44,52,57,44,52,56,44,52,50,44,52,57,44,52,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135

thanks for your help,
/Robi

@bwegh
Copy link
Owner

bwegh commented May 4, 2016

could you just post a raw message, so it is easier for me to look into the issue, thanks

@ethrbh
Copy link
Contributor Author

ethrbh commented May 5, 2016

hello,

I did not started to trace in Erlang the issue yet, but below detailed info what I can serve for you right now. I hope it can help to start the troubleshooting.

Erwa crash related info for troubleshooting

Funtion to be called for sending data from Erlang to WEB
ok = awre:yield(Con, RequestId, Details, [BigStr]);

Values for above variables in the function call
Con: <0.415.0>
RequestId: 21
Details: #{}
BigStr:
"ok,08:29_08:30_08:31_08:33_08:34_08:35_08:36_08:37_08:38_08:40_08:41_08:42_08:43_08:44_08:45_08:47_08:48_08:49_08:50_08:51_08:52_08:54_08:55_08:56_08:57_08:58_08:59_09:01_09:02_09:03_09:04_09:05_09:06_09:08_09:09_09:10_09:11_09:12_09:13_09:15_09:16_09:17_09:18_09:19_09:20_09:22_09:23_09:24_09:25_09:26_09:27_09:29_09:30_09:31_09:32_09:33_09:34_09:36_09:37_09:38_09:39_09:40_09:41_09:43_09:44_09:45_09:46_09:47_09:48_09:50_09:51_09:52_09:53_09:54_09:55_09:57_09:58_09:59_10:00_10:01_10:02_10:04_10:05_10:06_10:07_10:08_10:09_10:11_10:12_10:13_10:14_10:15_10:16_10:18_10:19_10:20_10:21_10:22_10:23_10:25_10:26_10:27_10:28_10:29_10:30_10:32_10:33_10:34_10:35_10:36_10:37_10:39_10:40_10:41_10:42_10:43_10:44_10:46_10:47_10:48_10:49_10:50_10:51_10:53_10:54_10:55_10:56_10:57_10:58_11:00_11:01_11:02_11:03_11:04_11:05_11:07_11:08_11:09_11:10_11:11_11:12_11:14_11:15_11:16_11:17_11:18_11:19_11:21_11:22_11:23_11:24_11:25_11:26_11:28_11:29_11:30_11:31_11:32_11:33_11:35_11:36_11:37_11:38_11:39_11:40_11:42_11:43_11:44_11:45_11:46_11:47_11:49_11:50_11:51_11:52_11:53_11:54_11:56_11:57_11:58_11:59_12:00_12:01_12:03_12:04_12:05_12:06_12:07_12:08_12:10_12:11_12:12_12:13_12:14_12:15_12:17_12:18_12:19_12:20_12:21_12:22_12:24_12:25_12:26_12:27_12:28_12:29_12:31_12:32_12:33_12:34_12:35_12:36_12:38_12:39_12:40_12:41_12:42_12:43_12:45_12:46_12:47_12:48_12:49_12:50_12:52_12:53_12:54_12:55_12:56_12:57_12:59_13:00_13:01_13:02_13:03_13:04_13:06_13:07_13:08_13:09_13:10_13:11_13:13_13:14_13:15_13:16_13:17_13:18_13:20_13:21_13:22_13:23_13:24_13:25_13:27_13:28_13:29_13:30_13:31_13:32_13:34_13:35_13:36_13:37_13:38_13:39_13:41_13:42_13:43_13:44_13:45_13:46_13:48_13:49_13:50_13:51_13:52_13:53_13:55_13:56_13:57_13:58_13:59_14:00_14:02_14:03_14:04_14:05_14:06_14:07_14:09_14:10_14:11_14:12_14:13_14:14_14:16_14:17*14:18"

Erlang src code

        BigStr = concat_string(["ok", StartTimeListStr2], ","),
        io:format("@@@@@ Sending big string to WEB client~n~p~n",[[
                                                                   {bigStr, BigStr},
                                                                   {con, Con},
                                                                   {reqId, RequestId},
                                                                   {details, Details}]]),

        ok = awre:yield(Con, RequestId, Details, [BigStr]);

Erlang log

(igs@ethrbh-VirtualBox)3> @@@@@ Sending big string to WEB client [{bigStr,"ok,08:29*08:30*08:31*08:33*08:34*08:35*08:36*08:37*08:38*08:40*08:41*08:42*08:43*08:44*08:45*08:47*08:48*08:49*08:50*08:51*08:52*08:54*08:55*08:56*08:57*08:58*08:59*09:01*09:02*09:03*09:04*09:05*09:06*09:08*09:09*09:10*09:11*09:12*09:13*09:15*09:16*09:17*09:18*09:19*09:20*09:22*09:23*09:24*09:25*09:26*09:27*09:29*09:30*09:31*09:32*09:33*09:34*09:36*09:37*09:38*09:39*09:40*09:41*09:43*09:44*09:45*09:46*09:47*09:48*09:50*09:51*09:52*09:53*09:54*09:55*09:57*09:58*09:59*10:00*10:01*10:02*10:04*10:05*10:06*10:07*10:08*10:09*10:11*10:12*10:13*10:14*10:15*10:16*10:18*10:19*10:20*10:21*10:22*10:23*10:25*10:26*10:27*10:28*10:29*10:30*10:32*10:33*10:34*10:35*10:36*10:37*10:39*10:40*10:41*10:42*10:43*10:44*10:46*10:47*10:48*10:49*10:50*10:51*10:53*10:54*10:55*10:56*10:57*10:58*11:00*11:01*11:02*11:03*11:04*11:05*11:07*11:08*11:09*11:10*11:11*11:12*11:14*11:15*11:16*11:17*11:18*11:19*11:21*11:22*11:23*11:24*11:25*11:26*11:28*11:29*11:30*11:31*11:32*11:33*11:35*11:36*11:37*11:38*11:39*11:40*11:42*11:43*11:44*11:45*11:46*11:47*11:49*11:50*11:51*11:52*11:53*11:54*11:56*11:57*11:58*11:59*12:00*12:01*12:03*12:04*12:05*12:06*12:07*12:08*12:10*12:11*12:12*12:13*12:14*12:15*12:17*12:18*12:19*12:20*12:21*12:22*12:24*12:25*12:26*12:27*12:28*12:29*12:31*12:32*12:33*12:34*12:35*12:36*12:38*12:39*12:40*12:41*12:42*12:43*12:45*12:46*12:47*12:48*12:49*12:50*12:52*12:53*12:54*12:55*12:56*12:57*12:59*13:00*13:01*13:02*13:03*13:04*13:06*13:07*13:08*13:09*13:10*13:11*13:13*13:14*13:15*13:16*13:17*13:18*13:20*13:21*13:22*13:23*13:24*13:25*13:27*13:28*13:29*13:30*13:31*13:32*13:34*13:35*13:36*13:37*13:38*13:39*13:41*13:42*13:43*13:44*13:45*13:46*13:48*13:49*13:50*13:51*13:52*13:53*13:55*13:56*13:57*13:58*13:59*14:00*14:02*14:03*14:04*14:05*14:06*14:07*14:09*14:10*14:11*14:12*14:13*14:14*14:16*14:17*14:18"}, {con,<0.415.0>}, {reqId,21}, {details,#{}}]

08:29:52.360 [error] gen_server <0.418.0> terminated with reason: no match of right hand value {[],{state,#Port<0.3973>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,21,46,91,55,48,44,50,49,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,56,44,53,54,44,53,56,44,53,48,44,53,55,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,56,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,57,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,49,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,50,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,51,44,52,50,44,52,56,44,53,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135 08:29:52.375 [error] CRASH REPORT Process <0.418.0> with 0 neighbours exited with reason: no match of right hand value {[],{state,#Port<0.3973>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,21,46,91,55,48,44,50,49,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,56,44,53,54,44,53,56,44,53,48,44,53,55,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,56,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,57,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,49,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,50,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,51,44,52,50,44,52,56,44,53,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135 in gen_server:terminate/7 line 826

08:29:52.375 [error] Ranch listener erwa_tcp terminated with reason: no match of right hand value {[],{state,#Port<0.3973>,ranch_tcp,tcp,tcp_closed,tcp_error,raw_json,16777216,<<0,0,21,46,91,55,48,44,50,49,44,123,125,44,91,91,49,49,49,44,49,48,55,44,52,52,44,52,56,44,53,54,44,53,56,44,53,48,44,53,55,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,56,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,52,57,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,49,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,50,44,52,50,44,52,56,44,53,54,44,53,56,44,53,49,44,53,51,44,52,50,44,52,56,44,53,...>>,...}} in erwa_in_tcp:deserialize_and_handle_incomming_messages/2 line 135 08:29:53.633 [error] gen_server <0.415.0> terminated with reason: no match of right hand value {error,closed} in awre_trans_tcp:send_to_router/2 line 80 08:29:53.634 [error] CRASH REPORT Process <0.415.0> with 0 neighbours exited with reason: no match of right hand value {error,closed} in awre_trans_tcp:send_to_router/2 line 80 in gen_server:terminate/7 line 826

08:29:53.634 [error] Supervisor awre_sup had child awre_con started with {awre_con,start_link,undefined} at <0.415.0> exit with reason no match of right hand value {error,closed} in awre_trans_tcp:send_to_router/2 line 80 in context child_terminated 08:29:53.635 [info] "Terminate Client", reason: {{{badmatch,{error,closed}},[{awre_trans_tcp,send_to_router,2,[{file,"src/awre_trans_tcp.erl"},{line,80}]},{awre_con,send_to_router,2,[{file,"src/awre_con.erl"},{line,357}]},{awre_con,handle_message_from_client,3,[{file,"src/awre_con.erl"},{line,172}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,629}]},{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,661}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]},{gen_server,call,[<0.415.0>,{awre_call,{publish,#{},<<"ws.wamp.igs.info_from_master_client">>,[<<"REQ|KEEPALIVE|admin,444,20...">>],...}}]}}, state: {state,<0.415.0>,2219598397904581,[{7256148151237896,{rpcId,<<"ws.wamp.igs.rpc">>}}],[{3603369574755187,{info_from_web_client,<<"ws.wamp.igs.info_from_web_client">>}}],undefined,igs_web_main_client}, module: igs_web_main_client, line: 621

08:29:53.635 [error] gen_server igs_web_main_client terminated with reason: no such process or port in call to gen_server:call(<0.415.0>, {awre_call,{unsubscribe,undefined}}) in gen_server:call/2 line 204

08:29:53.635 [error] CRASH REPORT Process igs_web_main_client with 6 neighbours exited with reason: no such process or port in call to gen_server:call(<0.415.0>, {awre_call,{unsubscribe,undefined}}) in gen_server:terminate/7 line 814

08:29:53.635 [error] Supervisor igs_sup had child igs_main_server started with igs_main:start_link() at <0.400.0> exit with reason no such process or port in call to gen_server:call(<0.415.0>, {awre_call,{unsubscribe,undefined}}) in context child_terminated

thanks for your help,
/Robi

@ethrbh
Copy link
Contributor Author

ethrbh commented May 5, 2016

hello,

I made trace on erwa_in_tcp and wamper_protocol modules

dbg:tracer(). dbg:p(all, [c, return_to, timestamp]). MatchSpec = [{'_',[],[{return_trace}]}]. dbg:tpl({erwa_in_tcp, '_', '_'}, MatchSpec). dbg:tpl({wamper_protocol, '_', '_'}, MatchSpec).

and at line 2875 in the attached log file you can see the first line where "error" can be seen

10:16:51.474 [error] gen_server <0.524.0> terminated with reason: no match of right hand value

I am not familiar with above codes yet, thus right now I do not have idae what might be the problem :-(

Please find the trafe log in below link:
erwa_crash_trace-1.txt

thanks for your help,
/Robi

@bwegh bwegh added the bug label May 22, 2016
@bwegh bwegh self-assigned this May 22, 2016
@ethrbh
Copy link
Contributor Author

ethrbh commented Jul 27, 2016

hello Bas,

So sorry to distubing you, I'm just interesting, are you still working on
erwa project in Github? If not, please just let me know, I try solve the
reported issue by myself.

thanks for your help and understanding

/Robi

2016-05-04 18:21 GMT+02:00 Bas Wegh notifications@github.com:

could you just post a raw message, so it is easier for me to look into the
issue, thanks


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#31 (comment)

@bwegh
Copy link
Owner

bwegh commented Aug 13, 2016

Hi Robi,
I will work on erwa/signal-box during the course of the next week.
If you can fix that issue it would be a great help for me.

As you see, I have at the moment not as much time for erwa/signal-box as I would like to.
Cheers,
Bas

@ethrbh
Copy link
Contributor Author

ethrbh commented Aug 13, 2016

Hello Bas

Thanks for your answer. Yes, i try fix this issue. I will let you know when i am done.

Thanks
Robi

A Samsung eszközömről küldve

-------- Eredeti üzenet --------
Feladó: Bas Wegh notifications@github.com
Dátum: 2016.08.13. 8:48 (GMT+01:00)
Címzett: bwegh/erwa erwa@noreply.github.com
Másolatot kap: Róbert Balogh ethrbh@gmail.com, Author author@noreply.github.com
Tárgy: Re: [bwegh/erwa] Erwa crashes when sending "big" string (#31)

Hi Robi,
I will work on erwa/signal-box during the course of the next week.
If you can fix that issue it would be a great help for me.

As you see, I have at the moment not as much time for erwa/signal-box as I would like to.
Cheers,
Bas


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/31#issuecomment-239606095, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABv4WCHOejVAVf8ttdtF5mebKY0-swljks5qfWiqgaJpZM4IW-WC.

bwegh added a commit that referenced this issue Sep 4, 2016
Fix for Erwa issue #31 by ETHRBH.
@bwegh bwegh closed this as completed Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants