Segmentation error on Unix - possible stack corruption

I look at the kernel from a process running on Unix. Typically, I can work and have roots in backtrace to try and identify a memory problem. In this case, I’m not sure how to proceed.

Firstly, backtrace only gives 3 frames where I would expect more. For these frames, all the presented function parameters are completely invalid. I did not expect this.

Some pointer parameters are associated with them: it is impossible to access memory at

Will this offer some sort of complete stack damage. I started the process using libumem and all the buffers were declared clean.

umem_status has not reported anything.

so basically I'm at a standstill. What are the likely causes? What should I look for in the code since libumem did not seem to report errors.

Any suggestions on how I can debug work? are there any additional features in mdb that I should consider?

thanks.

+3
source share
5 answers

Damage to the stack seems like an opportunity. Some things to try:

  • Include all compiler warnings you can!
  • Launch lint!
  • If possible, try creating and testing your OpenBSD program, which has a built-in built-in memory corruption detection feature.
  • If possible, use some tools, such as ProPolice, StackGuard, etc.
  • If you can easily reproduce this problem, you should play in the debugger. Limit it as much as possible, and then follow the step.
+4
+3

libumem , ?

, env unix/solaris , libumem ,

0

? , : . , , .

0

. GDB . Valgrind .

Valgrind. , . , .

( NULL), , - .

0

Source: https://habr.com/ru/post/1703909/


All Articles