Alex Shterev | 2 May 2012 02:46
Picon
Gravatar

EXC_BAD_ACCESS in torrent_handle::get_peer_info

Hi guys,

I'm building a GUI BitTorrent client with libtorrent and I'm trying to
visualize some information about the connected peers, such as IP,
upload/download speed, etc. So far I've been trying to use
torrent_handle::get_peer_info, but I keep getting an EXC_BAD_ACCESS
at:

* thread #27: tid = 0x4603, 0x00007fff931f6ab7
libstdc++.6.dylib`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() [inlined] __exchange_and_add
at atomicity.h:51, stop reason = EXC_BAD_ACCESS (code=1,
address=0xfffffffffffffff8)
    frame #0: 0x00007fff931f6ab7
libstdc++.6.dylib`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() [inlined] __exchange_and_add
at atomicity.h:51
    frame #1: 0x00007fff931f6ab7
libstdc++.6.dylib`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() [inlined]
__exchange_and_add_dispatch at string-inst.cc:84
    frame #2: 0x00007fff931f6ab7
libstdc++.6.dylib`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() [inlined]
std::string::_Rep::_M_dispose(std::allocator<char> const&) at
string-inst.cc:235
    frame #3: 0x00007fff931f6ab7
libstdc++.6.dylib`std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() [inlined]
std::basic_string<char, std::char_traits<char>, std::allocator<char>
(Continue reading)

arvid | 2 May 2012 03:59
Picon
Picon
Favicon

Re: EXC_BAD_ACCESS in torrent_handle::get_peer_info

Quoting Alex Shterev <cold.phusion <at> gmail.com>:

> Hi guys,
> 
> I'm building a GUI BitTorrent client with libtorrent and I'm trying to
> visualize some information about the connected peers, such as IP,
> upload/download speed, etc. So far I've been trying to use
> torrent_handle::get_peer_info, but I keep getting an EXC_BAD_ACCESS
> at:

This typically happen if you build libtorrent with a different set of TORRENT*
defines than you define when you use it.

I'm guessing it's either TORRENT_DISABLE_GEO_IP or
TORRENT_DISABLE_RESOLVE_COUNTRIES that differs to cause this.

Which version of libtorrent are you using? there's a feature in 0.16 that's
supposed to give you a link error in this case.

--

-- 
Arvid Norberg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Han Liu | 2 May 2012 10:02
Picon
Favicon

Api document mismatch the parameter?

Hi guys,

I found the code to use the handle_alert in the API documentation below:

std::auto_ptr<alert> a;
a = ses.pop_alert();
my_handler h;
while (a.get())
{
        handle_alert<portmap_error_alert
                , tracker_warning_alert
                , torrent_finished_alert
        >::handle_alert(h, a);
        a = ses.pop_alert();

}

But according to the signature of handle_alert *the first parameter should
be alert pointer and second parameter should be handler.*
I am wondering is this documentation mistake?

--

-- 
Regards,
Han Liu
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
(Continue reading)

Alex Shterev | 3 May 2012 02:01
Picon
Gravatar

Re: EXC_BAD_ACCESS in torrent_handle::get_peer_info

Hi Arvid,

thank you for the suggestion - disabling Geo_IP and Resolve_Countries
did the trick :)

As I wrote in the first mail, I am using the 0.16 release. In fact, I
did get the linking error you mentioned (right after upgrading from
0.15.8), even though I've never set any of the TORRENT_DISABLE* flags
before. After one very frustrating hour of debugging, I tried out
disabling DHT on both sides and got the linking working again. *GEO_IP
and *RESOLVE_COUNTRIES are flags that I'm also not interested in, so
this makes it really weird.. Anyhow, thanks for the advice, I'm glad
to have it up and running again :)

Best,
Alex

On Tue, May 1, 2012 at 6:59 PM,  <arvid <at> cs.umu.se> wrote:
> Quoting Alex Shterev <cold.phusion <at> gmail.com>:
>
>> Hi guys,
>>
>> I'm building a GUI BitTorrent client with libtorrent and I'm trying to
>> visualize some information about the connected peers, such as IP,
>> upload/download speed, etc. So far I've been trying to use
>> torrent_handle::get_peer_info, but I keep getting an EXC_BAD_ACCESS
>> at:
>
> This typically happen if you build libtorrent with a different set of TORRENT*
> defines than you define when you use it.
(Continue reading)

Badoo | 6 May 2012 17:21
Favicon

Libtorrent Discuss, Giuseppe Pes left a message for you...

Giuseppe Pes left a message for you...

Its sender and content will be shown only to you and you can delete it at any time. You can instantly reply to
it, using the message exchange system. To find out what's in the message, just follow this link:
http://eu1.badoo.com/0261565464/in/YbCzRAQaTRE/?lang_id=3&m=21&mid=4fa696e4000000000003000030edc924

If the link in this message does not work, try copying and pasting it into your browser.

This email is part of our delivery procedure for the message sent by Giuseppe Pes. If you have received this
email by mistake, please ignore it. The message will be deleted soon.

Have fun!
The Badoo Team

You have received this email from Badoo Trading Limited (postal address below).
http://eu1.badoo.com/impersonation.phtml?lang_id=3&mail_code=21&email=libtorrent-discuss%40lists.sourceforge.net&secret=&action=block&block_code=1aed43&m=21&mid=4fa696e4000000000003000030edc924
Badoo Trading Limited is a limited company registered in England and Wales
under CRN 7540255 with its registered office at 12 Red Lion Square, London, WC1R 4QD.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Doug Barton | 6 May 2012 09:37
Picon
Favicon

Problem compiling 0.16

Trying to develop the FreeBSD port for 0.16, and ran into this:

CXX    escape_string.lo
escape_string.cpp: In function 'std::string
libtorrent::iconv_convert_impl(const std::string&, void*)':
escape_string.cpp:628: error: invalid conversion from 'char**' to 'const
char**'
escape_string.cpp:628: error:   initializing argument 2 of 'size_t
libiconv(void*, const char**, size_t*, char**, size_t*)'
*** Error code 1
1 error

Removing the const didn't help.

This is with libiconv-1.14, FWIW.

Doug

--

-- 

    This .signature sanitized for your protection

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
arvid | 6 May 2012 23:32
Picon
Picon
Favicon

Re: Problem compiling 0.16

Quoting Doug Barton <dougb <at> FreeBSD.org>:

> Trying to develop the FreeBSD port for 0.16, and ran into this:
> 
> CXX    escape_string.lo
> escape_string.cpp: In function 'std::string
> libtorrent::iconv_convert_impl(const std::string&, void*)':
> escape_string.cpp:628: error: invalid conversion from 'char**' to 'const
> char**'
> escape_string.cpp:628: error:   initializing argument 2 of 'size_t
> libiconv(void*, const char**, size_t*, char**, size_t*)'
> *** Error code 1
> 1 error
> 
> Removing the const didn't help.
> 
> This is with libiconv-1.14, FWIW.

I've found that iconv() seems like something many systems cannot
agree on a signature for. Since it's a pointer to pointer, the type
has to match exactly, since "char**" cannot be implicitly cast to
"const char**". By default I've gone with the posix specification [1]
and introduced exceptions for some known systems with this
alternative signature (which frankly makes more sense, since it's
an immutable argument).

In 0.16 there's a define in libtorrent/config.hpp that can override
this argument type. I believe there is an exception for BSD systems
in there already. Probably not in 0.14 though. You might want to take
a look at 0.16 if you want to try to back-port that (it should just be
(Continue reading)

Doug Barton | 6 May 2012 23:56
Picon

Problem compiling 0.16

Trying to develop the FreeBSD port for 0.16, and ran into this:

CXX    escape_string.lo
escape_string.cpp: In function 'std::string
libtorrent::iconv_convert_impl(const std::string&, void*)':
escape_string.cpp:628: error: invalid conversion from 'char**' to 'const
char**'
escape_string.cpp:628: error:   initializing argument 2 of 'size_t
libiconv(void*, const char**, size_t*, char**, size_t*)'
*** Error code 1
1 error

Removing the const didn't help.

This is with libiconv-1.14, FWIW.

Doug

--

-- 

    This .signature sanitized for your protection

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Doug Barton | 8 May 2012 03:19
Picon

Re: Problem compiling 0.16

On 05/06/2012 14:32, arvid <at> cs.umu.se wrote:
> Quoting Doug Barton <dougb <at> FreeBSD.org>:
> 
>> Trying to develop the FreeBSD port for 0.16, and ran into this:
>>
>> CXX    escape_string.lo
>> escape_string.cpp: In function 'std::string
>> libtorrent::iconv_convert_impl(const std::string&, void*)':
>> escape_string.cpp:628: error: invalid conversion from 'char**' to 'const
>> char**'
>> escape_string.cpp:628: error:   initializing argument 2 of 'size_t
>> libiconv(void*, const char**, size_t*, char**, size_t*)'
>> *** Error code 1
>> 1 error
>>
>> Removing the const didn't help.
>>
>> This is with libiconv-1.14, FWIW.
> 
> I've found that iconv() seems like something many systems cannot
> agree on a signature for. Since it's a pointer to pointer, the type
> has to match exactly, since "char**" cannot be implicitly cast to
> "const char**". By default I've gone with the posix specification [1]
> and introduced exceptions for some known systems with this
> alternative signature (which frankly makes more sense, since it's
> an immutable argument).
> 
> In 0.16 there's a define in libtorrent/config.hpp that can override
> this argument type. I believe there is an exception for BSD systems
> in there already. Probably not in 0.14 though. You might want to take
(Continue reading)

Dmitry | 13 May 2012 10:25
Picon

vc2010 project

Hi!

I compile libtorrent in vc2010 and get library which size is above 163 MB.
But if use bjam i'll get file with size 254 MB
The compiler settings for vc2010 project i take from one of the .rsp
file which generated when bjam compiling libtorrent.
And with some of the settings i have big problem - crash in
_CrtIsValidHeapPointer. This crashes occur with TORRENT_USE_OPENSSL
and when GeoIP is ON
In attachment i put my project file, maybe somebody can tell me what i do wrong?

And another question: in folder "examples" is jamfile, how can i
modified this file to use some special libtorrent library which i
complied with jamfile in root libtorrent folder?
Attachment (libtorrent.rar): application/rar, 2685 bytes
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Libtorrent-discuss mailing list
Libtorrent-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss

Gmane