buglwIP - A Lightweight TCP/IP stack - Bugs: bug #59974, pbuf_alloc failed

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59974: pbuf_alloc failed

Submitter:  mike <hk517j>
Submitted:  Sat 30 Jan 2021 08:40:48 AM UTC
   
 
Category:  pbufs Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  2.2.0
lwIP version:  2.1.0

Sat 30 Jan 2021 09:07:24 PM UTC, comment #1: 

Fixed as suggested, thanks for reporting!

Simon Goldschmidt <goldsimon>
Group administrator
Sat 30 Jan 2021 08:40:48 AM UTC, original submission:  

Hi,I am Mike,an embedded software engineer. Here is the problem I faced:
Ping the MCU board which runs LWIP 2.1.0 with ping 192.168.0.30 -l 65500 on computer windows 10. and 65500 is the maximal bytes that windows 10 can ping. But the result is failed.
I know that you tried to fix bug #50040 before, which just to check the overflow and if the size is too large, pbuf_alloc would return NULL. but that would cause a bug: ping 65500 bytes would fail. I think LWIP should support ping 65500 bytes because windows 10 can ping maximal 65500 bytes and some international tech standards force embedded system to support UDP packet which is maximal 64KB.
I have read bug #50040 you fixed before, maybe it was not solved completely. My MCU board have a extern ram which has more than 1 MB ram, and lwip uses the ram, heap is on the exteran ram. The mcu board has sufficient ram to malloc.
so I modified the code line 274 in pbuf.c, change u16_t to mem_size_t, then ping 65500 bytes successfully. here is the code:

    case PBUF_RAM: {
//      u16_t payload_len = (u16_t)(LWIP_MEM_ALIGN_SIZE(offset) + LWIP_MEM_ALIGN_SIZE(length));
  mem_size_t payload_len = (mem_size_t)(LWIP_MEM_ALIGN_SIZE(offset) + LWIP_MEM_ALIGN_SIZE(length));


Hope to hear back on your opinion.

mike <hk517j>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by hk517j (Submitted the item)
  •  

    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
    2021-01-30 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.2.0

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code