ericmckean / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

Assertion failure in destructors: m_ses.is_network_thread() #344

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I'm not sure.  It may be due to a session plugin calling:

    tp->set_error(errors::destructing_torrent, "...msg...");
    m_ses->remove_torrent(tp->get_handle(),session::delete_files);

But if it is, there's a timing component to it as well.  The above code was 
called 158 times in a 16+ hour test, and two destructor methods failed 13 times 
each.  By the way they're perfectly paired, I suspect that each pair is a 
single incident:

    file: 'bt_peer_connection.cpp'
    line: 153
    function: virtual libtorrent::bt_peer_connection::~bt_peer_connection()
    expression: m_ses.is_network_thread()

followed by:

    file: 'peer_connection.cpp'
    line: 729
    function: virtual libtorrent::peer_connection::~peer_connection()
    expression: m_ses.is_network_thread()

What version of the product are you using? On what operating system?

SVN Rev 6977
version 0.16.1.0
Ubuntu 10.04

Please provide any additional information below.

The full 'asserts.log' is attached.

I did try upgrading to the latest SVN (7068) but ran into completely different 
assertion failures that I think were related to the recent ut_pex changes.

PLANS:

I've improved the logging in the plugin a bit, and modified the assert.cpp file 
to add the 'time_now_string()' to the assertion failure message.  That should 
make it easier to tie back to the exact point in the log file when the 
assertion failed.

If I come up with any additional information, I'll add it to this report.

Original issue reported on code.google.com by edwin.wi...@gmail.com on 27 Jun 2012 at 9:20

Attachments:

GoogleCodeExporter commented 9 years ago
I believe I figured it out.

Given a seeding torrent, if you:

    tp->set_error(errors::destructing_torrent, "...msg...");
    m_ses->remove_torrent(tp->get_handle(),session::delete_files);

from within a session plugin, that triggers the assertion failure pair.

Reasoning: I changed my code to NOT delete seeding torrents and the assertion 
failures stopped.  Other torrents were still deleted by the code, but there 
were no assertion failures.

Original comment by edwin.wi...@gmail.com on 28 Jun 2012 at 4:49