lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Sockets: select_waiting overflow


From: Stian Skjelstad
Subject: Re: [lwip-devel] Sockets: select_waiting overflow
Date: Mon, 3 Jul 2017 20:42:15 +0200

On Mon, Jul 3, 2017 at 6:07 PM, Joan Lledó <address@hidden> wrote:
Hello,

I'm having an overflow in my select_waiting due to a bug, and the
assertion "sock->select_waiting > 0" is failing and aborting the
stack.

Reading lwip_select() source code, the assertion is in place to make sure that only one thread is playing with a given socket at any given time. From a POSIX point of view I think it is legal and some applications might even have read and write being handled from two different threads and hence call select() at the same time with the same FD set in both, but that partly removes the point of using select() in the first point a bit for the most common ways to design applications, which is to have read/write for a given client to be handled by the same thread.

 What is your application design since you happen to hit this assertion? Are you not properly keeping track of your file descriptors and sometimes ends up with the a "zombie" file descriptor in an another thread, or some kind of memory-corruptions?

--
Stian Skjelstad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]