lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #65786] tcpip_init fails LWIP_ASSERT_CORE_LOCKED asser


From: Matthias Dietrich
Subject: [lwip-devel] [bug #65786] tcpip_init fails LWIP_ASSERT_CORE_LOCKED assertion
Date: Fri, 31 May 2024 13:45:06 -0400 (EDT)

Follow-up Comment #4, bug #65786 (group lwip):

I think there is a reason for calling lwip_init() first. lwip_init() also
calls sys_init() and before that, you have no guarantee that the sys_*
functions can be called at all. So calling  sys_mutex_new() before lwip_init()
only works for ports which don't do much in sys_init(). If the system's mutex
creation requires any special initialization in sys_init(), it won't work.

You mentioned that your failure scenario can be prevented by using the
callback function to rendezvous with the TCP/IP thread. Note that this is
exactly what is being done in the example_app (contrib). So I would say it's a
pretty common pattern.

Finally, in a multithreaded environment, it might be wiser to call
netifapi_netif_add() instead of the "raw" netif_add() by enabling
LWIP_NETIF_API. It won't clear all the possible concurrent access scenarios,
but at least the netif-related functions should be handled safely.


    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?65786>

_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]