lwIP - A Lightweight TCP/IP stack - Bugs: bug #23240, recv_udp increases counters for...
You are not allowed to post comments on this tracker with your current authentication level.
bug #23240: recv_udp increases counters for available receives before netbuf is actually posted
Submitter: | Steinar Lieng Fredriksen <steinarlf> | ||
Submitted: | Tue 13 May 2008 10:51:07 AM UTC | ||
Category: | UDP | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | 1.3.0 |
Jump to the original submission
Mon 06 Jul 2009 03:57:22 PM UTC, comment #16: |
Simon Goldschmidt <goldsimon> |
Mon 06 Jul 2009 02:28:32 PM UTC, comment #15: I thought about that and decided that as the user was probably expecting an unsigned value, it was better to cast it to unsigned.
|
Kieran Mansley <kieranm> |
Mon 06 Jul 2009 09:53:28 AM UTC, comment #14: I guess the patch looks quite good except for the usage of conn->recv_avail in lwip_ioctl() case FIONREAD: it is casted to u16_t, which should be converted to s16_t, too.
|
Simon Goldschmidt <goldsimon> |
Fri 26 Jun 2009 02:44:41 PM UTC, comment #13: I've attached a patch which I think might address this in the short term, using Jifl's suggestion of making the variables signed and adjusting the tests of those variables to consider anything < 0 as equivalent to zero. It also moves the SYS_ARCH_INC and API_EVENT calls to only occur if the sys_mbox_trypost() call is successful. I have done this for the recv_udp, recv_tcp, recv_raw and accept_function functions in api_msg.c as they all seemed to have the same bit of code.
|
Kieran Mansley <kieranm> |
Thu 25 Jun 2009 09:59:42 AM UTC, comment #12: This is now the last bug that needs fixing before 1.3.1, so I would welcome any opinions as soon as possible! |
Kieran Mansley <kieranm> |
Wed 24 Jun 2009 03:24:09 PM UTC, comment #11: comment #10 second paragraph should read:
|
Kieran Mansley <kieranm> |
Wed 24 Jun 2009 03:16:11 PM UTC, comment #10: I've been looking at this and don't really like any of the proposed solutions.
|
Kieran Mansley <kieranm> |
Mon 11 May 2009 08:00:57 AM UTC, comment #9: hi, all.
|
Daphne <likafann> |
Tue 21 Apr 2009 08:18:03 PM UTC, comment #8: Jonathan, I do think converting the counters to signed would work. However, after working with lwIP for over 3 years now, I still don't like the fact that we need three (!) counters here (recvmbox will have a counter, recv_avail and API_EVENT).
|
Simon Goldschmidt <goldsimon> |
Mon 30 Mar 2009 12:15:16 PM UTC, comment #7: A reminder: bug #25821, which was just closed as a duplicate of this bug, addressed the same issue but in recv_tcp instead of recv_udp. |
Wim Dumon <wdumon> |
Mon 30 Mar 2009 11:55:27 AM UTC, comment #6: I'd really like to see some progress on this bug before the next release. Any chance one of the developers could take a look at it? Jifl - you seem to have given this most thought so far. |
Kieran Mansley <kieranm> |
Mon 09 Jun 2008 12:47:52 PM UTC, comment #5: I haven't had a chance to test this any further yet, will hand in my thesis tomorrow.
|
Steinar Lieng Fredriksen <steinarlf> |
Mon 02 Jun 2008 11:50:41 AM UTC, comment #4: Not sure about that. This would have to also cover access to sock->rcvevent. Although I haven't thought through in detail it seems to me there's a risk of deadlock (semaphores not being like recursive mutexes).
|
Jonathan Larmour <jifl> |
Sat 31 May 2008 05:21:06 PM UTC, comment #3: I guess what we want to achieve is consistency between the count and the mailbox, so isn't it better to use a semaphore to ensure that either all or none of the operations are carried out?
|
Steinar Lieng Fredriksen <steinarlf> |
Fri 30 May 2008 01:53:26 PM UTC, comment #2: I looked at it, but not closely enough to be sure about whether it's safe to change the order of the trypost, recv_avail increment, and event callback. Certainly I believe the counters are not the crucial bit in the code affected - the API_EVENT call is.
|
Jonathan Larmour <jifl> |
Fri 30 May 2008 12:01:41 PM UTC, comment #1: Does anyone have any thoughts on the suggested fix here. It sounds OK to me but I've not looked in detail at what this counter is used for. |
Kieran Mansley <kieranm> |
Tue 13 May 2008 10:51:07 AM UTC, original submission:
If the trypost fails the counters are not decreased, leading to potential errors later. I had lwip_recvfrom block even though it was set to nonblocking mode.
|
Steinar Lieng Fredriksen <steinarlf> |
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 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2009-07-27 | kieranm | Status | None | Fixed | |
Open/Closed | Open | Closed | |||
2009-06-26 | kieranm | Attached File | - | Added bug23240, #18330 | |
2008-05-30 | kieranm | Planned Release | 1.3.1 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Seems like a good thing to do, yes.