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.

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

报告相同问题?

悬赏问题

  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误