MongooseIM
MongooseIM copied to clipboard
Colon in a resource leads to badarg on a cleanup
MongooseIM version: 1.6.2 Installed from: source Erlang/OTP version: 18
2016-06-21 05:34:47 =ERROR REPORT====
** Generic server ejabberd_sm terminating
** Last message in was {node_cleanup,'[email protected]'}
** When Server state == {state}
** Reason for termination ==
** {badarg,[{erlang,binary_to_term,[<<41,95,49,55,95,87,56,71,78,67,58,131,104,2,104,3,98,0,0,5,186,98,0,2,114,116,98,0,8,153,47,103,100,0,33,112,114,111,100,45,77,111,110,103,111,111,115,101,67,97,110,97,114,121,64,49,55,50,46,50,56,46,51,50,46,49,53,49,0,0,38,126,0,0,3,194,2>>],[]},{ejabberd_sm_redis,'-cleanup/1-fun-0-',1,[{file,"src/ejabberd_sm_redis.erl"},{line,125}]},{lists,foreach,2,[{file,"lists.erl"},{line,1337}]},{timer,tc,2,[{file,"timer.erl"},{line,181}]},{ejabberd_sm,handle_call,3,[{file,"src/ejabberd_sm.erl"},{line,418}]},{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}]}]}
I found these items in the redis backend. Notice the colons in the resources.
s4:user1:server:1.10.1.0_WM8850:X6-10V_16_EF7BQ:.h.h.b....b..MVb..`[email protected]......
s4:user2:server:1.10.1.0_mismart-Smile-:)_17_W8GNC:[email protected]..{......
The binary in the crash message is the ending part of the second resource, the one with a smile, concatenated with the valid term.
Splitting, joining and using binary_to_term leads to a cleaner process crash with badarg on a cleanup for devices that have a colon in their resources.
Most probably still valid for current master. We'll verify this.