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

Wrong torrent file generating when file smaller than predefined piece size #21

Open
T0ha opened this issue Nov 14, 2013 · 4 comments
Open

Comments

@T0ha
Copy link

T0ha commented Nov 14, 2013

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]}}
@arcusfelis
Copy link
Contributor

Hi. Could you provide the torrent file?

T0ha notifications@github.com 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:
#21

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@T0ha
Copy link
Author

T0ha commented Nov 14, 2013

No problem. Trying to fix it myself now. How can I send it (file)?

@arcusfelis
Copy link
Contributor

Upload to something like dropbox and post a public link here.

T0ha notifications@github.com wrote:

No problem. Trying to fix it myself now. How can I send it?


Reply to this email directly or view it on GitHub:
#21 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

T0ha added a commit to T0ha/etorrent_core that referenced this issue Nov 14, 2013
@T0ha
Copy link
Author

T0ha commented Nov 14, 2013

Sorry. I have no enough experience w/GH collaboration. It's my first pull-request. But I want to start :-)

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

2 participants