RT-Thread / RT-Thread/rt-thread
[Bug] rt_kprintf_threadsafe在多核情况下会修改msh shell中设置的console_dev->flag
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
V5.2.0
Hardware Type/Architectures
RISCV
Develop Toolchain
Other
Describe the bug
多核SMP的情况下,使用package rt_kprintf_threadsafe中的的rt_kprintf打印,msh shell会通过finsh_set_device设置open_flag中的RT_DEVICE_FLAG_INT_RX属性,如果这个过程跟另外一个核上跑rt_kprintf正好撞在一起,rt_kprintf会把finsh_set_device中设置的属性改掉,导致shell无法输入。
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the rt_kprintf_threadsafe and finsh_set_device entry points, then reproduce the race on a multi-core SMP RISC-V setup while msh is active. Check how RT_DEVICE_FLAG_INT_RX changes during concurrent printing and verify that shell input remains usable after the fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100