Hi.
This is a bug I've found in amuled that is yet not solved (at least for amule-cvs-20071112). It happens when launching amuled and it starts kademlia. I've debugged amuled with gdb and found the problem in SafeFile.cpp, CFileDataIO::ReadTag, line 456:
} catch (...) {
printf("Invalid Kad tag; type=0x%02x name=0x%02x\n",
type, ((const char *)unicode2char(name))[0]);
delete retVal;
throw;
}
The problem is that sometimes unicode2char returns NULL, and so trying to access character at pos.
- triggers an exception. I patched it as follows:
} catch (...) {
// Do not try to print first byte of name, unicode2char sometimes returns NULL
printf("Invalid Kad tag; type=0x%02x\n", type);
printf("Invalid Kad tag; name=%s\n", ((const char *)unicode2char(name)));
delete retVal;
throw;
}
This is the backtrace of the error:
----------------------------=| BACKTRACE FOLLOWS: |=----------------------------
Current version is: aMuled CVS using v2.8.6 (Snapshot: Mon Nov 12 07:01:55 CET 2007)
Running on: Linux 2.4.27 i686
[2] CamuleApp::OnFatalException() in amule.cpp:1294
[3] wxFatalSignalHandler in /home/jordi/mldonkey/amule/wxgtk-2.8.6/lib/libwx_baseu-2.8.so.0[0x4019b5e8]
[4] ?? in /lib/libpthread.so.0 [0x4002d825]
[5] ?? in /lib/libc.so.6 [0x4031d678]
[6] Kademlia::CIndexed::ReadFile() in Indexed.cpp:137
[7] Kademlia::CIndexed::CIndexed() in Indexed.cpp:80
[8] Kademlia::CKademlia::Start(Kademlia::CPrefs*) in Kademlia.cpp:107
[9] Kademlia::CKademlia::Start() in Kademlia.cpp:80
[10] CamuleApp::StartKad() in amule.cpp:2144
[11] CamuleApp::OnInit() in amule.cpp:815
[12] CamuleDaemonApp::OnInit() in amuled.cpp:439
[13] wxAppConsole::CallOnInit() in app.h:76
[14] wxEntry(int&, wchar_t**) in /home/jordi/mldonkey/amule/wxgtk-2.8.6/lib/libwx_baseu-2.8.so.0[0x40124f50]
[15] wxEntry(int&, char**) in /home/jordi/mldonkey/amule/wxgtk-2.8.6/lib/libwx_baseu-2.8.so.0[0x40125050]
[16] main in amuled.cpp:101
[17] __libc_start_main in /lib/libc.so.6[0x40309e36]
[18] _start in start.S:105