fix bugs about noteram about alignment, fix the tail of reader did not reset when flush.#13684
Merged
Merged
Conversation
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>
|
[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:
Once you provide this information, I can help you determine if your PR meets the NuttX requirements. |
xiaoxiang781216
approved these changes
Sep 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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