buglwIP - A Lightweight TCP/IP stack - Bugs: bug #64909, No memory pool MEMP_SYS_TIMEOUT...

 
 

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

bug #64909: No memory pool MEMP_SYS_TIMEOUT allocation for SNTP timer

Submitter:  Richard Lang <richardlang>
Submitted:  Sun 19 Nov 2023 08:53:41 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Crash Error Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  2.1.3

Thu 11 Apr 2024 02:22:23 PM UTC, comment #1: 

Same issue also in git head version
I have also another issue
https://savannah.nongnu.org/bugs/?65582

In my opinion we need to do every time
sys_untimeout(sntp_request, NULL);
sys_untimeout(sntp_try_next_server, NULL);
before calling sys_timeout

Michele

Michele Da Rold <micheledarold>
Sun 19 Nov 2023 08:53:41 PM UTC, original submission:  

Configured LWIP with pretty much default options apart from TCP/IP and sockets API disabled (UDP enabled, no DNS, DHCP etc).  Under these circumstances the LWIP_NUM_SYS_TIMEOUT_INTERNAL declaration in "./src/include/lwip/opt.h" evaluates to 2.

On trying to initialise the SNTP module with sntp_init() call, the sys_timeout() call within sntp_send_request() fails to find an available memory pool entry in MEMP_SYS_TIMEOUT pool and returns a NULL pointer, triggering the subsequent LWIP_ASSERT() statement.

looking at "opt.h"

  #define LWIP_NUM_SYS_TIMEOUT_INTERNAL   (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))

there doesn't seem to be any allowance for the SNTP timer.  SNTP support is conditionally included based on LWIP_UDP so I'd expect the above declaration should be

  #define LWIP_NUM_SYS_TIMEOUT_INTERNAL   (LWIP_TCP + LWIP_UDP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))




Encountered on 2.1.3 branch, but examination of declaration in master looks to me as though problem still exists.

Richard Lang <richardlang>

 

(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 micheledarold (Posted a comment)
  • -email is unavailable- added by richardlang (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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code