Discussion:
HELP! "bad bencoded data" with new generated torrent
Paulo S Silva Jr
2005-03-09 04:11:56 UTC
Permalink
Hi, All...

I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.

The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.

So what I could be doing wrong here?!

I'm running out of ideas.

Regards,

Paulo






Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Brian Dessent
2005-03-09 04:47:51 UTC
Permalink
Post by Paulo S Silva Jr
I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.
The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.
So what I could be doing wrong here?!
The info_hash is just one part of the torrent, you could be breaking the
bencoding standard in any number of ways which causes the torrent client
you're using to barf. We would need more information or a sample of
your bencoder's output to be able to begin to help you. Your best bet
is to try several bdec implementations, such as btshowmetainfo.py,
TorrentSpy, DehackEd's php benc/bdec routines, etc.

BTW: There has never been a version of the mainstream client that
resembles anything like "0.3.10", so I don't know what you're talking
about there.

Brian



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Paulo S Silva Jr
2005-03-09 04:16:30 UTC
Permalink
Hi, All...

I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.

The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.

So what I could be doing wrong here?!

I'm running out of ideas.

Regards,

Paulo






Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Olaf van der Spek
2005-03-09 09:25:52 UTC
Permalink
Post by Paulo S Silva Jr
Hi, All...
I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.
The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.
So what I could be doing wrong here?!
I'm running out of ideas.
Create a .torrent of a certain file with the 'official' maker and your
maker and compare them in a hex editor.



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
David Smith
2005-03-09 08:22:28 UTC
Permalink
Hey Paulo,



I ran into the same problem.



Use a hex editor to open up your generated torrent file.

Compare your file to a valid generated file.



Compare and contrast.



A hint, where your problem MIGHT be: UTF-8 encoding?



http://cplan.cse.msu.edu/weblogs/smithiscrazy/archive/2005/02/07/370.aspx



Cheers,

Tell me how it goes!



P.S. .torrent files are now encoded in UTF-8 ( I'm pretty sure
=D ) Check out BT 4.0.0 at http://www.bittorrent.com
<http://www.bittorrent.com/>

David Smith
Michigan State University
Student Ambassador for Microsoft
<mailto:***@msu.edu> ***@msu.edu
248.770.5524

_____

From: Paulo S Silva Jr [mailto:***@yahoo.com]
Sent: Tuesday, March 08, 2005 11:12 PM
To: ***@yahoogroups.com
Subject: [BitTorrent] HELP! "bad bencoded data" with new generated torrent




Hi, All...

I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.

The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.

So what I could be doing wrong here?!

I'm running out of ideas.

Regards,

Paulo








Yahoo! Groups Sponsor



ADVERTISEMENT

<http://us.ard.yahoo.com/SIG=129jtii3j/M=298184.6018725.7038619.3001176/D=gr
oups/S=1705007389:HM/EXP=1110428310/A=2593423/R=0/SIG=11el9gslf/*http:/www.n
etflix.com/Default?mqso=60190075> click here



<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
:HM/A=2593423/rand=964790975>



_____

Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

* To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com
<mailto:BitTorrent-***@yahoogroups.com?subject=Unsubscribe>

* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.



[Non-text portions of this message have been removed]




Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Kenneth Porter
2005-03-09 05:12:50 UTC
Permalink
--On Wednesday, March 09, 2005 4:11 AM +0000 Paulo S Silva Jr
Post by Paulo S Silva Jr
I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.
When you made the torrent, did you remember to add "/announce" to the
tracker URL? That's the error message I got when I forgot that, because the
client would fetch the tracker's root instead of the announce.





Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
John Hoffman
2005-03-09 18:54:27 UTC
Permalink
Post by Paulo S Silva Jr
I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.
The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.
So what I could be doing wrong here?!
Nearly all the problems I've seen with .torrent file generation have
been caused by the file being written in text mode rather than binary.
Make sure you open the file using "wb" rather than "w".



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Justin Cormack
2005-03-10 01:33:22 UTC
Permalink
Post by John Hoffman
Post by Paulo S Silva Jr
I'm developping a torrent generator and I'm using BT 0.3.10 to test
my generated files. And I'm stuck with this error.
The generated torrent pass my bdecoder and seems normal. I've
compared the Info Hash of my generated torrent with other torrent
generator programs and the Info Hash matches.
So what I could be doing wrong here?!
Nearly all the problems I've seen with .torrent file generation have
been caused by the file being written in text mode rather than binary.
Make sure you open the file using "wb" rather than "w".
The above points out the fact that you havent said enough about what
you are doing - we dont know what language you are using, or OS even.
"wb" vs "w" doesnt make sense in Unix for example.

I seem to remember I had one problem the first time I implemented
bencoding. I forget what it was, but I do remember that doing a hexdump
and comparing it against another programs output made it obvious in
a couple of seconds - just find where your output differs.

j





Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Elliott Mitchell
2005-03-10 01:03:43 UTC
Permalink
Post by David Smith
A hint, where your problem MIGHT be: UTF-8 encoding?
http://cplan.cse.msu.edu/weblogs/smithiscrazy/archive/2005/02/07/370.aspx
P.S. .torrent files are now encoded in UTF-8 ( I'm pretty sure
=D ) Check out BT 4.0.0 at http://www.bittorrent.com
<http://www.bittorrent.com/>
There are two spots that claim BT uses UTF-8, one of the linked to
locations does not exist (http://www.bittorrent.com/download.html), while
the other (http://www.bittorrent.com/protocol.html) says nothing of the
sort. I am therefore highly skeptical of the reliability of the original
author.

The person responding as "Bram" (who may or may not be Bram Cohen) isn't
saying UTF-8 either, merely that at the lowest layers they're binary
strings.
Post by David Smith
David Smith
Michigan State University
Student Ambassador for Microsoft
My condolences on that position.
--
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/)
\ ( | ***@gremlin.m5p.com PGP 8881EF59 | ) /
\_ \ | _____ -O #include <stddisclaimer.h> O- _____ | / _/
\___\_|_/82 04 A1 3C C7 B1 37 2A*E3 6E 84 DA 97 4C 40 E6\_|_/___/





Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Olaf van der Spek
2005-03-10 08:54:35 UTC
Permalink
Post by Elliott Mitchell
Post by David Smith
A hint, where your problem MIGHT be: UTF-8 encoding?
http://cplan.cse.msu.edu/weblogs/smithiscrazy/archive/2005/02/07/370.aspx
P.S. .torrent files are now encoded in UTF-8 ( I'm pretty sure
=D ) Check out BT 4.0.0 at http://www.bittorrent.com
<http://www.bittorrent.com/>
There are two spots that claim BT uses UTF-8, one of the linked to
locations does not exist (http://www.bittorrent.com/download.html), while
the other (http://www.bittorrent.com/protocol.html) says nothing of the
sort. I am therefore highly skeptical of the reliability of the original
author.
http://www.bittorrent.com/bittorrent_versions.html
Post by Elliott Mitchell
Torrent fields are correctly created and interpreted as utf8
The person responding as "Bram" (who may or may not be Bram Cohen) isn't
saying UTF-8 either, merely that at the lowest layers they're binary
strings.
Post by David Smith
David Smith
Michigan State University
Student Ambassador for Microsoft
My condolences on that position.
--
Olaf van der Spek
http://xccu.sf.net/



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
John Hoffman
2005-03-10 09:39:43 UTC
Permalink
Post by Elliott Mitchell
Post by David Smith
A hint, where your problem MIGHT be: UTF-8 encoding?
http://cplan.cse.msu.edu/weblogs/smithiscrazy/archive/2005/02/07/370.aspx
P.S. .torrent files are now encoded in UTF-8 ( I'm pretty sure
=D ) Check out BT 4.0.0 at http://www.bittorrent.com
<http://www.bittorrent.com/>
There are two spots that claim BT uses UTF-8, one of the linked to
locations does not exist (http://www.bittorrent.com/download.html), while
the other (http://www.bittorrent.com/protocol.html) says nothing of the
sort. I am therefore highly skeptical of the reliability of the original
author.
The person responding as "Bram" (who may or may not be Bram Cohen) isn't
saying UTF-8 either, merely that at the lowest layers they're binary
strings.
I wouldn't be surprised if that was Bram Cohen. The point he was making
was that, while filenames were originally left unencoded and are now
encoded using UTF-8, the particular data mentioned in the article above
was part of the "pieces" key, and was a list of hashes. These hashes
are binary data, 20 8-bit bytes worth, big-Endian encoded, and are NOT
supposed to be processed through Unicode conversions. Anyone doing so
will find themselves with dysfunctional .torrent files.



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
David Smith
2005-03-10 01:41:10 UTC
Permalink
Hey Elliott,



Thanks for your response!
Post by Elliott Mitchell
There are two spots that claim BT uses UTF-8, one of the linked to
locations does not exist (http://www.bittorrent.com/download.html), while
the other (http://www.bittorrent.com/protocol.html) says nothing of the
sort. I am therefore highly skeptical of the reliability of the original
author.
The person responding as "Bram" (who may or may not be Bram Cohen) isn't
saying UTF-8 either, merely that at the lowest layers they're binary
strings.
Post by David Smith
David Smith
Michigan State University
Student Ambassador for Microsoft
My condolences on that position.
The point of my email was that the .torrent file is NOT UTF-8,
and that the developer may have THOUGHT it is supposed to be UTF-8.

Thanks for letting me clarify.

David Smith
Michigan State University
<mailto:***@msu.edu> ***@msu.edu





[Non-text portions of this message have been removed]




Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
paritosh mahana
2005-03-09 19:48:22 UTC
Permalink
My first question is wot is the "wb" and "w" stands
for...
Post by John Hoffman
Nearly all the problems I've seen with .torrent file
generation have
been caused by the file being written in text mode
rather than binary.
Make sure you open the file using "wb" rather than
"w".
See if we are torrenting a folder and lets say there
are 4 files in it.(a,b,c,d)

Say my bit torrent making code begins to make the hash
by keeping the file order(a,b,c,d).

And another bit torrent making client makes the hash
with the file order(b,c,a,d).

then the hashes made by my code and the other client
will be different.

So my question is, IS there any specification about
the ordering of the files.

ps:I am new to bit torrent..so please correct me if i
am wrong anywhere..thanks..




__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Brian Dessent
2005-03-10 22:16:52 UTC
Permalink
Post by paritosh mahana
My first question is wot is the "wb" and "w" stands
for...
"man fopen"
Post by paritosh mahana
See if we are torrenting a folder and lets say there
are 4 files in it.(a,b,c,d)
Say my bit torrent making code begins to make the hash
by keeping the file order(a,b,c,d).
And another bit torrent making client makes the hash
with the file order(b,c,a,d).
then the hashes made by my code and the other client
will be different.
So my question is, IS there any specification about
the ordering of the files.
ps:I am new to bit torrent..so please correct me if i
am wrong anywhere..thanks..
Though it is not stated explicitly anywhere official, I think everyone
agrees that the path/filename list should be sorted in lexicographical
order so that a torrent of a given set of files always has the same hash
(given that the same piece size is chosen, naturally.) This has been
discussed a number of times, read the archives.

Brian



Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/BitTorrent/

<*> To unsubscribe from this group, send an email to:
BitTorrent-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Loading...