How Linux finds out about illegal memory access error? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionWhich parts of an ELF executable get loaded into memory, and where?System sending SIGTERM and SIGKILL during normal workLinux reboot out of memoryHow is user space process/thread controlled by the operating systemKernel and User space System CallsQuestions about kernel virtual address layoutDevice id , connection OS & deviceHow to ensure that a shared library will have its memory pages shared by several processes?Is memory mapped I/O only used internally by OS, not exposed to and used by programmers on top of Linux?If the heap is zero-initialized for security, then why is the stack merely uninitialized?
Is there a "higher Segal conjecture"?
Why is "Consequences inflicted." not a sentence?
Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?
ListPlot join points by nearest neighbor rather than order
What happens to sewage if there is no river near by?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Can Pao de Queijo, and similar foods, be kosher for Passover?
Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?
Is the Standard Deduction better than Itemized when both are the same amount?
Are my PIs rude or am I just being too sensitive?
How to deal with a team lead who never gives me credit?
Is it true that "carbohydrates are of no use for the basal metabolic need"?
Is it possible to boil a liquid by just mixing many immiscible liquids together?
How do I mention the quality of my school without bragging
IndentationError when pasting code in Python 3 interpreter mode
Did Xerox really develop the first LAN?
What are the pros and cons of Aerospike nosecones?
How does cp -a work
Why does Python start at index 1 when iterating an array backwards?
Is there a Spanish version of "dot your i's and cross your t's" that includes the letter 'ñ'?
What makes black pepper strong or mild?
What would be the ideal power source for a cybernetic eye?
Gastric acid as a weapon
Do you forfeit tax refunds/credits if you aren't required to and don't file by April 15?
How Linux finds out about illegal memory access error?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionWhich parts of an ELF executable get loaded into memory, and where?System sending SIGTERM and SIGKILL during normal workLinux reboot out of memoryHow is user space process/thread controlled by the operating systemKernel and User space System CallsQuestions about kernel virtual address layoutDevice id , connection OS & deviceHow to ensure that a shared library will have its memory pages shared by several processes?Is memory mapped I/O only used internally by OS, not exposed to and used by programmers on top of Linux?If the heap is zero-initialized for security, then why is the stack merely uninitialized?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a question about how Linux traps memory access errors. As far as I know, a user space program doesn't need to ask operating system every time it wants to access memory, now when the process tries to access a memory location not in it's address space the CPU must be having a way to stop this and communicate this event to the OS.
So my question is:
How does the CPU inform the OS about this event ?
Does it start executing a predefined code ? If yes, please let me know about where in memory is that code, what is that code section called, what does it do, etc.
linux system-calls segmentation-fault
New contributor
add a comment |
I have a question about how Linux traps memory access errors. As far as I know, a user space program doesn't need to ask operating system every time it wants to access memory, now when the process tries to access a memory location not in it's address space the CPU must be having a way to stop this and communicate this event to the OS.
So my question is:
How does the CPU inform the OS about this event ?
Does it start executing a predefined code ? If yes, please let me know about where in memory is that code, what is that code section called, what does it do, etc.
linux system-calls segmentation-fault
New contributor
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00
add a comment |
I have a question about how Linux traps memory access errors. As far as I know, a user space program doesn't need to ask operating system every time it wants to access memory, now when the process tries to access a memory location not in it's address space the CPU must be having a way to stop this and communicate this event to the OS.
So my question is:
How does the CPU inform the OS about this event ?
Does it start executing a predefined code ? If yes, please let me know about where in memory is that code, what is that code section called, what does it do, etc.
linux system-calls segmentation-fault
New contributor
I have a question about how Linux traps memory access errors. As far as I know, a user space program doesn't need to ask operating system every time it wants to access memory, now when the process tries to access a memory location not in it's address space the CPU must be having a way to stop this and communicate this event to the OS.
So my question is:
How does the CPU inform the OS about this event ?
Does it start executing a predefined code ? If yes, please let me know about where in memory is that code, what is that code section called, what does it do, etc.
linux system-calls segmentation-fault
linux system-calls segmentation-fault
New contributor
New contributor
edited Apr 12 at 14:29
user288752
New contributor
asked Apr 11 at 17:37
TezeswarTezeswar
82
82
New contributor
New contributor
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00
add a comment |
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00
add a comment |
1 Answer
1
active
oldest
votes
Your guesses seem about 100% correct.
There is hardware called a memory management unit (MMU) (Part of CPU). It is given page tables, that describe what pages do what (what are executable, readable, writable). If a process tries to do what it is not allowed to do, then the MMU interrupts the CPU. The CPU then executes the code in the starting at a particular address. This address is defined in the interrupt vector table. A table of start addresses, for each interrupt type (some CPUs store instructions in this table, not addresses, but they do the same thing).
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511963%2fhow-linux-finds-out-about-illegal-memory-access-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your guesses seem about 100% correct.
There is hardware called a memory management unit (MMU) (Part of CPU). It is given page tables, that describe what pages do what (what are executable, readable, writable). If a process tries to do what it is not allowed to do, then the MMU interrupts the CPU. The CPU then executes the code in the starting at a particular address. This address is defined in the interrupt vector table. A table of start addresses, for each interrupt type (some CPUs store instructions in this table, not addresses, but they do the same thing).
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
add a comment |
Your guesses seem about 100% correct.
There is hardware called a memory management unit (MMU) (Part of CPU). It is given page tables, that describe what pages do what (what are executable, readable, writable). If a process tries to do what it is not allowed to do, then the MMU interrupts the CPU. The CPU then executes the code in the starting at a particular address. This address is defined in the interrupt vector table. A table of start addresses, for each interrupt type (some CPUs store instructions in this table, not addresses, but they do the same thing).
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
add a comment |
Your guesses seem about 100% correct.
There is hardware called a memory management unit (MMU) (Part of CPU). It is given page tables, that describe what pages do what (what are executable, readable, writable). If a process tries to do what it is not allowed to do, then the MMU interrupts the CPU. The CPU then executes the code in the starting at a particular address. This address is defined in the interrupt vector table. A table of start addresses, for each interrupt type (some CPUs store instructions in this table, not addresses, but they do the same thing).
Your guesses seem about 100% correct.
There is hardware called a memory management unit (MMU) (Part of CPU). It is given page tables, that describe what pages do what (what are executable, readable, writable). If a process tries to do what it is not allowed to do, then the MMU interrupts the CPU. The CPU then executes the code in the starting at a particular address. This address is defined in the interrupt vector table. A table of start addresses, for each interrupt type (some CPUs store instructions in this table, not addresses, but they do the same thing).
edited Apr 12 at 10:23
sourcejedi
26k445114
26k445114
answered Apr 11 at 19:55
ctrl-alt-delorctrl-alt-delor
12.5k52662
12.5k52662
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
add a comment |
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
Thanks a lot for pointing me in the right direction. It solved many of my other queries. Thanks again!!
– Tezeswar
Apr 11 at 22:41
add a comment |
Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.
Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.
Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.
Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511963%2fhow-linux-finds-out-about-illegal-memory-access-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html
– DopeGhoti
Apr 11 at 18:00