Everything that comes from user input may be validated.
It's easy to check that. Especially that you should get an exception you can catch.For instance, I want to allocate an array
float* array = new float[ size ]
where the "size" comes from user input. If user input "-1", it may crash.
Well then don't forget itBut let's say you forget to check,
Of course this is my personal opinion but applications crashes (let's call intercepting a SIGSEGV a crash as well) are caused by developers, not end-users.Simply crash the application is not a nice way in handling such error. It is much nicer to allow user a chance to save the data so he/she doesn't lose what has been done so far.
It all depends where the crash occurs. Qt is a high level framework. It's not safe to bail out of any method in any place possible. I'm sure if you corrupted the instruction pointer, the solution you mention wouldn't have worked. And it's easy to corrupt the instruction pointer by overwriting the stack frame through buffer overruns for example.I have seen such signal intercepting before. But I don't know how to implement it. The GUI never disappears unless you click "Exit" or "kill -9". It gives error message to allow users choose other approaches.
I'd do the same regardless if they showed me a crash handler dialog or not. If an application crashes, it is badly written. If it crashes and shows a crash handler dialog it is also badly written and the only difference is that developers instead of fixing the bugs in question try to hide them or reduce damage made by them using the mentioned handlers. But the bugs are still there.Last years, we evaluated several vendor applications, there were several applications crashed (GUI disappearing) in the middle of evaluation tests. The testers immediately throw it to junk list...It really makes a big difference...







Reply With Quote

Bookmarks