0

My application randomly and rarely crashes with segmentation fault signal. When coredump is opened in GDB following can be seen:

  • arm instruction leading to crash is:

    0x7f8ea08130 fd 7b b7 a9 stp x29, x30, [sp,#-144]!

  • When code of crashed frame is browsed in GDB, breakpoint stops at opening curly brace of a function:
 void SomeClass::someMethod(const std::string& s, int i)
 >{  
    ...
  }
  • examining of 'sp' register gives following output:
x $sp
>~"0x7fc761a070:\t0xc761a270\n" 

x $sp-144\n"
>~"0x7fc7619fe0:\t"
>&"Cannot access memory at address 0x7fc7619fe0\n"
>169^error,msg="Cannot access memory at address 0x7fc7619fe0" 
  • stack trace seems fine and not corrupted
  • there are roughly 300 frames in stack and stack size limit is set to be 8192K

UPD: the pagesize in the system is 4k:

>grep -i pagesize /proc/1/smaps
KernelPageSize:        4 kB
MMUPageSize:           4 kB

What else I can check to debug this issue?

senx
  • 630
  • 9
  • 18
  • What is the memory page size on your system? It seems that the local stack frame is big enough for `$sp-144` to cross a 4K-page boundary. So it's quite possible that the crash is due to a missing stack page. Maybe it's just a stack overflow (sorry, no pun intended). Did you use some unusual compiler option to disable stack poking (something to do with gcc's `__chkstk`)? – Igor G Nov 11 '19 at 12:18
  • @IgorG page size is 4K. I don't think it is a stack overflow - there roughly 300 frames in stack and the limit for stack size is set to be 8Mb. – senx Nov 11 '19 at 12:32
  • @IgorG regarding the unusual compiler flags - we use strong stack protection - -fstack-protector-strong – senx Nov 25 '19 at 13:40
  • Are you saying that it was a stack guard page that caused the fault? – Igor G Nov 27 '19 at 13:16

0 Answers0