This crash is interesting. The context gets corrupted again, this time to the weird value of 0x45445f454352554f. Google says nothing for this value.
Really really weird and fishy, this couldn't if the code is compiled correctly. I guess the event overflow is just another instance of the bug, the context is corrupted in such a way that glib gets in an infinite loop sending events. As you noted all sockets receive the same number of events.
I'd forget for now about blaming wxEventHandling (though theoretically it could be starved in the manner I described) .
(gdb) bt full
#0 __pthread_mutex_lock (mutex=0x45445f4543525557) at pthread_mutex_lock.c:50
__PRETTY_FUNCTION__ = "__pthread_mutex_lock"
type = <value optimized out>
#1 0x00007ffff29ceec0 in g_source_set_callback_indirect (source=0x7fffdc2b4160, callback_data=0x7fffdc0ce920,
callback_funcs=0x7ffff2c70610) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:1149
context = 0x45445f454352554f
old_cb_data = <value optimized out>
old_cb_funcs = <value optimized out>
__PRETTY_FUNCTION__ = "g_source_set_callback_indirect"
#2 0x00007ffff29c77ac in g_io_add_watch_full (channel=<value optimized out>, priority=0, condition=<value optimized out>,
func=0x7ffff478e950 <gdk_io_invoke>, user_data=0x7fffdc062e20, notify=0x7ffff478e930 <gdk_io_destroy>)
at /build/buildd/glib2.0-2.26.1/glib/giochannel.c:668
source = 0x7fffdc2b4160
id = <value optimized out>
__PRETTY_FUNCTION__ = "g_io_add_watch_full"
#3 0x00007ffff478e8e6 in IA__gdk_input_add_full (source=<value optimized out>, condition=0, function=<value optimized out>,
data=0x25f9940, destroy=0) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1129
result = <value optimized out>
channel = 0x7fffdc2b40e0
cond = 12
#4 0x00007ffff67fcbb1 in GSocketGUIFunctionsTableConcrete::Install_Callback (this=0x7ffff6ccabd0, socket=0x25f9940, event=GSOCK_OUTPUT)
at ./src/gtk/gsockgtk.cpp:98
m_id = 0x23773b0
c = 1
#5 0x00007ffff63c379d in GSocket::Enable (this=0x25f9940, event=GSOCK_OUTPUT) at ./src/unix/gsocket.cpp:1521
No locales.
#6 0x00007ffff63c2f1f in GSocket::Write (this=0x25f9940, buffer=0x7fffe41e9840 "\3176\246", size=6) at ./src/unix/gsocket.cpp:1257
ret = -1
__PRETTY_FUNCTION__ = "int GSocket::Write(const char*, int)"
#7 0x00007ffff63bcfa5 in wxSocketBase::_Write (this=0x1da8d40, buffer=0x7fffe41e9840, nbytes=6) at ./src/common/socket.cpp:539
total = 0
ret = -1
#8 0x00007ffff63bcedd in wxSocketBase::Write (this=0x1da8d40, buffer=0x7fffe41e9840, nbytes=6) at ./src/common/socket.cpp:507
No locales.
#9 0x0000000000681b8e in CSocketClientProxy::Write (this=0x1da8d40, buffer=0x7fffe41e9840, nbytes=6) at Proxy.cpp:1310
lock = {m_isOk = true, m_mutex = @0x1da8e88}
#10 0x00000000004e3bf8 in CEncryptedStreamSocket::Write (this=0x1da8d40, lpBuf=0x7fffe41e9840, nBufLen=6) at EncryptedStreamSocket.cpp:210
__FUNCTION__ = "Write"
#11 0x00000000004e0ad2 in CEMSocket::Send (this=0x1da8d40, maxNumberOfBytesToSend=<value optimized out>,
minFragSize=<value optimized out>, onlyAllowedToSendControlPacket=<value optimized out>) at EMSocket.cpp:611
tosend = 6
result = <value optimized out>
bWasLongTimeSinceSend = false
sentControlPacketBytesThisCall = 0
__FUNCTION__ = "Send"
lock = {m_isOk = true, m_mutex = @0x1da9200}
anErrorHasOccured = false
sentStandardPacketBytesThisCall = 0
#12 0x000000000049959f in CEMSocket::SendFileAndControlData (this=0x45445f4543525557, maxNumberOfBytesToSend=3691833632, minFragSize=1)
at EMSocket.h:71
No locales.
#13 0x000000000048dd5b in CClientTCPSocket::SendFileAndControlData (this=0x45445f4543525557, maxNumberOfBytesToSend=3691833632,
overchargeMaxBytesToSend=1) at ClientTCPSocket.cpp:2138
returnStatus = {success = true, sentBytesStandardPackets = 0, sentBytesControlPackets = 18}
#14 0x000000000057481d in UploadBandwidthThrottler::Entry (this=<value optimized out>) at UploadBandwidthThrottler.cpp:480
socketSentBytes = {success = true, sentBytesStandardPackets = 0, sentBytesControlPackets = 0}
data = 69633
socket = 0x45445f4543525557
slotCounter = 18
slots = <value optimized out>
spentBytes = 0
spentOverhead = <value optimized out>
sendLock = {m_isOk = true, m_mutex = @0x18d6820}
timeSinceLastLoop = <value optimized out>
minFragSize = 1300
doubleSendSize = 2600
sleepTime = <value optimized out>
thisLoopTick = 2600814829
bytesToSpend = <value optimized out>
extraSleepTime = 1000
step = 45
lastLoopTick = 0
allowedDataRate = <value optimized out>
rememberedSlotCounter = 15
sendLock = {m_isOk = 200, m_mutex = @0x7ffff7fcca48}
#15 0x00007ffff60dc705 in wxThreadInternal::PthreadStart (thread=0x18d6800) at ./src/unix/threadpsx.cpp:766
__clframe = {__cancel_routine = 0x7ffff60dc84f <wxPthreadCleanup(void*)>, __cancel_arg = 0x18d6800, __do_it = 1, __cancel_type = 0}
pthread = 0x16a6320
rc = 0
dontRunAtAll = false
__FUNCTION__ = "PthreadStart"
#16 0x00007ffff60dc5a5 in wxPthreadStart (ptr=0x18d6800) at ./src/unix/threadpsx.cpp:718
No locales.
#17 0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
__res = <value optimized out>
pd = 0x7fffec6bf700
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737159886592, -7788523305851881642, 140737488345856, 140737159887296,
140737354125376, 3, 7788486849677817686, 7788540326228588374}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0},
data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <value optimized out>
robust = <value optimized out>
freesize = <value optimized out>
__PRETTY_FUNCTION__ = "start_thread"
#18 0x00007ffff532192d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locales.
#19 0x0000000000000000 in ?? ()
No symbol table info available.