program received signal SIGSEGV, segmentation faul

2019-08-20 14:47发布

I am running a program in multi threaded environment it fails at some point. when i tried it with gdb than it is shoing the following error.

program received signal SIGSEGV, segmentation fault.

[switching to thread 0x7fff677b700 (LWP 2777)] 0x00007ffff7aa42b9 in process_incomplete_rows (resultset=0x507950) at c/mgmt.c:479 479 c/mgmt.c: No such file or directory.

mgmt.c file is there and this code is working fine for some options but 2 or three options its giving this error. What could be the cause of this error. Its error in comiplation or in coe? or its error while accessing some data?

2条回答
劳资没心,怎么记你
2楼-- · 2019-08-20 14:54

A segmentation fault is a runtime error that is usually due to referencing an invalid pointer. Usually that invalid pointer has never been initialized, but sometimes it is reusing an old pointer or writing past the end of an allocated memory chunk (such as past the end of a string).

查看更多
男人必须洒脱
3楼-- · 2019-08-20 14:56

It probably means that your node variable is either NULL or corrupted. Run your program in the debugger, stepping through it from some point prior to the crash up until it and see where you've messed it up. Or use one of the automated tools like Purify or Insure++ to track it down for you.

查看更多
登录 后发表回答