lwIP - A Lightweight TCP/IP stack - Bugs: bug #28064, pbuf_alloc(PBUF_POOL) is not...
You are not allowed to post comments on this tracker with your current authentication level.
bug #28064: pbuf_alloc(PBUF_POOL) is not thread-safe
Submitter: | Simon Goldschmidt <goldsimon> | ||
Submitted: | Fri 20 Nov 2009 05:51:30 PM UTC | ||
Category: | pbufs | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Fixed |
Privacy: | Public | Assigned to: | goldsimon |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | 1.3.1 |
Jump to the original submission
Fri 22 Jul 2011 07:22:42 PM UTC, comment #9: |
Simon Goldschmidt <goldsimon> |
Wed 19 May 2010 06:51:57 PM UTC, comment #8: Forget that last comment: for NO_SYS==0, tcpip_callback is used to free ooseq pbufs, for NO_SYS==1 the pbuf-freeing code is disabled, so there's no bug left, only the negative impact of running out of pbufs.
|
Simon Goldschmidt <goldsimon> |
Tue 18 May 2010 04:12:28 PM UTC, comment #7: OK, I didn't think of calling pbuf_alloc() from interrupt context with NO_SYS==1.
|
Simon Goldschmidt <goldsimon> |
Tue 18 May 2010 01:32:12 PM UTC, comment #6: Adding target of 1.4.1 for remaining work with NO_SYS=1
|
Kieran Mansley <kieranm> |
Sun 29 Nov 2009 12:00:12 PM UTC, comment #5: Fixed for NO_SYS=0 by using tcpip_callback to free ooseq pbufs from tcpip_thread. |
Simon Goldschmidt <goldsimon> |
Fri 27 Nov 2009 02:50:29 PM UTC, comment #4: I think that's a good approach for the short term and we can leave this bug open to come up with something better, if necessary, for 1.4.0 |
Kieran Mansley <kieranm> |
Fri 27 Nov 2009 06:24:53 AM UTC, comment #3: The code in question has been added on jan 28th, 2009 after a discussion on lwip-users (without a bugtracker entry): Jonathan came up with a calculation of how long it takes to free ooseq pbufs.
|
Simon Goldschmidt <goldsimon> |
Thu 26 Nov 2009 04:59:12 PM UTC, comment #2: Updated summary and status:
|
Simon Goldschmidt <goldsimon> |
Sun 22 Nov 2009 03:51:29 PM UTC, comment #1: I think the simplest solution to solve this is to create macros (LWIP_ISR_ENTER(), LWIP_ISR_LEAVE()) that increase a counter and let pbuf_alloc check that counter. Then, these macros would have to be called from ISRs wanting to use lwIP.
|
Simon Goldschmidt <goldsimon> |
Fri 20 Nov 2009 05:51:30 PM UTC, original submission:
Since 1.3.1 (pbuf.c 1.131: reclaim pbufs from TCP out-of-sequence segments if we run out of pool pbufs), pbuf_alloc tries to free ooseq-queued-pbufs.
|
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 |
---|---|---|---|---|---|
2011-07-22 | goldsimon | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2010-05-18 | kieranm | Status | Fixed | In Progress | |
2010-05-18 | kieranm | Planned Release | 1.4.1 | ||
2009-11-29 | goldsimon | Status | In Progress | Fixed | |
Severity | 5 - Blocker | 3 - Normal | |||
2009-11-26 | goldsimon | Status | None | In Progress | |
Severity | 3 - Normal | 5 - Blocker | |||
Assigned to | None | goldsimon | |||
Summary | pbuf_alloc(PBUF_POOL) cannot be used from ISR any more | pbuf_alloc(PBUF_POOL) is not thread-safe |
Powered by Savane 3.13-3230.
Corresponding source code
Fixed for NO_SYS==1, too, by calling PBUF_CHECK_FREE_OOSEQ() from sys_check_timeouts(). If you don't use that function, just make sure you call PBUF_CHECK_FREE_OOSEQ() from your main loop (often enough).