0

I have an application that is segfaulting inside the following boost function:

boost::filesystem::detail::symlink_status

It is happenening inside the libboost_filesystem.so.1.5.7.0.

The line of code in my app that is calling into the .so is:

boost::filesystem::remove_all(*path, error);

The issue only happens in certain use cases. In others, there is no seg fault and it works fine.

How can I root cause this issue?

NutCracker
  • 10,520
  • 2
  • 39
  • 66
rohitsan
  • 889
  • 6
  • 26
  • 2
    Segfaults 99% of the time are caused by de-referencing a null pointer, check that your `path` pointer is valid. – gct Jan 23 '20 at 18:50
  • 1
    Another common killer is dereferencing a pointer that references an object that's gone out of scope (such as a local variable returned from a function) or been already released (via [Rule of Three](https://stackoverflow.com/questions/4172722/what-is-the-rule-of-three) violation or other faulty logic). Un fortunaltely there is too little information here to be able to provide a concrete answer to your problem. I recommend making a [mcve] and if that doesn't reveal the problem and solution to you, update the question with the [mcve]. – user4581301 Jan 23 '20 at 18:59
  • The pointer is not null (I wish it would have been that simple). By looking at the gdb stack trace, I discovered that the seg fault is happening inside boost::file_system::detail::symlink_status. – rohitsan Jan 23 '20 at 19:11
  • 1
    Step one, use your debugger. [What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/q/25385173/5910058). Step two; use sanitizers, such as AddressSanitizer (and friends). – Jesper Juhl Jan 23 '20 at 19:46
  • i did use my debugger. that's how i found out it was crashing in boost::file_system::detail::symlink_status. I verified that all the pointers are valid. Could it be something wrong with my file system? – rohitsan Jan 24 '20 at 18:39

0 Answers0