lwIP - A Lightweight TCP/IP stack - Patches: patch #3796, api_lib.c: patch for...
You are not allowed to post comments on this tracker with your current authentication level.
patch #3796: api_lib.c: patch for netconn_write(), fixes a possible race condition
Submitter: | None | ||
Submitted: | Mon 07 Mar 2005 09:20:14 AM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | In Progress | Privacy: | Public |
Assigned to: | fbernon | Originator Email: | -email is unavailable- |
Open/Closed: | Closed | Planned Release: | None |
Jump to the original submission
Wed 11 Apr 2007 11:54:05 PM UTC, comment #14: |
Frédéric Bernon <fbernon> |
Wed 11 Apr 2007 11:40:24 PM UTC, comment #13: Would SYS_ARCH_PROTECT be a straightforward (albeit ugly) way to avoid the race here? tcp_sndbuf() is straightforward read of pcb->snd_buf, which is only assigned to in three places.
|
Jonathan Larmour <jifl> |
Mon 26 Mar 2007 06:51:56 PM UTC, comment #12: Closed, but I think we will add a new "redesign api_lib\api_msg" in few times... |
Frédéric Bernon <fbernon> |
Mon 26 Mar 2007 04:40:26 PM UTC, comment #11: I think the patch solves the problem and this bug can be closed. Tha problem that "size" overflows is fixed, and the rest of the code seems OK to me (as long as tcp_sndbuf() yields to an atomic instruction). |
Simon Goldschmidt <goldsimon> |
Mon 26 Mar 2007 03:39:20 PM UTC, comment #10: Ok, Dmitry's patch is integrate. Not a final solution, but a good workaround for the moment...
|
Frédéric Bernon <fbernon> |
Mon 26 Mar 2007 01:11:34 PM UTC, comment #9: Ok, so, in a first time, I just integrate it in CVS like that...
|
Frédéric Bernon <fbernon> |
Mon 26 Mar 2007 11:00:43 AM UTC, comment #8: I'd rather wait for a more complete solution, as with this patch it might be "good enough" that no one gets round to a more complete solution, but without this we might be motivated to do it properly.
|
Kieran Mansley <kieranm> |
Mon 26 Mar 2007 10:29:44 AM UTC, comment #7: Kieran,
|
Frédéric Bernon <fbernon> |
Thu 08 Mar 2007 02:47:08 PM UTC, comment #6: The current code of netconn_write certainly has a bug. Of course, the real solution would be to move some part of netconn_write to TCP/IP thread, but it is not easy and requires a lot of changes.
|
Dmitry Potapov <dpotapov> |
Thu 08 Mar 2007 11:36:23 AM UTC, comment #5: Funny, I did not read this patch before, but last weekend I was worried about exactly that bit of code, accessing the pdb->snd_buf from the user thread.
|
Simon Goldschmidt <goldsimon> |
Mon 19 Feb 2007 11:19:52 AM UTC, comment #4: I'm dubious about this for three reasons:
|
Kieran Mansley <kieranm> |
Mon 19 Feb 2007 10:45:32 AM UTC, comment #3: This problem is still there, I think. I did have look at netconn_write() previously to see if it can be improved by redesign instead of patching, but I don't have the time for that. So maybe you can have a look at this patch while sweeping the others.
|
Christiaan Simons <christiaans> |
Mon 19 Feb 2007 10:30:16 AM UTC, comment #2: Can anyone give an update on this. Is it still a problem? Did it get fixed?
|
Kieran Mansley <kieranm> |
Wed 15 Feb 2006 08:23:03 AM UTC, comment #1: I'm investigating netconn_write(), I'm also getting garbage when using the sequential API. I think netconn_write() also has a very poor performance because of the frequent thread ipc/synchronisation. Maybe some code must be moved to the tcpip thread (src/api/tcpip.c) instead of applying this patch. |
Christiaan Simons <christiaans> |
Mon 07 Mar 2005 09:20:14 AM UTC, original submission:
This patch is for lwIP-1.1.0.
|
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 10 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-03-26 | fbernon | Open/Closed | Open | Closed | |
2007-03-26 | fbernon | Status | None | In Progress | |
Assigned to | None | fbernon | |||
2007-03-08 | dpotapov | Attached File | - | Added netconn_write-2.patch, #12149 | |
2007-02-19 | christiaans | Assigned to | christiaans | None | |
2007-02-19 | kieranm | Assigned to | None | christiaans | |
2006-05-02 | christiaans | Assigned to | christiaans | None | |
2006-02-15 | christiaans | Assigned to | None | christiaans | |
2005-03-07 | None | Attached File | - | Added netconn_write.patch, #4302 | |
Carbon-Copy | - | Added dennis_k --AT-- freenet --PUNKT-- de |
Powered by Savane 3.13-3230.
Corresponding source code
I think the best thing to do to fix this kind of problem is to move most of the write process in tcpip_thread (in api_msg). I have submit a patch for lwip_sendto like this for bug #19162 (I have to test it when I will come to the office).
It will give a something more safe-thread (by example, if two application threads want to write datas on the same socket).
To my point of view, SYS_ARCH_PROTECT should only have to be used in pbuf, & memp functions...