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;








1















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.










share|improve this question









New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html

    – DopeGhoti
    Apr 11 at 18:00

















1















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.










share|improve this question









New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html

    – DopeGhoti
    Apr 11 at 18:00













1












1








1








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.










share|improve this question









New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question









New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Apr 12 at 14:29







user288752













New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 11 at 17:37









TezeswarTezeswar

82




82




New contributor




Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Tezeswar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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





Some relevant light reading here: kernel.org/doc/gorman/html/understand/understand007.html

– DopeGhoti
Apr 11 at 18:00










1 Answer
1






active

oldest

votes


















3














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).






share|improve this answer

























  • 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











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.









draft saved

draft discarded


















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









3














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).






share|improve this answer

























  • 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















3














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).






share|improve this answer

























  • 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













3












3








3







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).






share|improve this answer















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).







share|improve this answer














share|improve this answer



share|improve this answer








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

















  • 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










Tezeswar is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In 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 ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided