[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] 5 bytes missing from starts of input buffer
> I have a strange problem where every so often my server socket input
> buffer does not contain the first 5 bytes as expected.
> Strange! My first suggestion for debugging this would be to try to
> come up with a stripped-down minimal toy demo
I presume you've determined that your code is actually reading those 5
bytes somewhere. Have you got debug around all your read/recv calls?
It that's hard - perhaps because you're using 3rd-party libraries -
consider using ktrace/strace to confirm that the missing 5 bytes are
actually being consumed by a read()/recv() call.
Also, are you doing the reads yourself or are you using bufferevents?
A little more info about how your using libevent might be
useful. Threads?
A not uncommon bug I've seen is when an fd is copied by some code and
then used later. In the mean time some underlying set of events have
closed and opened the same fd - thus the "copy fd" code is now reading
an fd it shouldn't be. ktrace/strace might give you clues on this too.
Mark.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.