In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail what to do when you encounter Page Fault errors in Utility. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Many people encounter Page Fault errors when executing VxWorks applications on X86 devices.
This is the 14th exception of X86 CPU, which means that a page exception occurred in the instruction to access the memory.
In my past experience, this situation is mostly caused by address errors, and the main address error is stack overflow (or stack crossing). Let's write an example and simulate it.
Start a task in the VxWorks of X86 to execute it
You can see that the stack of task T1 uses the default value of 20000, but there is an array sss of 0x10001 in the code, which obviously doesn't have enough stack. The end address of sss, 0x172a9db, is still in the task stack, but the starting address of sss, 0x171a9db, is beyond the range of the stack [0x172aaa0re0x1725c80]. Press the keyboard again at this time, and the Page Fault will appear just now.
In practice, what bothers us is that the task (for example, T1) has been withdrawn, so when Page Fault appears, the culprit can no longer be found with the I or checkStack command.
As mentioned in "Task's system tasks", you can add a taskSuspend (0) at the end of the task and hang it. Then you can use checkStack.
So we can catch the appearance.
There is a component in VxWorks, INCLUDE_PROTECT_TASK_STACK, to protect against stack overflows. Let's add it to give it a try
After executing the same program again, VxWorks restarts immediately, and it is useless to add taskSuspend (0). In bootrom, you can see the reason for the restart with the e command
With this protection, any more crossing the line will be restarted immediately and the danger will not be put off. Because sometimes when you cross the line, the problem will not be exposed immediately.
Now that we are talking about out of bounds, there are some more common situations, such as array out of bounds and pointers out of bounds. Look at an example.
The array a2 has only one member a2 [0], but when assigned, two members a2 [0] and a2 [1] are written.
As you can see, when writing a2 [1], the address of the actual A3
If no other variables are declared after a2 [] in the current file, the address of the operation is hidden. Let's try again.
Restart VxWorks, let's see who's behind a2 first.
Oh, there is a variable called runtimeName, and other people's value is 0x595239
Then execute the program and look at its value
The latter variable runtimeName has been modified.
As long as the VxWorks system is not turned off, in a few years, there may be a task to access the variable runtimeName, then something will go wrong, but at that time, it will have to take the blame. The task of carrying out aaa is long gone.
This is the end of the article on "what to do when you encounter Page Fault errors in Utility". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.