Quantcast
Channel: Why is a segmentation fault not recoverable? - Stack Overflow
Browsing all 17 articles
Browse latest View live

Answer by Phill W. for Why is a segmentation fault not recoverable?

Your program cannot recover from a segmentation fault because it has no idea what state anything is in.Consider this analogy.You have a nice house in Maine with a pretty front garden and a stepping...

View Article



Answer by Kafein for Why is a segmentation fault not recoverable?

Depends what you mean by recovery. The only sensible recovery in case the OS sends you the SEGV signal is to clean up your program and spin another one from the start, hopefully not hitting the same...

View Article

Answer by ghellquist for Why is a segmentation fault not recoverable?

As you use the term SIGSEGV I believe you are using a system with an operating system and that the problem occurs in your user land application.When the application gets the SIGSEGV it is a symptom of...

View Article

Answer by Alex D for Why is a segmentation fault not recoverable?

While your question asks specifically about segmentation faults, the real question is:If a software or hardware component is commanded to do something nonsensical or even impossible, what should it do?...

View Article

Answer by Simon Richter for Why is a segmentation fault not recoverable?

It is absolutely possible, but this would duplicate existing functionality in a less stable way.The kernel will already receive a page fault exception when a program accesses an address that is not yet...

View Article


Answer by Peter Cordes for Why is a segmentation fault not recoverable?

A segfault happens when your program tries to dereference a bad pointer. (See below for a more technical version of that, and other things that can segfault.) At that point, your program has already...

View Article

Answer by bta for Why is a segmentation fault not recoverable?

Segmentation faults were a constant thorn in my side for many years. I worked primarily on embedded platforms and since we were running on bare metal, there was no file system on which to record a core...

View Article

Answer by Zachary Kraus for Why is a segmentation fault not recoverable?

Honestly if I could tell the computer to ignore a segmentation fault. I would not take this option.Usually the segmentation fault occurs because you are dereferencing either a null pointer or a...

View Article


Answer by Cort Ammon for Why is a segmentation fault not recoverable?

Your program is an undertermined state because C can't define the state. The bugs which cause these errors are undefined behavior. This is the nastiest class of bad behaviors.The key issue with...

View Article


Answer by Paul Z for Why is a segmentation fault not recoverable?

The thing you have to understand about segmentation faults is that they are not a problem. They are an example of the Lord's near-infinite mercy (according to an old professor I had in college). A...

View Article

Answer by Chris Dodd for Why is a segmentation fault not recoverable?

Please explain why after a segmentation fault the program is in an undetermined stateI think this is your fundamental misunderstanding -- the SEGV does not cause the undetermined state, it is a symptom...

View Article

Answer by NoSenseEtAl for Why is a segmentation fault not recoverable?

It is recoverable, but it is usually a bad idea.For example Microsoft C++ compiler has option to turn segfaults into exceptions.You can see the Microsoft SEH documentation, but even they do not suggest...

View Article

Answer by supercat for Why is a segmentation fault not recoverable?

At the machine-code level, many platforms would allow programs that are "expecting" segmentation faults in certain circumstances to adjust the memory configuration and resume execution. This may be...

View Article


Answer by Poopoo for Why is a segmentation fault not recoverable?

So far, answers and comments have responded through the lens of a higher-level programming model, which fundamentally limits the creativity and potential of the programmer for their convenience. Said...

View Article

Answer by t.niese for Why is a segmentation fault not recoverable?

This might not be a complete answer, and it is by no means complete or accurate, but it doesn't fit into a commentSo a SIGSEGV can occur when you try to access memory in a way that you should not (like...

View Article


Answer by Lundin for Why is a segmentation fault not recoverable?

When exactly does segmentation fault happen (=when is SIGSEGV sent)?When you attempt to access memory you don’t have access to, such as accessing an array out of bounds or dereferencing an invalid...

View Article

Why is a segmentation fault not recoverable?

Following a previous question of mine, most comments say "just don't, you are in a limbo state, you have to kill everything and start over". There is also a "safeish" workaround.What I fail to...

View Article

Browsing all 17 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>