dongtan3306 2017-09-06 00:08
浏览 126
已采纳

Laravel 5.5中的Segfaults

I recently started a little project in Laravel 5.5. I updated my Homestead box to the latest version.

While writing a test, I came across a segfault if I spelt an assertion method incorrectly, and I created an issue on the github repo which can be found at https://github.com/laravel/framework/issues/20925

The issue has been closed now, as rightfully, it was my mistake (asertPushedOn() instead of assertPushedOn()).

However I've recently come across another segfault, again, it was my error (incorrectly named relationship when trying to eagerload), but the problem is, this never happened prior to 5.5. Now, it seems when I mess something up, I'm randomly getting segfaults. I cant find anything to help debug them in the logs (Laravel logfile or nginx error log.

The only error message I get is Segmentation fault (core dumped) which doesn't tell me anything.

On the issue report, it mentioned xdebug dumps out the error. I had a google for laravel homestead xdebug but could only find resources for phpstorm (I'm a sublime user).

TL;DR:

1) In Laravel 5.5 with an updated homestead box, I'm getting php segfaults now if I mess up somewhere. Is this a change in 5.5 / homestead?

2) How can I enable xdebug (will this actually help debug segfaults)?

3) If xdebug isn't the answer, how can I stop getting, or get more default debug info from segfaults?

As mentioned in the issue I created, I don't know much about segfaults.

If you need any further information, please let me know

EDIT

I managed to enable xdebug with:

sudo phpenmod xdebug
sudo service nginx restart
php -m

But I've been unable to reproduce the segfault (with and without xdebug enabled), which makes segfaults all the more confusing for me.

  • 写回答

1条回答 默认 最新

  • douzhang2680 2017-09-07 08:34
    关注

    So while I wasn't able to reproduce the original segfault, another one did occur while xdebug wasn't enabled.

    When I enabled xdebug with the following:

    sudo phpenmod xdebug
    sudo service nginx restart
    

    and reran the script which gave me the segfault, I successfully got the recursion error with the filename and line number to resolve it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?