Core dumped or segmentation fault with Xdebug

It started a couple months ago that while debugging the code I would get an occasional error like

free(): invalid pointer
Aborted (core dumped)

or

Segmentation fault (core dumped)

This was quite frustrating, I had to resort to print_r or just plain guessing. Searching on the internet showed that there are other people who are facing a similar issue.

https://bugs.xdebug.org/view.php?id=1916

https://bugs.xdebug.org/view.php?id=2038

But unfortunately for both the issues, the tickets are just closed because of lack of reproducability.

I played around with a bunch of xdebug settings like setting mode to develop, changing nesting levels etc to no avail.

Decided to tweak around the PHPStorm settings, and it seemed to do the trick.

The solution for me was to disable some options in Debug Evaluation. I started with disabling everything which made it work for the point in code where it was always failing, but then I settled for just disabling ‘__toString’ object view.


This is working for now and would maybe try disabling other options if I face this issue again.
Posted in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *