RT-Thread / RT-Thread/rt-thread

[ipc] mutex take 被 signal 中断后没有正确返回错误

Open
#7,908 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

问题

mtuex 在 suspend 之前没有重置 thread->error 导致被信号中断后没有正确得到反馈。

https://github.com/RT-Thread/rt-thread/blob/a6fcb4f8a13709e836b9133a08d573fc0dfd398a/src/ipc.c#L1246

参考 sem 的方式如下:

https://github.com/RT-Thread/rt-thread/blob/a6fcb4f8a13709e836b9133a08d573fc0dfd398a/src/ipc.c#L548-L554

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/ipc.c around line 1246 and compare the mutex path with the semaphore handling at lines 548-554. Verify how thread->error is handled when mutex acquisition is suspended and then interrupted by a signal; done means the mutex operation returns the correct error in that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.