Ah, I see.
Looks like a problem with the addr passed to the function. ip is 0 and it crashes on trying to determine the port.
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x0044417b in CClientUDPSocket::OnPacketReceived (this=0x85f39b0,
addr=@0x22f97c,
buffer=0x22b97c "ä(\223#Ö\v4m\206nâ_Wè\225\005aÃ\v\023c~\véU·Z\036i¼ûÙÐ\nú\224\f", length=294) at ClientUDPSocket.cpp:82
#2 0x0048c639 in CMuleUDPSocket::OnReceive (this=0x85f39b0, errorCode=0)
at MuleUDPSocket.cpp:178
#3 0x00444062 in CClientUDPSocket::OnReceive (this=0x85f39b0, errorCode=0)
at ClientUDPSocket.cpp:66
#4 0x00410bea in CamuleApp::UDPSocketHandler (this=0x8515a90,
event=@0x85f3570) at amule.cpp:2119
#5 0x008c6f65 in wxEvtHandler::ProcessEventIfMatches ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#6 0x008c72bc in wxEventHashTable::HandleEvent ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#7 0x008c82b9 in wxEvtHandler::ProcessEvent ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#8 0x008c80d9 in wxEvtHandler::ProcessPendingEvents ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#9 0x008c6274 in wxAppConsole::ProcessPendingEvents ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#10 0x00acb315 in wxIdleWakeUpModule::MsgHookProc ()
at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/iostream:77
#11 0x76ef8cff in USER32!CallNextHookEx () from C:\Windows\system32\user32.dll
#12 0x00000000 in ?? ()
(gdb) bt full 4
#0 0x00000000 in ?? ()
No symbol table info available.
#1 0x0044417b in CClientUDPSocket::OnPacketReceived (this=0x85f39b0,
addr=@0x22f97c,
buffer=0x22b97c "ä(\223#Ö\v4m\206nâ_Wè\225\005aÃ\v\023c~\véU·Z\036i¼ûÙÐ\nú\224\f", length=294) at ClientUDPSocket.cpp:82
protocol = 228 'ä'
opcode = 40 '('
ip = 0
port = 30519
#2 0x0048c639 in CMuleUDPSocket::OnReceive (this=0x85f39b0, errorCode=0)
at MuleUDPSocket.cpp:178
buffer = "ä(\223#Ö\v4m\206nâ_Wè\225\005aÃ\v\023c~\véU·Z\036i¼ûÙÐ\nú\224\f\000Wt)\224ã\002\214ù\000\n\232¡sÁH\200ã³ÌÛC\035i¢E½¥}\003s\002ÑYB\t%ʵnNë\034L\0051\b»¤:\005Q\aða4\002,¦O\t¯e\034Á¼XôbM\v{çuÄ;DÈ@<¿\002\200QL\t1Ø\236r7«ôý\235PzA÷µ¥vq\224ÐB\002 \224H\t¶F\2101\n¸\002¼¨3\016§«¤NÛ\214s?\236\002MlÜ\017~\224\230ùÆù \233µ-\t¶oEþÕ\213d5p\002©tÛ\017¦\237"...
addr = <incomplete type>
length = 294
error = false
lastError = 0
#3 0x00444062 in CClientUDPSocket::OnReceive (this=0x85f39b0, errorCode=0)
at ClientUDPSocket.cpp:66
No locals.
(More stack frames follow...)
(gdb)
void CClientUDPSocket::OnPacketReceived(const wxIPV4address& addr, byte* buffer, size_t length)
{
wxCHECK_RET(length >= 2, wxT("Invalid packet."));
uint8 protocol = buffer[0];
uint8 opcode = buffer[1];
uint32 ip = StringIPtoUint32(addr.IPAddress());
uint16 port = addr.Service();
void CMuleUDPSocket::OnReceive(int errorCode)
{
...
length = m_socket->RecvFrom(addr, buffer, UDP_BUFFER_SIZE).LastCount();
error = m_socket->Error();
lastError = m_socket->LastError();
}
if (error) {
OnReceiveError(lastError, addr);
} else if (length < 2) {
...
} else {
AddDebugLogLineM(false, logMuleUDP, (m_name + wxT(": Packet received ("))
<< addr.IPAddress() << wxT(":") << addr.Service() << wxT("): ")
<< length << wxT("b"));
OnPacketReceived(addr, (byte*)buffer, length);
}
}
A quick & dirty
void CClientUDPSocket::OnPacketReceived(const wxIPV4address& addr, byte* buffer, size_t length)
{
wxCHECK_RET(length >= 2, wxT("Invalid packet."));
uint8 protocol = buffer[0];
uint8 opcode = buffer[1];
uint32 ip = StringIPtoUint32(addr.IPAddress());
if (ip == 0) return; // WORKAROUND VISTA CRASH
uint16 port = addr.Service();
seems to fix it, it hasn't crashed since.