etorrent_core
etorrent_core copied to clipboard
Wrong torrent file generating when file smaller than predefined piece size
When file smaller than predefined piece size, eg. file size is 256 bytes, in torrent file we have piece lenght equal to 104857 bytes. When we add such file to Dir we get:
2013-11-14 13:46:49.543 [error] <0.19502.1> Supervisor {<0.19502.1>,etorrent_torrent_sup} had child info started with etorrent_info:start_link(7, [{<<"info">>,[{<<"length">>,323},{<<"name">>,<<"154-219-79-252-228-18-204-155-129-126-196-92-121-...">>},...]}]) at undefined exit with reason no function clause matching etorrent_info:make_mask(0, 323, 1048576, 323, true) line 863 in context start_error
2013-11-14 13:46:49.543 [error] <0.19503.1> CRASH REPORT Process <0.19503.1> with 0 neighbours exited with reason: no function clause matching etorrent_info:make_mask(0, 323, 1048576, 323, true) line 863 in gen_server:init_it/6 line 328
2013-11-14 13:46:49.544 [error] <0.8332.1>@etorrent_ctl:handle_call:157 Unknown error: {{shutdown,{failed_to_start_child,info,{function_clause,[{etorrent_info,make_mask,[0,323,1048576,323,true],[{file,"src/etorrent_info.erl"},{line,863}]},{etorrent_info,'-fill_pieces/3-lc$^0/1-0-',3,[{file,"src/etorrent_info.erl"},{line,826}]},{etorrent_info,'-fill_pieces/3-fun-0-',3,[{file,"src/etorrent_info.erl"},{line,825}]},{lists,map,2,[{file,"lists.erl"},{line,1224}]},{etorrent_info,collect_static_file_info,1,[{file,"src/etorrent_info.erl"},{line,603}]},{etorrent_info,init,1,[{file,"src/etorrent_info.erl"},{line,392}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}},{child,undefined,<<61,86,120,188,104,224,30,243,98,243,63,116,227,126,107,144,200,179,106,155>>,{etorrent_torrent_sup,start_link,[{[{<<"info">>,[{<<"length">>,323},{<<"name">>,<<"154-219-79-252-228-18-204-155-129-126-196-92-121-198-192-207">>},{<<"piece length">>,1048576},{<<"pieces">>,<<199,151,234,59,20,242,66,15,239,43,161,105,47,175,126,166,95,31,66,41>>}]}],"chat.torrent",<<61,86,120,188,104,224,30,243,98,243,63,116,227,126,107,144,200,179,106,155>>},<<"-ETd011-634545818587">>,7,[]]},transient,infinity,supervisor,[etorrent_torrent_sup]}}
Hi. Could you provide the torrent file?
T0ha [email protected] wrote:
When file smaller than predefined piece size, eg. file size is 256 bytes, in torrent file we have piece lenght equal to 104857 bytes. When we add such file to Dir we get:
2013-11-14 13:46:49.543 [error] <0.19502.1> Supervisor {<0.19502.1>,etorrent_torrent_sup} had child info started with etorrent_info:start_link(7, [{<<"info">>,[{<<"length">>,323},{<<"name">>,<<"154-219-79-252-228-18-204-155-129-126-196-92-121-...">>},...]}]) at undefined exit with reason no function clause matching etorrent_info:make_mask(0, 323, 1048576, 323, true) line 863 in context start_error 2013-11-14 13:46:49.543 [error] <0.19503.1> CRASH REPORT Process <0.19503.1> with 0 neighbours exited with reason: no function clause matching etorrent_info:make_mask(0, 323, 1048576, 323, true) line 863 in gen_server:init_it/6 line 328 2013-11-14 13:46:49.544 [error] <0.8332.1>@etorrent_ctl:handle_call:157 Unknown error: {{shutdown,{failed_to_start_child,info,{function_clause,[{etorrent_info,make_mask,[0,323,1048576,323,true],[{file,"src/etorrent_info.erl"},{line,863}]},{etorrent_info,'-fill_pieces/3-lc$^0/1-0-',3,[{file,"src/etorrent_info.erl"},{line,826}]},{etorrent_info,'-fill_pieces/3-fun-0-',3,[{file,"src/etorrent_info.erl"},{line,825}]},{lists,map,2,[{file,"lists.erl"},{line,1224}]},{etorrent_info,collect_static_file_info,1,[{file,"src/etorrent_info.erl"},{line,603}]},{etorrent_info,init,1,[{file,"src/etorrent_info.erl"},{line,392}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}}},{child,undefined,<<61,86,120,188,104,224,30,243,98,243,63,116,227,126,107,144,200,179,106,155>>,{etorrent_torrent_sup,start_link,[{[{<<"info">>,[{<<"length">>,323},{<<"name">>,<<"154-219-79-252-228-18-204-155-129-126-196-92-121-198-192-207">>},{< <"piece length">>,1048576},{<<"pieces">>,<<199,151,234,59,20,242,66,15,239,43,161,105,47,175,126,166,95,31,66,41>>}]}],"chat.torrent",<<61,86,120,188,104,224,30,243,98,243,63,116,227,126,107,144,200,179,106,155>>},<<"-ETd011-634545818587">>,7,[]]},transient,infinity,supervisor,[etorrent_torrent_sup]}}
Reply to this email directly or view it on GitHub: https://github.com/jlouis/etorrent_core/issues/21
Sent from my Android device with K-9 Mail. Please excuse my brevity.
No problem. Trying to fix it myself now. How can I send it (file)?
Upload to something like dropbox and post a public link here.
T0ha [email protected] wrote:
No problem. Trying to fix it myself now. How can I send it?
Reply to this email directly or view it on GitHub: https://github.com/jlouis/etorrent_core/issues/21#issuecomment-28466295
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Sorry. I have no enough experience w/GH collaboration. It's my first pull-request. But I want to start :-)