zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.8k stars 6.58k forks source link

bug: dhcp: net_pkt_alloc_with_buffer() failure causes system workqueue freeze #77935

Closed jeffwelder-ellenbytech closed 1 month ago

jeffwelder-ellenbytech commented 2 months ago

Describe the bug DCHP is run in the context of system workqueue with a K_FOREVER for net_pkt_alloc_with_buffer(). If this never goes through/fails, we're stuck forever causing a system workqueue freeze.

DHCPv4 https://github.com/zephyrproject-rtos/zephyr/blob/ca48767be48ca6a7536edf7b1d59f3246046d40e/subsys/net/lib/dhcpv4/dhcpv4.c#L287C1-L288C30

DHCPv6 https://github.com/zephyrproject-rtos/zephyr/blob/ca48767be48ca6a7536edf7b1d59f3246046d40e/subsys/net/lib/dhcpv6/dhcpv6.c#L584C8-L584C33

To Reproduce Running on nRF53 with USB ECM enabled. MacOS Sonoma 14.6.1 (Important for DHCP to fail due to non-working ECM) With USB plugged in, dhcp starts, and freezes systemworkqueue.

Expected behavior net_pkt_alloc_with_buffer() should be used with a timeout and not freeze system workqueue.

Impact Frozen System Workqueue, application does not work

Logs and console output I have paused a debugger during this freeze to determine context.

Environment (please complete the following information): VScode Zephyr 3.7.0

Additional context Fundamentally I only see this because USB ECM does not work with MacOS. I generally run through Parallels with Ubuntu when I need to test that.

github-actions[bot] commented 2 months ago

Hi @jeffwelder-ellenbytech! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙