-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nxstyle improvements with No tooling #12
nxstyle improvements with No tooling #12
Conversation
Uses getops to pars command line. Supports -s silence all output -g provide a PASS fail message
@liuguo09 please take a look. |
I have already review this in its previous incarnation. So I give my approval nw. I don't know if we can approvals from the other people on the list. |
The use of '-m 99' in the testing is a little odd. I usuaully use -m 86. This probably raises some tool use questions. The coding standard says: Line Width. Text should not extend past column 78 in the typical C source or header file. Sometimes the nature of the content of a file may require that the lines exceed this limit. This often occurs in header files with naturally long definitions. If the line width must extend 78 lines, then some wider line width may be used in the file provided that it is used consistently. This should match the width of the block comments: Block Comments. Each grouping in the file is separated with a block comment. The block comment consists of:
So picking any fixed value will cause long lines to be missed OR many invalid "long line" error reports. Ideally, we should parse the file first, look at the block comments, make sure that they are the same width, and set the maximum line width automatically. |
@patacongo - would you please build and run this under windows. |
Just noticed... tools/README.txt also needs to be updated. I think just the old Usage comments need to be replaced with the new Usage comments. |
@patacongo - Thank you for noticing. It is added. |
It is not clear the the disinction between warning, error, and fatal makes any sense for coding standby. isn't is a boolean; The code complies to the standard or it does not. One non-compliance is no better or worse than another. |
How to use nxstyle with styleEclipse with CDT (https://gnu-mcu-eclipse.github.io/) Empowered development with SVD enabled debugging. Setup Tab "Builder Setting"Setup Tab "Behavior"Tool in action
Get a list of CS violationsClick and fix them! (hint work bottom up) |
b6a99dd
to
3e9da58
Compare
First let me say I am Pro NuttX coding style. On Slack, I had stated something to the effect of: ...how incredibly readable code is that conforms to the NuttX coding style and to preserve your legacy, this must be part of the inviolables... I said it better there.
Good questions! Here is the short answer to your questions are: it is fence:
For the moment See
For a complete understanding.
[DISCUSSION]
Agreed - a CS should be more digital than analog. But unfortunately the is not the current reality of the NuttX coding style or the current tools. The above comment about If we want to grow the Apache NuttX project we need tooling and a CI that works for us not against us. (When we get to that juncture, I will post something about the poison of a bad CI implementations ) Suffice it to say: having a bad experience on any front, is death to a projects adoption! Since we want pre-comment hooks and CI to check conformity to NuttX coding style. We have several issues to overcome. A proficient NuttX coding style tool would check for conformance, suggest fixes and optionally apply them. We do not have a proficient NuttX coding style tool or set of tools yet. Many of us have had our countless hours of work destroyed by the indent.sh. Remember to NEVER NEVER run indent.sh on a formatted file**Once you've been burned you will learn to commit often and Historical (see groups and lists) there are a lot posts like this:
If we want to grow the project. This can not continue to be the way we expect "embedded talent" to spend their time. It does not scale: ambiguity and non-deterministic processes wastes a great deal resources, time and effort and will result in many drive-by-pr's or forks. The sensible conclusion is to remove the human from the loop and automate it with proper tools. This change is the first step away from this quality of tooling. We have a long way to go. It is my hope that this reporting change in this PR will give us more time to work on proper tooling, I do feel strongly about it's ultimate integration: The API should be a simple invocation with NO ROOM for analog setting or not checking what has been changed! This got batted down previously:
but for all the right reasons Having a bad first experience is death to a projects adoption. REMEMBER: The N00B can use the make command and the PRO can use the script - we are not forcing our 'will' on anyone we are enabling the community to grow and succeed. There is a great line in Patch Adams @0:398 ish |
This one is a little misleading:
There is a "switch" (a boolean) that changes the behavior when the tool reaches the code in the file. It detects this point whn the Private or Public Functions block comment is encountered. It is misleading on C files that contain only global data definitions. For thoses files, there will naturally be no such block comments and and perfectly fine code would generate this fatal error. |
@xiaoxiang781216 I have two functional improvements that I want to make to nxstyle.c, but I will wait for Xiao Xiang to dispose of this PR before I do those. |
@patacongo. I'm glad you have some improvements.
Your options are to:
1 wait
OR
2 do a PR against this Branch in this repo
OR
3 I give you write access to this repo and you can pull this branch and add
your commits on it.
David
…On Sun, Dec 29, 2019, 7:18 AM patacongo ***@***.***> wrote:
I have two functional improvements that I want to make to nxstyle.c, but I
will wait for Xiao Xiang to dispose of this PR before I do those.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAO3BXML4P2HHF3T4SJK74LQ3C5TNANCNFSM4KACHTUQ>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. A typo error in README.txt, gor a given file may be for a given file?
Fixed typo noted by @liuguo09
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added changes indicated but @patacongo
… or type specifier" error "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: yanghuatao <[email protected]>
… or type specifier" error "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: yanghuatao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error #77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error #65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error #65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning #12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
"libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error apache#65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error apache#20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error apache#65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning apache#12-D: parsing restarts here after previous syntax error } Signed-off-by: guoshichao <[email protected]>
ap> cat pm ================================================================= ==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98 READ of size 1 at 0xf436edd9 thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 apache#1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174 apache#2 0x371b066 in pm_open power/pm/pm_procfs.c:207 apache#3 0x3640d20 in procfs_open procfs/fs_procfs.c:419 apache#4 0x359bce2 in file_vopen vfs/fs_open.c:240 apache#5 0x359c431 in nx_vopen vfs/fs_open.c:312 apache#6 0x359cb53 in open vfs/fs_open.c:465 apache#7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 apache#8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 apache#9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 apache#10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 apache#11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 apache#12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 apache#13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 apache#14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 apache#15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 apache#16 0x332b6e6 in nxtask_startup sched/task_startup.c:70 apache#17 0x323ec3f in nxtask_start task/task_start.c:134 apache#18 0x33636ea in pre_start sim/sim_initialstate.c:52 ap> cat net ================================================================= ==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8 READ of size 1 at 0xf4479a5a thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 apache#1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215 apache#2 0x3640d20 in procfs_open procfs/fs_procfs.c:419 apache#3 0x359bce2 in file_vopen vfs/fs_open.c:240 apache#4 0x359c431 in nx_vopen vfs/fs_open.c:312 apache#5 0x359cb53 in open vfs/fs_open.c:465 apache#6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 apache#7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 apache#8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 apache#9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 apache#10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 apache#11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 apache#12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 apache#13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 apache#14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 apache#15 0x332b6e6 in nxtask_startup sched/task_startup.c:70 apache#16 0x323ec3f in nxtask_start task/task_start.c:134 apache#17 0x33636ea in pre_start sim/sim_initialstate.c:52 Signed-off-by: dulibo1 <[email protected]> Signed-off-by: buxiasen <[email protected]>
ap> cat pm ================================================================= ==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98 READ of size 1 at 0xf436edd9 thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 #1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174 #2 0x371b066 in pm_open power/pm/pm_procfs.c:207 #3 0x3640d20 in procfs_open procfs/fs_procfs.c:419 #4 0x359bce2 in file_vopen vfs/fs_open.c:240 #5 0x359c431 in nx_vopen vfs/fs_open.c:312 #6 0x359cb53 in open vfs/fs_open.c:465 #7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 #8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 #9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 #10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 #11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 #12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 #13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 #14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 #15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 #16 0x332b6e6 in nxtask_startup sched/task_startup.c:70 #17 0x323ec3f in nxtask_start task/task_start.c:134 #18 0x33636ea in pre_start sim/sim_initialstate.c:52 ap> cat net ================================================================= ==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8 READ of size 1 at 0xf4479a5a thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 #1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215 #2 0x3640d20 in procfs_open procfs/fs_procfs.c:419 #3 0x359bce2 in file_vopen vfs/fs_open.c:240 #4 0x359c431 in nx_vopen vfs/fs_open.c:312 #5 0x359cb53 in open vfs/fs_open.c:465 #6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 #7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 #8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 #9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 #10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 #11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 #12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 #13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 #14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 #15 0x332b6e6 in nxtask_startup sched/task_startup.c:70 #16 0x323ec3f in nxtask_start task/task_start.c:134 #17 0x33636ea in pre_start sim/sim_initialstate.c:52 Signed-off-by: dulibo1 <[email protected]> Signed-off-by: buxiasen <[email protected]>
ap> cat pm ================================================================= ==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98 READ of size 1 at 0xf436edd9 thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 #1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174 apache#2 0x371b066 in pm_open power/pm/pm_procfs.c:207 apache#3 0x3640d20 in procfs_open procfs/fs_procfs.c:419 apache#4 0x359bce2 in file_vopen vfs/fs_open.c:240 apache#5 0x359c431 in nx_vopen vfs/fs_open.c:312 apache#6 0x359cb53 in open vfs/fs_open.c:465 apache#7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 apache#8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 apache#9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 apache#10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 apache#11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 apache#12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 apache#13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 apache#14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 apache#15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 apache#16 0x332b6e6 in nxtask_startup sched/task_startup.c:70 apache#17 0x323ec3f in nxtask_start task/task_start.c:134 apache#18 0x33636ea in pre_start sim/sim_initialstate.c:52 ap> cat net ================================================================= ==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8 READ of size 1 at 0xf4479a5a thread T0 #0 0x3338a47 in strncmp string/lib_strncmp.c:42 #1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215 apache#2 0x3640d20 in procfs_open procfs/fs_procfs.c:419 apache#3 0x359bce2 in file_vopen vfs/fs_open.c:240 apache#4 0x359c431 in nx_vopen vfs/fs_open.c:312 apache#5 0x359cb53 in open vfs/fs_open.c:465 apache#6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140 apache#7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556 apache#8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164 apache#9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845 apache#10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744 apache#11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828 apache#12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245 apache#13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75 apache#14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74 apache#15 0x332b6e6 in nxtask_startup sched/task_startup.c:70 apache#16 0x323ec3f in nxtask_start task/task_start.c:134 apache#17 0x33636ea in pre_start sim/sim_initialstate.c:52 Signed-off-by: dulibo1 <[email protected]> Signed-off-by: buxiasen <[email protected]>
Deadlock during recursive access if unionfs overlays procfs, check the critical segment only and remove the useless protection part. |#0 unionfs_statfs (mountpt=0xf3df4540, buf=0xf3de2f0c) at unionfs/fs_unionfs.c:2136 ... |apache#6 0x08069429 in procfs_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at procfs/fs_procfs.c:412 |apache#7 0x0806c339 in unionfs_read (filep=0xf3de219c, buffer=0xf3df4610 "...", buflen=1024) at unionfs/fs_unionfs.c:1026 original call stack: (gdb) bt |#0 unionfs_statfs (mountpt=0xf3df4540, buf=0xf3de2f0c) at unionfs/fs_unionfs.c:2136 |apache#1 0x08071629 in mountpoint_filter (node=0xf3df4540, dirpath=0xf3df4a28 "/proc", arg=0xf3de2fc4) at mount/fs_foreachmountpoint.c:119 |apache#2 0x0807171b in foreach_inodelevel (node=0xf3df4540, info=0xf3df4a20) at inode/fs_foreachinode.c:90 |apache#3 0x08071898 in foreach_inode (handler=0x8071530 <mountpoint_filter>, arg=0xf3de2fc4) at inode/fs_foreachinode.c:193 |apache#4 0x080716c1 in foreach_mountpoint (handler=0x8070e2f <blocks_entry>, arg=0xf3de300c) at mount/fs_foreachmountpoint.c:169 |apache#5 0x08071399 in mount_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at mount/fs_procfs_mount.c:537 |apache#6 0x08069429 in procfs_read (filep=0xf3df4574, buffer=0xf3df4610 "...", buflen=1024) at procfs/fs_procfs.c:412 |apache#7 0x0806c339 in unionfs_read (filep=0xf3de219c, buffer=0xf3df4610 "...", buflen=1024) at unionfs/fs_unionfs.c:1026 |apache#8 0x080657a2 in file_read (filep=0xf3de219c, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:110 |apache#9 0x0806581a in nx_read (fd=3, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:175 |apache#10 0x08065847 in read (fd=3, buf=0xf3df4610, nbytes=1024) at vfs/fs_read.c:206 |apache#11 0x0805a242 in nsh_catfile (vtbl=0xf3df3f10, cmd=0xf3df4378 "df", filepath=0x808d5ed "/proc/fs/blocks") at nsh_fsutils.c:116 |apache#12 0x0805b1de in cmd_df (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0) at nsh_mntcmds.c:73 |apache#13 0x08056370 in nsh_command (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0) at nsh_command.c:1061 |apache#14 0x08053b16 in nsh_execute (vtbl=0xf3df3f10, argc=1, argv=0xf3de32c0, redirfile=0x0, oflags=0) at nsh_parse.c:741 |apache#15 0x08055998 in nsh_parse_command (vtbl=0xf3df3f10, cmdline=0xf3df4378 "df") at nsh_parse.c:2578 |apache#16 0x08055a7b in nsh_parse (vtbl=0xf3df3f10, cmdline=0xf3df4378 "df") at nsh_parse.c:2662 |apache#17 0x0805d691 in nsh_session (pstate=0xf3df3f10, login=1 '\001', argc=1, argv=0xf3de34b0) at nsh_session.c:191 |apache#18 0x0805b542 in nsh_consolemain (argc=1, argv=0xf3de34b0) at nsh_consolemain.c:115 |apache#19 0x0805346c in nsh_main (argc=1, argv=0xf3de34b0) at nsh_main.c:168 |apache#20 0x0805075a in nxtask_startup (entrypt=0x805340a <nsh_main>, argc=1, argv=0xf3de34b0) at sched/task_startup.c:165 |apache#21 0x08049713 in nxtask_start () at task/task_start.c:144 |apache#22 0x00000000 in ?? () Change-Id: Ic4c7aff0ea50388a371c525745e817a787dabcca Signed-off-by: chao.an <[email protected]>
…system boot So avoid to use vmov.i32 instruction before FPU is ready. Before modification: 3c03b35c <nx_vsyslog>: 3c03b35c: f2c00010 vmov.i32 d16, #0 ; 0x00000000 3c03b360: f2c02050 vmov.i32 q9, #0 ; 0x00000000 3c03b364: e92d40f0 push {r4, r5, r6, r7, lr} 3c03b368: e24dd08c sub sp, sp, apache#140 ; 0x8c 3c03b36c: e28d301c add r3, sp, apache#28 3c03b370: e2505000 subs r5, r0, #0 3c03b374: edcd0b0f vstr d16, [sp, apache#60] ; 0x3c 3c03b378: edcd0b01 vstr d16, [sp, apache#4] After modification: 3c03b35c <nx_vsyslog>: 3c03b35c: e92d40f0 push {r4, r5, r6, r7, lr} 3c03b360: e2505000 subs r5, r0, #0 3c03b364: e24dd08c sub sp, sp, apache#140 ; 0x8c 3c03b368: e1a06001 mov r6, r1 3c03b36c: e1a07002 mov r7, r2 3c03b370: e28d000c add r0, sp, apache#12 3c03b374: 1a00003a bne 3c03b464 <nx_vsyslog+0x108> Change-Id: I643c19f5416c94a529764fdaa81f3088fcf95355 Signed-off-by: Jiuzhu Dong <[email protected]> (cherry picked from commit 696bf0d368a62493c3d7462735127ed2c6ef7594) Signed-off-by: Jiuzhu Dong <[email protected]>
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, apache#20 | de50: e24dd014 sub sp, sp, apache#20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, apache#248 @ 0xf8 | de58: e30030f8 movw r3, apache#248 @ 0xf8 de5c: e3423000 movt r3, apache#8192 @ 0x2000 | de5c: e3423000 movt r3, apache#8192 @ 0x2000 de60: e58d300c str r3, [sp, apache#12] | de60: e58d300c str r3, [sp, apache#12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, apache#12] | de68: e59d000c ldr r0, [sp, apache#12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, apache#20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, apache#20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
modify the prototype of up_putc(): remove the return value The architecture code does not care about the return value of up_putc(), so removing it saves two statements: Before: After: de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) de50: e24dd014 sub sp, sp, #20 | de50: e24dd014 sub sp, sp, #20 de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4] de58: e30030f8 movw r3, #248 @ 0xf8 | de58: e30030f8 movw r3, #248 @ 0xf8 de5c: e3423000 movt r3, #8192 @ 0x2000 | de5c: e3423000 movt r3, #8192 @ 0x2000 de60: e58d300c str r3, [sp, #12] | de60: e58d300c str r3, [sp, #12] de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4] de68: e59d000c ldr r0, [sp, #12] | de68: e59d000c ldr r0, [sp, #12] de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc> de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, #20 de74: e1a0000 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4) de78: e28dd014 add sp, sp, #20 | de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) | Signed-off-by: chao an <[email protected]>
current sizeof(struct sockaddr_in) is 66 arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment 0xe5f134e6: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241 #1 0x5432a11f in arp_snapshot arp/arp_table.c:574 #2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547 apache#3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715 apache#4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743 apache#5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382 apache#6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625 apache#7 0x542be94d in psock_sendmsg socket/sendmsg.c:96 apache#8 0x542bc94b in psock_sendto socket/sendto.c:134 apache#9 0x542bcb28 in sendto socket/sendto.c:247 apache#10 0x542bc5ea in send socket/send.c:163 apache#11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152 apache#12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197 apache#13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263 apache#14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718 apache#15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619 apache#16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706 apache#17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245 apache#18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75 apache#19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74 apache#20 0x54067ee1 in nxtask_startup sched/task_startup.c:70 apache#21 0x53f366c6 in nxtask_start task/task_start.c:116 apache#22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52 Signed-off-by: zhanghongyu <[email protected]>
current sizeof(struct sockaddr_in) is 66 arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment 0xe5f134e6: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241 #1 0x5432a11f in arp_snapshot arp/arp_table.c:574 #2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547 apache#3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715 apache#4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743 apache#5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382 apache#6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625 apache#7 0x542be94d in psock_sendmsg socket/sendmsg.c:96 apache#8 0x542bc94b in psock_sendto socket/sendto.c:134 apache#9 0x542bcb28 in sendto socket/sendto.c:247 apache#10 0x542bc5ea in send socket/send.c:163 apache#11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152 apache#12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197 apache#13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263 apache#14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718 apache#15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619 apache#16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706 apache#17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245 apache#18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75 apache#19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74 apache#20 0x54067ee1 in nxtask_startup sched/task_startup.c:70 apache#21 0x53f366c6 in nxtask_start task/task_start.c:116 apache#22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52 Signed-off-by: zhanghongyu <[email protected]>
current sizeof(struct sockaddr_in) is 66 arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment 0xe5f134e6: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241 #1 0x5432a11f in arp_snapshot arp/arp_table.c:574 #2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547 #3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715 #4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743 #5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382 #6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625 #7 0x542be94d in psock_sendmsg socket/sendmsg.c:96 #8 0x542bc94b in psock_sendto socket/sendto.c:134 #9 0x542bcb28 in sendto socket/sendto.c:247 #10 0x542bc5ea in send socket/send.c:163 #11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152 #12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197 #13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263 #14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718 #15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619 #16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706 #17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245 #18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75 #19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74 #20 0x54067ee1 in nxtask_startup sched/task_startup.c:70 #21 0x53f366c6 in nxtask_start task/task_start.c:116 #22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52 Signed-off-by: zhanghongyu <[email protected]>
Summary: 1.Modified the i_crefs from int16_t to atomic_int 2.Modified the i_crefs add, delete, read, and initialize interfaces to atomic operations The purpose of this change is to avoid deadlock in cross-core scenarios, where A Core blocks B Core’s request for a write operation to A Core when A Core requests a read operation to B Core. Signed-off-by: chenrun1 <[email protected]>
current sizeof(struct sockaddr_in) is 66 arp/arp_table.c:241:28: runtime error: member access within misaligned address 0xe5f134e6 for type 'struct sockaddr_in', which requires 4 byte alignment 0xe5f134e6: note: pointer points here 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ #0 0x543287c1 in arp_get_arpreq arp/arp_table.c:241 apache#1 0x5432a11f in arp_snapshot arp/arp_table.c:574 apache#2 0x5435f0be in netlink_fill_arptable netlink/netlink_route.c:547 apache#3 0x5435ffca in netlink_get_neighbor netlink/netlink_route.c:715 apache#4 0x54360116 in netlink_get_neighborlist netlink/netlink_route.c:743 apache#5 0x54363b20 in netlink_route_sendto netlink/netlink_route.c:1382 apache#6 0x542ef1b1 in netlink_sendmsg netlink/netlink_sockif.c:625 apache#7 0x542be94d in psock_sendmsg socket/sendmsg.c:96 apache#8 0x542bc94b in psock_sendto socket/sendto.c:134 apache#9 0x542bcb28 in sendto socket/sendto.c:247 apache#10 0x542bc5ea in send socket/send.c:163 apache#11 0x542aa715 in netlib_get_arptable /home/mi/gaofengzhi/code/dev1025/apps/netutils/netlib/netlib_getarptab.c:152 apache#12 0x54279109 in cmd_arp /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_netcmds.c:1197 apache#13 0x54257faf in nsh_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_command.c:1263 apache#14 0x54231982 in nsh_execute /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:718 apache#15 0x5423da42 in nsh_parse_command /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2619 apache#16 0x5423e12a in nsh_parse /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_parse.c:2706 apache#17 0x5424088f in nsh_session /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_session.c:245 apache#18 0x5422efc9 in nsh_consolemain /home/mi/gaofengzhi/code/dev1025/apps/nshlib/nsh_consolemain.c:75 apache#19 0x5419e89f in nsh_main /home/mi/gaofengzhi/code/dev1025/apps/system/nsh/nsh_main.c:74 apache#20 0x54067ee1 in nxtask_startup sched/task_startup.c:70 apache#21 0x53f366c6 in nxtask_start task/task_start.c:116 apache#22 0x5409e1a4 in pre_start sim/sim_initialstate.c:52 Signed-off-by: zhanghongyu <[email protected]>
test code hello_main int main(int argc, FAR char *argv[]) { uint32_t *p = 0xdeedbeff; *p = 0xffffff; printf("%p\n %x\n", p, *p); return 0; } qemu mps3-an547 hello_main : Triggering an exception, and gdb backtrace is: before: (gdb) bt /#0 0x0001168a in systick_getstatus (lower_=0x100010c <g_systick_lower>, status=0x1000a30 <g_intstackalloc+1600>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:142 /#1 0x000122f4 in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#2 0x0001234c in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /apache#3 0x000124bc in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /apache#4 0x0001249e in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /apache#5 0x0000920c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:830 /apache#6 0x0000937c in _assert (filename=0x393f8 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x393f0 "panic", regs=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:940 /apache#7 0x00000e2c in arm_busfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#8 0x000012d2 in arm_hardfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#9 0x00008b20 in irq_dispatch (irq=3, context=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#10 0x0000041a in arm_doirq (irq=3, regs=0x1008500) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:103 /apache#11 0x0000034e in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:224 after: (gdb) bt /#0 systick_is_running () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:106 /#1 0x000125c0 in systick_getstatus (lower_=0x1000114 <g_systick_lower>, status=0x1007a20) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:141 /#2 0x0001323c in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /apache#3 0x00013294 in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /apache#4 0x00013404 in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /apache#5 0x000133e6 in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /apache#6 0x00008c5c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#7 0x00008e88 in _assert (filename=0x39408 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x39400 "panic", regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#8 0x00000ce4 in arm_busfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#9 0x0000118a in arm_hardfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#10 0x000086cc in irq_dispatch (irq=3, context=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#11 0x0000041e in arm_doirq (irq=3, regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:99 /apache#12 0x00000360 in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:230 /apache#13 0x00027a8c in hello_main (argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:39 /apache#14 0x00014968 in nxtask_startup (entrypt=0x27a7d <hello_main>, argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#15 0x0000f450 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#16 0x00000000 in ?? () (gdb) qemu armv7a nsh, hello_main: before: (gdb) bt /#0 udelay_coarse (microseconds=156000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c630 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /apache#3 0x0060c644 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /apache#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd74 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc04 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:438 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) after: (gdb) bt /#0 udelay_coarse (microseconds=192000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c650 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /apache#3 0x0060c664 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /apache#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd94 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc08 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:453 /apache#8 0x00620cd4 in hello_main (argc=4999, argv=0x0) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:41 /apache#9 0x0060d320 in nxtask_startup (entrypt=0x620cc4 <hello_main>, argc=1, argv=0x4020a088) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#10 0x00609b50 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#11 0x00000000 in ?? () qemu risc-v nsh before: (gdb) bt /#0 udelay_coarse (microseconds=228000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /apache#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /apache#4 0x80011f1c in reset_board () at misc/assert.c:813 /apache#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000164 in exception_common () at common/riscv_exception_common.S:210 Backtrace stopped: frame did not save the PC (gdb) after (gdb) bt /#0 0x80003922 in udelay_coarse (microseconds=90000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /apache#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /apache#4 0x80011f2a in reset_board () at misc/assert.c:816 /apache#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000166 in exception_common () at common/riscv_exception_common.S:215 /apache#9 0x8001792a in hello_main (argc=<optimized out>, argv=<optimized out>) at hello_main.c:41 /apache#10 0x80004b52 in nxtask_startup (entrypt=0x80030704, argc=1, argv=0x800300e8) at sched/task_startup.c:72 /apache#11 0x80001e72 in nxtask_start () at task/task_start.c:116 /apache#12 0x00000000 in ?? () Backtrace stopped: frame did not save the PC (gdb) Signed-off-by: anjiahao <[email protected]>
test code hello_main int main(int argc, FAR char *argv[]) { uint32_t *p = 0xdeedbeff; *p = 0xffffff; printf("%p\n %x\n", p, *p); return 0; } qemu mps3-an547 hello_main : Triggering an exception, and gdb backtrace is: before: (gdb) bt /#0 0x0001168a in systick_getstatus (lower_=0x100010c <g_systick_lower>, status=0x1000a30 <g_intstackalloc+1600>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:142 /#1 0x000122f4 in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#2 0x0001234c in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /apache#3 0x000124bc in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /apache#4 0x0001249e in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /apache#5 0x0000920c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:830 /apache#6 0x0000937c in _assert (filename=0x393f8 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x393f0 "panic", regs=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:940 /apache#7 0x00000e2c in arm_busfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#8 0x000012d2 in arm_hardfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#9 0x00008b20 in irq_dispatch (irq=3, context=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#10 0x0000041a in arm_doirq (irq=3, regs=0x1008500) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:103 /apache#11 0x0000034e in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:224 after: (gdb) bt /#0 systick_is_running () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:106 /#1 0x000125c0 in systick_getstatus (lower_=0x1000114 <g_systick_lower>, status=0x1007a20) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:141 /#2 0x0001323c in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /apache#3 0x00013294 in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /apache#4 0x00013404 in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /apache#5 0x000133e6 in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /apache#6 0x00008c5c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#7 0x00008e88 in _assert (filename=0x39408 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x39400 "panic", regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#8 0x00000ce4 in arm_busfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#9 0x0000118a in arm_hardfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#10 0x000086cc in irq_dispatch (irq=3, context=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#11 0x0000041e in arm_doirq (irq=3, regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:99 /apache#12 0x00000360 in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:230 /apache#13 0x00027a8c in hello_main (argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:39 /apache#14 0x00014968 in nxtask_startup (entrypt=0x27a7d <hello_main>, argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#15 0x0000f450 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#16 0x00000000 in ?? () (gdb) qemu armv7a nsh, hello_main: before: (gdb) bt /#0 udelay_coarse (microseconds=156000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c630 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /apache#3 0x0060c644 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /apache#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd74 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc04 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:438 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) after: (gdb) bt /#0 udelay_coarse (microseconds=192000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c650 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /apache#3 0x0060c664 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /apache#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd94 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc08 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:453 /apache#8 0x00620cd4 in hello_main (argc=4999, argv=0x0) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:41 /apache#9 0x0060d320 in nxtask_startup (entrypt=0x620cc4 <hello_main>, argc=1, argv=0x4020a088) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#10 0x00609b50 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#11 0x00000000 in ?? () qemu risc-v nsh before: (gdb) bt /#0 udelay_coarse (microseconds=228000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /apache#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /apache#4 0x80011f1c in reset_board () at misc/assert.c:813 /apache#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000164 in exception_common () at common/riscv_exception_common.S:210 Backtrace stopped: frame did not save the PC (gdb) after (gdb) bt /#0 0x80003922 in udelay_coarse (microseconds=90000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /apache#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /apache#4 0x80011f2a in reset_board () at misc/assert.c:816 /apache#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000166 in exception_common () at common/riscv_exception_common.S:215 /apache#9 0x8001792a in hello_main (argc=<optimized out>, argv=<optimized out>) at hello_main.c:41 /apache#10 0x80004b52 in nxtask_startup (entrypt=0x80030704, argc=1, argv=0x800300e8) at sched/task_startup.c:72 /apache#11 0x80001e72 in nxtask_start () at task/task_start.c:116 /apache#12 0x00000000 in ?? () Backtrace stopped: frame did not save the PC (gdb) Signed-off-by: anjiahao <[email protected]>
test code hello_main int main(int argc, FAR char *argv[]) { uint32_t *p = 0xdeedbeff; *p = 0xffffff; printf("%p\n %x\n", p, *p); return 0; } qemu mps3-an547 hello_main : Triggering an exception, and gdb backtrace is: before: (gdb) bt /#0 0x0001168a in systick_getstatus (lower_=0x100010c <g_systick_lower>, status=0x1000a30 <g_intstackalloc+1600>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:142 /#1 0x000122f4 in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#2 0x0001234c in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /#3 0x000124bc in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /#4 0x0001249e in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /#5 0x0000920c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:830 /#6 0x0000937c in _assert (filename=0x393f8 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x393f0 "panic", regs=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:940 /#7 0x00000e2c in arm_busfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /#8 0x000012d2 in arm_hardfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /#9 0x00008b20 in irq_dispatch (irq=3, context=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /#10 0x0000041a in arm_doirq (irq=3, regs=0x1008500) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:103 /#11 0x0000034e in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:224 after: (gdb) bt /#0 systick_is_running () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:106 /#1 0x000125c0 in systick_getstatus (lower_=0x1000114 <g_systick_lower>, status=0x1007a20) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:141 /#2 0x0001323c in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#3 0x00013294 in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /#4 0x00013404 in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /#5 0x000133e6 in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /#6 0x00008c5c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /#7 0x00008e88 in _assert (filename=0x39408 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x39400 "panic", regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /#8 0x00000ce4 in arm_busfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /#9 0x0000118a in arm_hardfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /#10 0x000086cc in irq_dispatch (irq=3, context=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /#11 0x0000041e in arm_doirq (irq=3, regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:99 /#12 0x00000360 in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:230 /#13 0x00027a8c in hello_main (argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:39 /#14 0x00014968 in nxtask_startup (entrypt=0x27a7d <hello_main>, argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /#15 0x0000f450 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /#16 0x00000000 in ?? () (gdb) qemu armv7a nsh, hello_main: before: (gdb) bt /#0 udelay_coarse (microseconds=156000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c630 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /#3 0x0060c644 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /#6 0x0060bd74 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /#7 0x0060bc04 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:438 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) after: (gdb) bt /#0 udelay_coarse (microseconds=192000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c650 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /#3 0x0060c664 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /#6 0x0060bd94 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /#7 0x0060bc08 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:453 /#8 0x00620cd4 in hello_main (argc=4999, argv=0x0) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:41 /#9 0x0060d320 in nxtask_startup (entrypt=0x620cc4 <hello_main>, argc=1, argv=0x4020a088) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /#10 0x00609b50 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /#11 0x00000000 in ?? () qemu risc-v nsh before: (gdb) bt /#0 udelay_coarse (microseconds=228000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /#4 0x80011f1c in reset_board () at misc/assert.c:813 /#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /#8 0x80000164 in exception_common () at common/riscv_exception_common.S:210 Backtrace stopped: frame did not save the PC (gdb) after (gdb) bt /#0 0x80003922 in udelay_coarse (microseconds=90000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /#4 0x80011f2a in reset_board () at misc/assert.c:816 /#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /#8 0x80000166 in exception_common () at common/riscv_exception_common.S:215 /#9 0x8001792a in hello_main (argc=<optimized out>, argv=<optimized out>) at hello_main.c:41 /#10 0x80004b52 in nxtask_startup (entrypt=0x80030704, argc=1, argv=0x800300e8) at sched/task_startup.c:72 /#11 0x80001e72 in nxtask_start () at task/task_start.c:116 /#12 0x00000000 in ?? () Backtrace stopped: frame did not save the PC (gdb) Signed-off-by: anjiahao <[email protected]>
test code hello_main int main(int argc, FAR char *argv[]) { uint32_t *p = 0xdeedbeff; *p = 0xffffff; printf("%p\n %x\n", p, *p); return 0; } qemu mps3-an547 hello_main : Triggering an exception, and gdb backtrace is: before: (gdb) bt /#0 0x0001168a in systick_getstatus (lower_=0x100010c <g_systick_lower>, status=0x1000a30 <g_intstackalloc+1600>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:142 /#1 0x000122f4 in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#2 0x0001234c in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /#3 0x000124bc in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /#4 0x0001249e in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /#5 0x0000920c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:830 /apache#6 0x0000937c in _assert (filename=0x393f8 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x393f0 "panic", regs=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:940 /apache#7 0x00000e2c in arm_busfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#8 0x000012d2 in arm_hardfault (irq=3, context=0x1008500, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#9 0x00008b20 in irq_dispatch (irq=3, context=0x1008500) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#10 0x0000041a in arm_doirq (irq=3, regs=0x1008500) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:103 /apache#11 0x0000034e in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:224 after: (gdb) bt /#0 systick_is_running () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:106 /#1 0x000125c0 in systick_getstatus (lower_=0x1000114 <g_systick_lower>, status=0x1007a20) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_systick.c:141 /#2 0x0001323c in current_usec () at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:105 /#3 0x00013294 in udelay_accurate (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:115 /#4 0x00013404 in up_udelay (microseconds=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:463 /#5 0x000133e6 in up_mdelay (milliseconds=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_timer.c:446 /apache#6 0x00008c5c in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /apache#7 0x00008e88 in _assert (filename=0x39408 "/arch/arm/src/armv8-m/arm_busfault.c", linenum=113, msg=0x39400 "panic", regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#8 0x00000ce4 in arm_busfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_busfault.c:113 /apache#9 0x0000118a in arm_hardfault (irq=3, context=0x1007cf0, arg=0x0 <up_ndelay>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_hardfault.c:142 /apache#10 0x000086cc in irq_dispatch (irq=3, context=0x1007cf0) at /home/ajh/work/vela_system/nuttx/sched/irq/irq_dispatch.c:145 /apache#11 0x0000041e in arm_doirq (irq=3, regs=0x1007cf0) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_doirq.c:99 /apache#12 0x00000360 in exception_common () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv8-m/arm_exception.S:230 /apache#13 0x00027a8c in hello_main (argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:39 /apache#14 0x00014968 in nxtask_startup (entrypt=0x27a7d <hello_main>, argc=1, argv=0x1006e20) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#15 0x0000f450 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#16 0x00000000 in ?? () (gdb) qemu armv7a nsh, hello_main: before: (gdb) bt /#0 udelay_coarse (microseconds=156000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c630 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /#3 0x0060c644 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd74 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc04 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:438 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) after: (gdb) bt /#0 udelay_coarse (microseconds=192000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:431 /#2 0x0060c650 in up_udelay (microseconds=microseconds@entry=250000) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:416 /#3 0x0060c664 in up_mdelay (milliseconds=milliseconds@entry=250) at /home/ajh/work/vela_system/nuttx/drivers/timers/arch_alarm.c:401 /#4 0x006056bc in reset_board () at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:816 /#5 _assert (filename=filename@entry=0x63047f "/arch/arm/src/armv7-a/arm_dataabort.c", linenum=linenum@entry=157, msg=msg@entry=0x62f56d "panic", regs=<optimized out>, regs@entry=0x4020af10) at /home/ajh/work/vela_system/nuttx/sched/misc/assert.c:915 /apache#6 0x0060bd94 in arm_dataabort (regs=0x4020af10, dfar=<optimized out>, dfsr=<optimized out>) at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_dataabort.c:157 /apache#7 0x0060bc08 in arm_vectordata () at /home/ajh/work/vela_system/nuttx/arch/arm/src/armv7-a/arm_vectors.S:453 /apache#8 0x00620cd4 in hello_main (argc=4999, argv=0x0) at /home/ajh/work/vela_system/apps/examples/hello/hello_main.c:41 /apache#9 0x0060d320 in nxtask_startup (entrypt=0x620cc4 <hello_main>, argc=1, argv=0x4020a088) at /home/ajh/work/vela_system/nuttx/libs/libc/sched/task_startup.c:72 /apache#10 0x00609b50 in nxtask_start () at /home/ajh/work/vela_system/nuttx/sched/task/task_start.c:116 /apache#11 0x00000000 in ?? () qemu risc-v nsh before: (gdb) bt /#0 udelay_coarse (microseconds=228000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /#4 0x80011f1c in reset_board () at misc/assert.c:813 /#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000164 in exception_common () at common/riscv_exception_common.S:210 Backtrace stopped: frame did not save the PC (gdb) after (gdb) bt /#0 0x80003922 in udelay_coarse (microseconds=90000, microseconds@entry=891896832) at timers/arch_alarm.c:67 /#1 up_ndelay (nanoseconds=nanoseconds@entry=250000000) at timers/arch_alarm.c:431 /#2 0x8000397e in up_udelay (microseconds=microseconds@entry=250000) at timers/arch_alarm.c:416 /#3 0x80003988 in up_mdelay (milliseconds=milliseconds@entry=250) at timers/arch_alarm.c:401 /#4 0x80011f2a in reset_board () at misc/assert.c:816 /#5 0x80011f7a in _assert (filename=filename@entry=0x0, linenum=linenum@entry=0, msg=msg@entry=0x8002114c "panic", regs=<optimized out>, regs@entry=0x80030704) at misc/assert.c:915 /apache#6 0x80006ad6 in riscv_exception (mcause=<optimized out>, regs=0x80030704, args=<optimized out>) at common/riscv_exception.c:129 /apache#7 0x80000d9e in riscv_doirq (irq=7, regs=<optimized out>) at common/riscv_doirq.c:99 /apache#8 0x80000166 in exception_common () at common/riscv_exception_common.S:215 /apache#9 0x8001792a in hello_main (argc=<optimized out>, argv=<optimized out>) at hello_main.c:41 /apache#10 0x80004b52 in nxtask_startup (entrypt=0x80030704, argc=1, argv=0x800300e8) at sched/task_startup.c:72 /apache#11 0x80001e72 in nxtask_start () at task/task_start.c:116 /apache#12 0x00000000 in ?? () Backtrace stopped: frame did not save the PC (gdb) Signed-off-by: anjiahao <[email protected]>
-s silence all output
-g provide a PASS fail message
test script to check the whole of nuttx with @patacongo value of 86
Good news with length at 86, 5256 files pass.
BAD news with length at 86, 4043 files fail.
Test cases
Test case 1
ironic but true
./nxstyle -m 99 nxstyle-master.c
Test case 2
blank.c
nxstyle -m 90 blank.c
45 lines of /n
./nxstyle -m 80 blank.c
Test case 3
Test case 4
Test case 5
Test case 6