Skip to content

fix bugs about noteram about alignment, fix the tail of reader did not reset when flush.#13684

Merged
xiaoxiang781216 merged 4 commits into
apache:masterfrom
jasonbu:dulibo_noteram
Sep 28, 2024
Merged

fix bugs about noteram about alignment, fix the tail of reader did not reset when flush.#13684
xiaoxiang781216 merged 4 commits into
apache:masterfrom
jasonbu:dulibo_noteram

Conversation

@jasonbu

@jasonbu jasonbu commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

Summary

The noteram have bugs.
when ramnote flush, we should reset the tail of reader.
make noteram aligned, fix un-aligned write operation report by coverity.

Impact

Bug fixed after patch

Testing

CI-test

dulibo1 and others added 4 commits September 27, 2024 17:32
noteram_add may cause head = tail when remain == NOTE_ALIGN(notelen)
log:
nsh_main-14  [0]   2.132127493: tracing_mark_write: B|14|trace dump -c

nsh_main-14  [0]   2.143322780: tracing_mark_write: E|14|trace dump -c

nsh_main-14  [0]   2.513023895: tracing_mark_write: B|14|trace dump -c

nsh_main-14  [0]   2.524060048: tracing_mark_write: E|14|trace dump -c

nsh_main-14  [0]   2.897055341: tracing_mark_write: B|14|trace dump -c

ap> trace dump -c
nsh_main-14  [0]   3.270037241: tracing_mark_write: B|14|trace dump -c

ap> trace dump -c

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Fix ubsan warning that writes need to be aligned to memory boundaries when writing data

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
noteram_get may cause _read = ni_bufsize cause assert crash

[ 1493.627200] [79] [ EMERG] [ap] _assert: Assertion failed : at file: note/noteram_driver.c:370 task: trace process: trace 0x446f238a
[ 1493.627400] [79] [ EMERG] [ap] backtrace:
[ 1493.627500] [79] [ EMERG] [ap] [79] [<0xf7933c9d>] _fini+0xae0720b9/0xb673e41b
[ 1493.628400] [79] [ EMERG] [ap] [79] [<0x498b1b0c>] host_backtrace+0x42/0x72
[ 1493.629300] [79] [ EMERG] [ap] [79] [<0x48bef3d1>] up_backtrace+0x127/0x2d2
[ 1493.630200] [79] [ EMERG] [ap] [79] [<0x48b86bed>] sched_backtrace+0x71/0x8a
[ 1493.631100] [79] [ EMERG] [ap] [79] [<0x44676273>] sched_dumpstack+0xed/0x486
[ 1493.631600] [79] [ EMERG] [ap] [79] [<0x445c61ff>] _assert+0x9f0/0xb38
[ 1493.632200] [79] [ EMERG] [ap] [79] [<0x4420dd07>] __assert+0x3f/0x4c
[ 1493.632800] [79] [ EMERG] [ap] [79] [<0x44151648>] noteram_get+0x1b0/0x5fe
[ 1493.633600] [79] [ EMERG] [ap] [79] [<0x44152370>] noteram_read+0x331/0x4f7
[ 1493.634200] [79] [ EMERG] [ap] [79] [<0x444c66f9>] file_read+0x38b/0x3c0
[ 1493.634700] [79] [ EMERG] [ap] [79] [<0x444c6840>] nx_read+0x112/0x170
[ 1493.635300] [79] [ EMERG] [ap] [79] [<0x444c68e5>] NXread+0x47/0xfa
[ 1493.635800] [79] [ EMERG] [ap] [79] [<0x446f2c70>] trace_dump+0x148/0x2f4
[ 1493.636400] [79] [ EMERG] [ap] [79] [<0x446f110b>] trace_cmd_dump+0x41b/0x4b9
[ 1493.636900] [79] [ EMERG] [ap] [79] [<0x446f2723>] trace_main+0x399/0x6e2
[ 1493.637500] [79] [ EMERG] [ap] [79] [<0x44217fc9>] nxtask_startup+0x69/0x7c
[ 1493.638000] [79] [ EMERG] [ap] [79] [<0x440f9b78>] nxtask_start+0x8a5/0x8b8

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
@github-actions github-actions Bot added the Size: S The size of the change in this PR is small label Sep 27, 2024
@nuttxpr

nuttxpr commented Sep 27, 2024

Copy link
Copy Markdown

[Experimental Bot, please feedback here]

Incomplete Information Provided.

You have not provided the content of the PR. Please share the details of the proposed changes so I can evaluate if the PR meets the NuttX requirements.

To get a complete review, please provide:

  • The actual content of your PR summary. This should include what you changed and why.
  • Specific details about the impact of your changes. For example, if you added a new feature, describe the feature and how it works. If you fixed a bug, describe the bug and how your fix addresses it.
  • Information about your testing environment and the results of your tests. Include specific details about the host and target systems you used for testing.

Once you provide this information, I can help you determine if your PR meets the NuttX requirements.

@jasonbu jasonbu changed the title fix bugs about noteram fix bugs about noteram about alignment, fix the tail of reader did not reset when flush. Sep 27, 2024
@jasonbu jasonbu marked this pull request as ready for review September 27, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants