-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Open
Labels
area: Networkingarea: SocketsNetworking socketsNetworking socketsbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bug
Description
Describe the bug
The net sockets
command enters an infinite loop while printing sockets if too many have been opened. This seems to be caused by the way the socket object cores are reused:
zephyr/subsys/net/lib/sockets/socket_obj_core.c
Lines 69 to 71 in 47b07e5
k_obj_core_init_and_link(K_OBJ_CORE(sock), &sock_obj_type); | |
k_obj_core_stats_register(K_OBJ_CORE(sock), &sock->stats, | |
sizeof(struct sock_obj_type_raw_stats)); |
Here the obj core is linked unconditionally, I believe it should instead only be linked and registered if
sock->init_done
is false. I can open a PR if that's sufficient, just wanted to get feedback first as I'm not familiar with this part of the code.
Impact
Annoyance – Minor irritation; no significant impact on usability or functionality.
Metadata
Metadata
Labels
area: Networkingarea: SocketsNetworking socketsNetworking socketsbugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bug