{"action":"created","issue":{"url":"https://api.github.com/repos/arvidn/libtorrent/issues/511","repository_url":"https://api.github.com/repos/arvidn/libtorrent","labels_url":"https://api.github.com/repos/arvidn/libtorrent/issues/511/labels{/name}","comments_url":"https://api.github.com/repos/arvidn/libtorrent/issues/511/comments","events_url":"https://api.github.com/repos/arvidn/libtorrent/issues/511/events","html_url":"https://github.com/arvidn/libtorrent/issues/511","id":137399138,"number":511,"title":"checking torrent files contents shutdown access violation","user":{"login":"ajax16384","id":340593,"avatar_url":"https://avatars.githubusercontent.com/u/340593?v=3","gravatar_id":"","url":"https://api.github.com/users/ajax16384","html_url":"https://github.com/ajax16384","followers_url":"https://api.github.com/users/ajax16384/followers","following_url":"https://api.github.com/users/ajax16384/following{/other_user}","gists_url":"https://api.github.com/users/ajax16384/gists{/gist_id}","starred_url":"https://api.github.com/users/ajax16384/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajax16384/subscriptions","organizations_url":"https://api.github.com/users/ajax16384/orgs","repos_url":"https://api.github.com/users/ajax16384/repos","events_url":"https://api.github.com/users/ajax16384/events{/privacy}","received_events_url":"https://api.github.com/users/ajax16384/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-29T22:28:19Z","updated_at":"2016-03-01T09:36:17Z","closed_at":null,"body":"While checking files and trying to finish session:\r\n\r\nMainThread:\r\n \tlibtorrent::session::~session()\r\n\r\nIOThread:\r\n \tlibtorrent::smart_ban_plugin::on_piece_pass(int p)\r\n \tlibtorrent::torrent::we_have(int index)\r\n \tlibtorrent::torrent::on_piece_hashed(const libtorrent::disk_io_job * j)\r\n \t...\r\n \tlibtorrent::disk_io_thread::call_job_handlers(void * userdata)\r\n\r\n\r\nFault method:\r\n````c++\r\nvirtual void on_piece_pass(int p) TORRENT_OVERRIDE\r\n....\r\n\tm_torrent.session().disk_thread().async_read(&m_torrent.storage() // m_torrent.m_storage == NULL and \"disk_io_thread::async_read\" throws Access violation\r\n\t, r, boost::bind(&smart_ban_plugin::on_read_ok_block\r\n\t, shared_from_this(), *i, i->second.peer->address(), _1)\r\n\t, reinterpret_cast<void*>(1));\r\n````"},"comment":{"url":"https://api.github.com/repos/arvidn/libtorrent/issues/comments/190634426","html_url":"https://github.com/arvidn/libtorrent/issues/511#issuecomment-190634426","issue_url":"https://api.github.com/repos/arvidn/libtorrent/issues/511","id":190634426,"user":{"login":"ajax16384","id":340593,"avatar_url":"https://avatars.githubusercontent.com/u/340593?v=3","gravatar_id":"","url":"https://api.github.com/users/ajax16384","html_url":"https://github.com/ajax16384","followers_url":"https://api.github.com/users/ajax16384/followers","following_url":"https://api.github.com/users/ajax16384/following{/other_user}","gists_url":"https://api.github.com/users/ajax16384/gists{/gist_id}","starred_url":"https://api.github.com/users/ajax16384/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajax16384/subscriptions","organizations_url":"https://api.github.com/users/ajax16384/orgs","repos_url":"https://api.github.com/users/ajax16384/repos","events_url":"https://api.github.com/users/ajax16384/events{/privacy}","received_events_url":"https://api.github.com/users/ajax16384/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T09:36:17Z","updated_at":"2016-03-01T09:36:17Z","body":"````c++\r\n disk_io_job* j = allocate_job(disk_io_job::read);\r\n j->storage = storage->shared_from_this(); // storage == NULL\r\n\r\n libtorrent::disk_io_thread::async_read(libtorrent::piece_manager * storage, const libtorrent::peer_request & r, const boost::function<void __cdecl(libtorrent::disk_io_job const *)> & handler, void * requester, int flags)\r\n libtorrent::`anonymous namespace'::smart_ban_plugin::on_piece_pass(int p)\r\n libtorrent::torrent::we_have(int index)\r\n libtorrent::torrent::piece_passed(int index)\r\n libtorrent::torrent::on_piece_verified(const libtorrent::disk_io_job * j)\r\n boost::detail::function::void_function_obj_invoker1<boost::_bi::bind_t<void,boost::_mfi::mf1<void,libtorrent::torrent,libtorrent::disk_io_job const *>,boost::_bi::list2<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >,boost::arg<1> > >,void,libtorrent::disk_io_job const *>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const libtorrent::disk_io_job * a0)\r\n libtorrent::disk_io_thread::call_job_handlers(void * userdata)\r\n boost::asio::asio_handler_invoke<boost::_bi::bind_t<void,boost::_mfi::mf1<void,libtorrent::disk_io_thread,void *>,boost::_bi::list2<boost::_bi::value<libtorrent::disk_io_thread *>,boost::_bi::value<void *> > > >(boost::_bi::bind_t<void,boost::_mfi::mf1<void,libtorrent::disk_io_thread,void *>,boost::_bi::list2<boost::_bi::value<libtorrent::disk_io_thread *>,boost::_bi::value<void *> > > & function, ...)\r\n boost::asio::detail::completion_handler<boost::_bi::bind_t<void,boost::_mfi::mf1<void,libtorrent::disk_io_thread,void *>,boost::_bi::list2<boost::_bi::value<libtorrent::disk_io_thread *>,boost::_bi::value<void *> > > >::do_complete(boost::asio::detail::win_iocp_io_service * owner, boost::asio::detail::win_iocp_operation * base, const boost::system::error_code & __formal, unsigned int __formal)\r\n boost::asio::detail::win_iocp_io_service::do_one(bool block, boost::system::error_code & ec)\r\n boost::asio::detail::win_iocp_io_service::run(boost::system::error_code & ec)\r\n boost::asio::io_service::run()\r\n boost::asio::detail::win_thread_function(void * arg)\r\n````"}}