netutils/mdns: raise responder stack size default to 8KiB#3630
Conversation
|
@ricardgb, please sign your commit message with |
d4716e0 to
d024b03
Compare
linguini1
left a comment
There was a problem hiding this comment.
Please use the Assisted-by: field from the contribution guide. Also, please attach your test logs from your testing on the Pico.
CONFIG_NETUTILS_MDNS_STACKSIZE defaulted to DEFAULT_TASK_STACKSIZE, which resolves to as little as 2KiB on some targets. The bundled mjansson responder uses a deeper stack than that (DNS record parsing with name decompression, plus the send/receive buffers) and overflows on startup, taking the board down with a hardfault before it answers a single query. Default to 8KiB, the value that reliably runs the responder, and correct the help text, which previously claimed a 4KiB default that did not match DEFAULT_TASK_STACKSIZE. Assisted-by: Claude (Anthropic Claude Code) Signed-off-by: Ricard Rosson <ricard@groundbits.com>
d024b03 to
693aeaa
Compare
|
@linguini1 commit trailer updated to |
|
@linguini1 here are on-hardware test logs from a Raspberry Pi Pico 2 W (RP2350), NuttX 13.0.0-RC0. The mDNS responder was built with Board — responder starts and answers a live query: Board — responder task running at the 8 KiB stack, no overflow ( (The responder task shows an ~8 KiB stack; other tasks are ~2 KiB.) Host — discovery / resolution / reachability: The responder runs, advertises, and answers queries at the 8 KiB stack without overflowing. Disclosure: these tests were run and captured with the help of an AI agent (Claude Code, Anthropic); results are from real hardware and human-reviewed. |
| attached that could send queries. | ||
| Stack size for the mDNS responder task. The bundled mjansson | ||
| responder uses a fairly deep stack (record parsing with name | ||
| decompression plus the send/receive buffers), so the previous |
There was a problem hiding this comment.
Do we really need a description of the problem in the help message? The option description should describe the options and that's it. Please look more closely at what Claude generates.
Summary
CONFIG_NETUTILS_MDNS_STACKSIZEdefaulted toDEFAULT_TASK_STACKSIZE,which resolves to as little as 2KiB on some targets. The bundled mjansson
mDNS responder needs a deeper stack than that — DNS record parsing with
name decompression, plus the send/receive buffers — so on those targets it
overflows its stack and hardfaults at startup, before it can answer a
single query.
This raises the default to 8KiB (the value that reliably runs the
responder) and corrects the help text, which previously claimed a "4KiB"
default that did not match
DEFAULT_TASK_STACKSIZE.Impact
with a small
DEFAULT_TASK_STACKSIZE.unaffected.
Testing
Reproduced and fixed on a Raspberry Pi Pico 2 W (RP2350, NuttX). With the
old default (2KiB on this target) the responder overflowed its stack and
hardfaulted at startup; with the new 8KiB default it runs and answers mDNS
queries normally (verified with
avahi-resolve/avahi-browsefrom a host).Here are on-hardware test logs from a Raspberry Pi Pico 2 W (RP2350), NuttX 13.0.0-RC0.
The mDNS responder was built with
CONFIG_NETUTILS_MDNS_STACKSIZE=8192— the value this PR makes the default — and run over a USB CDC-NCM link (boardeth0192.168.7.1 ⇆ Linux hostusb0192.168.7.2).Board — responder starts and answers a live query:
Board — responder task running at the 8 KiB stack, no overflow (
ps):(The responder task shows an ~8 KiB stack; other tasks are ~2 KiB.)
Host — discovery / resolution / reachability:
The responder runs, advertises, and answers queries at the 8 KiB stack without overflowing.
Disclosure: this change was prepared by an AI agent (Claude Code) at the
direction of the author (@ricardgb), who reviewed it before submission.
🤖 Generated with Claude Code