lwIP - A Lightweight TCP/IP stack - Bugs: bug #16830, err_tcp() posts to connection...
You are not allowed to post comments on this tracker with your current authentication level.
bug #16830: err_tcp() posts to connection mailbox when no pend on the mailbox is active
Submitter: | None | ||
Submitted: | Mon 12 Jun 2006 12:33:28 PM UTC | ||
Category: | sockets/netconn | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | fbernon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Thu 05 Apr 2007 02:10:37 PM UTC, comment #13: |
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 02:05:03 PM UTC, comment #12: That looks fine to me, although if you can fix up the indent before you checkin that would be nice.
|
Jonathan Larmour <jifl> |
Thu 05 Apr 2007 01:57:27 PM UTC, comment #11: New patch file with filter on do_send, do_write, do_join_leave_group (not on do_recv).
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 01:29:24 PM UTC, comment #10: The "if (msg_copy.conn->err != ERR_OK) {" in api_msg_input is not a so good idea, because even with an error on "conn->err", you have to execute do_disconnect, do_close & do_delconn. We can move the check at the beginning of do_listen, do_send, do_recv, do_write & do_join_leave_group...
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 12:53:14 PM UTC, comment #9: Ok, if no other comments, I will commit tonight...
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 12:43:51 PM UTC, comment #8: Yes I think that sounds like a good idea. Thanks. |
Jonathan Larmour <jifl> |
Thu 05 Apr 2007 12:26:34 PM UTC, comment #7:
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 11:10:53 AM UTC, comment #6: Hmm, yes I guess the problem isn't what I thought it was. The thread won't get stuck, but it means that a packet may arrive and be processed by the tcpip thread, but then after that, the tcpip thread will get the message from the program thread anyway to, for example, send data, which it will then try and do even though an error had been indicated for this connection.
|
Jonathan Larmour <jifl> |
Thu 05 Apr 2007 10:46:00 AM UTC, comment #5: Not sure you're right: if I'm agree with you that an error may be indicated at any time, this is only in during a TCP connect we have to "wake up" a pending "netconn_connect".
|
Frédéric Bernon <fbernon> |
Thu 05 Apr 2007 10:20:45 AM UTC, comment #4: I don't think this patch is right I'm afraid. An error may be indicated at any time, not just during connection. And given that, if the connection is already made, a thread will remain stuck waiting for a response from its api_msg_post call (which waits on the connection mbox) when an error happens.
|
Jonathan Larmour <jifl> |
Wed 04 Apr 2007 06:56:37 PM UTC, comment #3: I propose another patch for these two problems. NETCONN_CONNECT is set only in tcpip_thread context (inside api_msg.c). The idea is the same than the first patch, but only in api_msg.c (avoid the problem with the first patch if a RST appears during time between a successful do_connect and the api_lib "conn->state = NETCONN_NONE;").
|
Frédéric Bernon <fbernon> |
Mon 26 Feb 2007 02:07:20 PM UTC, comment #2: I can confirm the problem exists. I can't offer a simple fix - I think a more radical overhaul would be needed given the requirements for thread safety, and probably involving something protected with the SYS_ARCH_PROTECT stuff.
|
Jonathan Larmour <jifl> |
Mon 26 Feb 2007 01:03:13 PM UTC, comment #1: I think this needs some investigation. Any volunteers to look into it and come up with a better method of error propogation if the problem is as reported? |
Kieran Mansley <kieranm> |
Mon 12 Jun 2006 12:33:28 PM UTC, original submission:
When a TCP error occurs and err_tcp() is called, the function posts a null message to the connection's mailbox. Since the mailbox is used for synchronization of connection messages to the TCP thread, posting to it is only valid when a connection function is pending on the result. It appears that this only occurs when the connection is attempting to connect via a call to netconn_connect(). In all other instances, the connection's mailbox will receive a message from the TCP thread.
|
Anonymous |
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 8 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-04-05 | fbernon | Status | None | Fixed | |
Open/Closed | Open | Closed | |||
2007-04-05 | fbernon | Attached File | - | Added err_tcp.patch, #12405 | |
2007-04-04 | fbernon | Attached File | - | Added err_tcp.patch, #12401 | |
2007-03-29 | fbernon | Assigned to | None | fbernon | |
2007-02-26 | jifl | Attached File | - | Added lwip.netconndelete.free.mbox.patch, #12041 | |
2006-11-25 | christiaans | Category | TCP | sockets/netconn | |
2006-06-12 | None | Attached File | - | Added err_tcp_patch.txt, #10178 |
Powered by Savane 3.13-758e.
Corresponding source code
Yes, in fact, it's done, but if I don't disable whitespace option, diff produce lot of lines and the patch file is not so clear.
Ok, I will commit later...