Crash when adding search result from user who has left the hub
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LinuxDC++ |
Fix Released
|
High
|
juha berg |
Bug Description
Linuxdcpp crashes when trying to download a search result from a user who has left the hub. The crash doesn't happen if the result is added to the queue immediately after the user leaves, but minute or two should be enough, after that attempt to add result to the queue leads to crash (or assert failure with debug builds).
BT From debug build:
#0 0xb7f73424 in __kernel_vsyscall ()
#1 0xb75c1660 in raise () from /lib/libc.so.6
#2 0xb75c2e98 in abort () from /lib/libc.so.6
#3 0xb75ba6ce in __assert_fail () from /lib/libc.so.6
#4 0x0809fd8b in boost::
#5 0x0809fda3 in dcpp::User:
#6 0x082138fb in std::tr1:
__k=@0xb48bf284) at /usr/lib/
#7 0x08213916 in std::tr1:
at /usr/lib/
#8 0x08202771 in dcpp::QueueMana
#9 0x08207dd7 in dcpp::QueueMana
#10 0x0820de72 in dcpp::QueueMana
hubHint=
#11 0x080ed3bf in Search:
{static npos = 4294967295, _M_dataplus = {<std::
{static npos = 4294967295, _M_dataplus = {<std::
{static npos = 4294967295, _M_dataplus = {<std::
{static npos = 4294967295, _M_dataplus = {<std::
{static npos = 4294967295, _M_dataplus = {<std::
#12 0x081117ad in Func6<Search, std::string, std::string, std::string, long long, std::string, std::string>::call (this=0x97608b0)
at linux/func.hh:228
#13 0x08183b00 in WulforManager:
#14 0x08183bb9 in WulforManager:
#15 0xb785e33f in ?? () from /usr/lib/
#16 0x095009d8 in ?? ()
#17 0x094ff678 in ?? ()
#18 0x00000000 in ?? ()
Now, should we check the return value of that userPtr that is passed to QueueManager::add? By checking if the user.get() != 0. But it should still be possible to add result even if the original source has left (I guess there isn't and QM:add without userPtr?). Or should we store the UserPtrs (or SearchResultPtrs?) while the result list is open? (if I remember correctly dc++ stored the SearchResults in the tab while they were being displayed).
--RZ
Related branches
Changed in linuxdcpp: | |
milestone: | none → 1.1.0 |
Changed in linuxdcpp: | |
assignee: | Razzloss (razzloss) → juha berg (bikikku) |
status: | In Progress → Fix Released |
I say we just check if ClientManager: :getInstance( )->findUser returns NULL or not. That should be sufficient. Previously we kept the SearchResultPtr in the UI and it contains a reference to UserPtr, so reference counting ensured that they were both still around when we passed them to the core. Now that we're using find we no longer can rely on them still existing and need to validate the results of findUser.