lwIP - A Lightweight TCP/IP stack - Bugs: bug #44032, LWIP_NETCONN_FULLDUPLEX: select...
You are not allowed to post comments on this tracker with your current authentication level.
bug #44032: LWIP_NETCONN_FULLDUPLEX: select might work on invalid/reused socket
Submitter: | Simon Goldschmidt <goldsimon> | ||
Submitted: | Sat 17 Jan 2015 08:18:08 PM UTC | ||
Category: | sockets/netconn | Severity: | 2 - Minor |
Item Group: | Feature Request | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | git head |
Jump to the original submission
Fri 24 Feb 2017 08:39:03 PM UTC, comment #8: |
Simon Goldschmidt <goldsimon> |
Thu 16 Feb 2017 09:00:44 PM UTC, comment #7: Working on a reused socket can also happen on close-while-write/read (for LWIP_NETCONN_FULLDUPLEX), so we might need a more generic approach to this:
|
Simon Goldschmidt <goldsimon> |
Thu 09 Feb 2017 07:41:59 PM UTC, comment #6: Fixed by not allowing to reallocate a socket that has "select_waiting != 0". |
Simon Goldschmidt <goldsimon> |
Mon 23 Mar 2015 07:40:48 PM UTC, comment #5: Thanks for the explanation Simon. I'm not opposed to having select() return EBADF or something similar when an FD gets closed. Just want to make sure we are adhering to the POSIX FD behaviors :)
|
Joel Cunningham <jcunningham> |
Tue 17 Mar 2015 07:27:36 PM UTC, comment #4: Joel, I understand what you mean. However, this bug is not about improving anything in the "FDs are an array index" thing. It is about not breaking this just because someone happens to call close() on a socket where select() is running. I don't think this should cause problems. |
Simon Goldschmidt <goldsimon> |
Mon 16 Mar 2015 09:50:24 PM UTC, comment #3: Maybe I missed the mailing list discussion of LWIP_NETCONN_FULLDUPLEX, but is that allowing multiple threads to operate on the same socket?
|
Joel Cunningham <jcunningham> |
Mon 16 Mar 2015 09:26:29 PM UTC, comment #2: Well, this bug report is for the new very experimental code supporting full duplex sockets only. But in that context, it is valid.
|
Simon Goldschmidt <goldsimon> |
Mon 16 Mar 2015 09:03:27 PM UTC, comment #1: The use case of a blocking on a socket in select() while another thread issues a close() on that socket seems to violate LwIP's multi-threading requirements (a socket can only be used by a single thread)
|
Joel Cunningham <jcunningham> |
Sat 17 Jan 2015 08:18:08 PM UTC, original submission:
When a socket gets closed and reused from another thread while select is waiting on it, 'select_waiting--' can be executed on this socket although it's not the socket where 'select_waiting++' was executed before (this mainly depends on the priorities of the threads using sockets).
|
Simon Goldschmidt <goldsimon> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 10 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-02-24 | goldsimon | Item Group | None | Feature Request | |
Status | None | Fixed | |||
Open/Closed | Open | Closed | |||
2017-02-16 | goldsimon | Status | Fixed | None | |
Open/Closed | Closed | Open | |||
2017-02-09 | goldsimon | Status | None | Fixed | |
Assigned to | None | goldsimon | |||
Open/Closed | Open | Closed | |||
2015-03-16 | goldsimon | Summary | select might work on invalid/reused socket | LWIP_NETCONN_FULLDUPLEX: select might work on invalid/reused socket | |
2015-03-04 | goldsimon | Severity | 3 - Normal | 2 - Minor |
Powered by Savane 3.13-3230.
Corresponding source code
Fixed in these 4 commits:
http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=a38e937dd6a32952cc016ae621368d5e85729cc9
http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=f4d13d52d3ea074d5c173a305aace29aacf37e6c
http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=8bb43e7388e300aaa74bc9f061f7f79cb295523f
http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=6786c9f14382535cd27a6944167ab88b31ff3e92
by adding sock->fd_used to indicate a thread holds a reference on a socket (and freeing is delayed until all threads are done with a socket).