How to register segmentation errors and runtime errors that can lead to a program crash through the remote logging library?

What is the technique for recording segmentation errors and runtime errors that crash a program through a remote logging library?

Language is C ++.

+3
source share
4 answers

Here is a backtrace print solution when you get segfault , as an example of what you can do when such an error occurs.

. , , , .

+4

segfault , :

"segfault" ,

, (, , ), .

: , .

, ( , , ), "" . (, scp) , segfault , , .

0

:

  • .
  • GDB ( GdbServer), , . enter image description here
0

, ?

, ( ) , APP :

  • TCP , . (TCP , AFAIK. , , )
  • UDP- - UDP
  • , ( , ).
  • TCP/UDP , .

, , . , . , . - " " - , ( ) .

:

. Windows _ set_se_handlers backtrace ++.

In linux, I think you should create a SIGSEGV signal handler.

While segfault capture sounds like a decent idea, instead of trying to deal with it from within the program, it makes sense to generate a kernel dump and a guarantee. In windows, you can use MiniDumpWriteDump from within the program, and on linux you can configure the creation of core dumps in the shell ( ulimit -c, I think?).

0
source

All Articles