SMT

Member
  • Content count

    70
  • Joined

  • Last visited

Posts posted by SMT


  1. OK so all that seems to keep happening is that apex keeps crashing with access voilations, they all seem very similar if not the same. SO instead of me continously posting tons of exception info's I have decided to put up a live version on one of my sites

    Live Exceptioninfo.txt

    It's there and is more or less live, except the time it takes the file to update.

    omg, so much dumps for same error. flylink team has figured out reason of this: conflict with NOD32 antivirus software, but only on multicore CPUs. uninstall nod and try again (stopping does not help). if it works, please PM me, want to collect statistics


  2. it will solve another problem: incomplete localization in config-saved strings. for example, download log format initialized as

    setDefault(LOG_FORMAT_POST_DOWNLOAD, "%Y-%m-%d %H:%M: %[target]" + STRING(DOWNLOADED_FROM) + "%[userNI] (%[userCID]), %[fileSI] (%[fileSIchunk]), %[speed], %[time]");

    and after user switched language, it is also in default (english).

    so it will be good to set laguage.xml before first client start


  3. what about splitting ApexDC++ into 2 separate parts: daemon (service) and GUI?

    daemon will download/upload data and will be easy compiled to linux or other platform with std c++ libs from same sourcecode base.

    control must be performed from usual tcp/ip connection, so user can do anything remotely or control downloads on linux server from desktop pc with windows.

    gui for simplicity can be started at WINE (some apex mods altered to work in WINE), but later it can be rewritten as native linux application

    today ApexDC++ source is already split into 'client' and 'gui' library, but there is no strict interface

    it's also could be 2 lib-files for linking with gui 'StrongDC.lib': usual 'client.lib' that after linking creates monolith program and 'client.lib' with stub functions, that connects to real 'client.lib' on other process or remote machine, so it will be compile-time option to create monolithic or modular program

    even for windows users separating gui from server code will increase stability

    what do you think? too much work?


  4. It's the developer's responsibility to ensure features are not abused within their client. :)

    no, it should be defined by connection protocol. for now, dc++ does not have a lot of useful things (u/d ranking like in e-mule will be very good)

    also i think clients must create private keys and user CID must be hash of key, not just username+hubname

    if protocol allow cheat, user can't be considered as cheater


  5. i've catched one crash when accessing invalid OnlineUser pointer. the reason is unguarded pointer usage in ClientManager::setPkLock, user become offline and was deleted in another thread

    void setPkLock(const User::Ptr& p, const string& aPk, const string& aLock) {
    
    				OnlineUser* ou;
    
    				{
    
    						Lock l(cs);
    
    						OnlineIterC i = onlineUsers.find(p->getCID());
    
    						if(i == onlineUsers.end()) return;
    
    
    						ou = i->second;
    
    						ou->getIdentity().set("PK", aPk);
    
    						ou->getIdentity().set("LO", aLock);
    
    				}
    
    				ou->getClient().updated(*ou); // <- ou valid only when ConnectionManager::cs locked
    
    		}
    well, i've changed code into
    void setPkLock(const User::Ptr& p, const string& aPk, const string& aLock) {
    
    				OnlineUser* ou;
    
    				{
    
    						Lock l(cs);
    
    						OnlineIterC i = onlineUsers.find(p->getCID());
    
    						if(i == onlineUsers.end()) return;
    
    
    						ou = i->second;
    
    						ou->getIdentity().set("PK", aPk);
    
    						ou->getIdentity().set("LO", aLock);
    
    						ou->getClient().updated(*ou); // !SMT!-fix
    
    				}
    
    		}

    and got deadlock after 30 minutes

    consider threads:

    _____________________thread 3052:

    UserConnection::on(BufferedSocketListener::Line, aLine = "$Lock=... Pk=...")

    ...fire(UserConnectionListener::CLock()) <= Speaker<UserConnectionListener>::cs locked!

    ConnectionManager::on(UserConnectionListener::CLock)

    ClientManager::setPkLock()

    ...Lock l(cs) <= ClientManager::cs locked!

    Client::updated

    ...fire(ClientListener::UserUpdated() <= Speaker<ClientListener>::cs locked!

    _____________________thread 2268:

    NmdcHub::onLine(aLine = "$Search...")

    ...fire(ClientListener::NmdcSearch()) <= Speaker<ClientListener>::cs locked!

    ClientManager::on(NmdcSearch)

    ...fire(ClientManagerListener::IncomingSearch()) <= Speaker<ClientManagerListener>::cs locked!

    _____________________thread 844:

    NmdcHub::onLine(aLine = "$MyInfo $All ...")

    NmdcHub::getUser()

    ClientManager::putOnline()

    ...fire(ClientManagerListener::UserConnected() <= Speaker<ClientManagerListener>::cs locked!

    QueueManager::on(ClientManagerListener::UserConnected)

    ConnectionManager::getDownloadConnection()

    ...Lock l(cs) <= ConnectionManager::cs locked!

    _____________________thread 2216:

    BufferedSocket::checkEvents()

    BufferedSocket::fail()

    ...fire(BufferedSocketListener::Failed()) <= Speaker<BufferedSocketListener>::cs locked!

    UserConnection::on(BufferedSocketListener::Failed)

    ...fire(UserConnectionListener::Failed()) <= Speaker<UserConnectionListener>::cs locked!

    ________________________________________________________________________________

    ___

    as you see, each thread locked by next and last thread locked by first.

    huh, it's really was not easy to debug, deadlock appeared when Apex got 96 threads.

    i want to see locks hierarhy graph from program architect (every upper-level lock should not locked if lower-level lock is already locked), but i don't know who developed original 'client' library code

    the only solution is not to pass OnlineUser& into on(UserUpdated) event, but User::Ptr instead. bugfix code will be available on new version (affects many files but now my working copy contains a lot of unfinished things, unrelated to this problem, needed to be done)

    ps:

    some functions in NmdcHub, also invokes getUser(nick) and this OnlineUser pointer is not guarded. i think, all ClientListener events, that passing OnlineUser& should be rewritten in same way


  6. i think there need be a tabs management popup panel with buttons to show/hide some group of tabs. for example, hide all unconnected hubs (but don't close, let them try co connect) or hide privates for some time (to review later)

    this in my todo list, but i dont know does it worth to spare time on GUI or implement some better things


  7. really there is no to discuss. the only purpose of this topic is to warn DC++ client developers (that, of course, visits this site but don't watch out for changelogs of all unofficial mods) to update code. PM-ing will delay updates until new official Apex version, that it's not preferrable


  8. apex crushed when trying to display user, that leaving hub in this moment. this bug was confirmed by 3 users. here is report

    Code: c0000005 (Access violation)
    
    Version: s10.1 (2007-01-04)
    
    Major: 5
    
    Minor: 1
    
    Build: 2600
    
    SP: 2
    
    Type: 1
    
    Time: 2007-01-05 01:47:03
    
    
    exception code C0000005 at eip=0042CA9A, nested: 00000000
    
    eax=00D97260 ebx=00000000 ecx=00000000 edx=00000000
    
    esi=00000000 edi=0012C5A4 ebp=0012C578 esp=0012C568
    
    ApexDC-s10_1!0x0042CA9A: ?
    
    ApexDC-s10_1!0x004A9967: ?
    
    ApexDC-s10_1!0x004A84A3: ?
    
    ApexDC-s10_1!0x0044E7C7: ?
    
    ApexDC-s10_1!0x0041D55D: ?
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3B368: DefWindowProcW
    
    USER32!0x77D3B3B4: DefWindowProcW
    
    ntdll!0x7C90EAE3: KiUserCallbackDispatcher
    
    USER32!0x77D3B7AB: SendMessageW
    
    COMCTL32!0x773DAF7B: Ordinal414
    
    COMCTL32!0x773DB009: Ordinal341
    
    COMCTL32!0x7742C307: FlatSB_SetScrollProp
    
    COMCTL32!0x77407720: FlatSB_SetScrollProp
    
    COMCTL32!0x7740D520: FlatSB_SetScrollProp
    
    COMCTL32!0x7740E4C6: FlatSB_SetScrollProp
    
    COMCTL32!0x77410DDA: FlatSB_SetScrollProp
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3C00E: DestroyCaret
    
    USER32!0x77D3C034: CallWindowProcW
    
    ApexDC-s10_1!0x0047C5E3: ?
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3B368: DefWindowProcW
    
    USER32!0x77D3B3B4: DefWindowProcW
    
    ntdll!0x7C90EAE3: KiUserCallbackDispatcher
    
    COMCTL32!0x7740B75E: FlatSB_SetScrollProp
    
    COMCTL32!0x7740B7C0: FlatSB_SetScrollProp
    
    COMCTL32!0x774106D7: FlatSB_SetScrollProp
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3C00E: DestroyCaret
    
    USER32!0x77D3C034: CallWindowProcW
    
    ApexDC-s10_1!0x0047C5E3: ?
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3B368: DefWindowProcW
    
    USER32!0x77D3B3B4: DefWindowProcW
    
    ntdll!0x7C90EAE3: KiUserCallbackDispatcher
    
    COMCTL32!0x7740DB4F: FlatSB_SetScrollProp
    
    COMCTL32!0x77410951: FlatSB_SetScrollProp
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3C00E: DestroyCaret
    
    USER32!0x77D3C034: CallWindowProcW
    
    ApexDC-s10_1!0x0047C5E3: ?
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D3B368: DefWindowProcW
    
    USER32!0x77D3B3B4: DefWindowProcW
    
    ntdll!0x7C90EAE3: KiUserCallbackDispatcher
    
    USER32!0x77D3B7AB: SendMessageW
    
    COMCTL32!0x773DAF7B: Ordinal414
    
    COMCTL32!0x773FF71C: Ordinal384
    
    COMCTL32!0x77401E79: Ordinal384
    
    COMCTL32!0x77403053: Ordinal384
    
    USER32!0x77D38709: GetDC
    
    USER32!0x77D387EB: GetDC
    
    USER32!0x77D389A5: GetWindowLongW
    
    USER32!0x77D389E8: DispatchMessageW

    the error is in the following code, bolded is dereferenced null-object:

    LRESULT HubFrame::onCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) {

    LPNMLVCUSTOMDRAW cd = (LPNMLVCUSTOMDRAW)pnmh;

    switch(cd->nmcd.dwDrawStage) {

    case CDDS_PREPAINT:

    return CDRF_NOTIFYITEMDRAW;

    case CDDS_ITEMPREPAINT: {

    UserInfo* ui = (UserInfo*)cd->nmcd.lItemlParam;

    if (FavoriteManager::getInstance()->isFavoriteUser(ui->getUser())) {

    cd->clrText = SETTING(FAVORITE_COLOR);

    } else if (UploadManager::getInstance()->hasReservedSlot(ui->getUser())) {

    cd->clrText = SETTING(RESERVED_SLOT_COLOR);

    } else if (ignoreList.find(ui->getUser()) != ignoreList.end()) {

    cd->clrText = SETTING(IGNORED_COLOR);

    } else if(ui->getUser()->isSet(User::FIREBALL)) {

    cd->clrText = SETTING(FIREBALL_COLOR);

    } else if(ui->getUser()->isSet(User::SERVER)) {

    cd->clrText = SETTING(SERVER_COLOR);

    } else if(ui->getIdentity().isOp()) {

    cd->clrText = SETTING(OP_COLOR);

    } else if(!ui->getIdentity().isTcpActive()) {

    cd->clrText = SETTING(PASIVE_COLOR);

    } else {

    cd->clrText = SETTING(NORMAL_COLOUR);

    }

    [...]


  9. on windows 2003 sp1

    after some expriments, i've figured, that default apex' font 'MS Shell Dlg' does not installed in win2003

    changed line inside Popups::onFont(), onTitleFont()

    from

    CFontDialog dlg(&font, CF_EFFECTS | CF_SCREENFONTS);
    into
    CFontDialog dlg(&font, CF_EFFECTS | CF_SCREENFONTS | CF_FORCEFONTEXIST); // !SMT!-F

    and dialog appears in debug build, but not in release (strange?).

    well, then i changed SettingsManager::SettingsManager(), replaced all "MS Shell Dlg,-11,... to "Arial,-11,

    now all works fine


  10. banned users on speedmod, Domolink DC++ (and hopefully, in future in more mods) receive ban description via $Error, if client $Supports BanMsg. Otherwise, private message is used. it will be good, if official client will support this (it's just a few lines of code, commented with !SMT!-B in sources), so many users will get additional info without spaming PM. it's not a 'leecher' feature, because you dont ban anydody, just inform users


  11. may be it's too late, but i like the following:

    if(wID == IDC_READD) { // re-add all sources
    
    						vector<User::Ptr> ul;
    
    						for(QueueItem::SourceIter s = ii->getBadSources().begin(); s != ii->getBadSources().end(); s++)
    
    								ul.push_back(s->getUser());
    
    						for(vector<User::Ptr>::const_iterator s = ul.begin(); s != ul.end(); s++)
    
    								QueueManager::getInstance()->readd(ii->getTarget(), *s);
    
    				} else {
    
    
    [...]
    
    
    				if(wID == IDC_REMOVE_SOURCE) {
    
    						vector<User::Ptr> ul;
    
    						for(QueueItem::SourceIter s = ii->getSources().begin(); s != ii->getSources().end(); s++)
    
    								ul.push_back(s->getUser());
    
    						for(vector<User::Ptr>::const_iterator s = ul.begin(); s != ul.end(); s++)
    
    								QueueManager::getInstance()->removeSource(ii->getTarget(), *s, QueueItem::Source::FLAG_REMOVED);
    
    				} else {

    technically no difference, but thinking that in future getBadSources() will not return just a constant vector, it will be better


  12. Curious.. I often get a similar thing, however I know it is because I was accessing the file as the downloaded completed thus windows didn't allow apex to rename it or more it. I do this quite regular by streaming it through Video Lan Client (found there www.videolan.org I'm able to do this with DC mainly because of my campus lan connection. However both those errors due occur predictably to me in that instance, so my thought is perhaps you have another file accessing it before and during the download completion. Perhaps even it's apex in some way I'm not sure, others here can answer that. However from what you told me is the exact situation that I have minus I know that I was accessing the file... where you in anyway doing that?

    look to DownloadManager::FileMover::run()

    in this case should be a record in log, but nothing in my case. and file is not removed from download queue, but it should be removed regardless of rename result. so i think, there is no signal 'download complete'


  13. i don't think that it can be easy reproduced

    all images really disappared when client running 60-80 hours. it affects images in 'search type' combo and user icons. may be resource leak or contrary, deleting shared resource linked to some object when deleting object (like bug in 'extra-slot' submenu in favs frame i posted last month. btw, did you confirm that bug?)