Skip to content

Infinite loop in net sockets shell command #93587

@mwerschy

Description

@mwerschy

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:

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

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions