Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve "The process has been signaled with signal 11" - Snappy Library?

I am using a Snappy PDF library in Laravel 5.7. Locally it works everything fine, but in my dev environment I get this error: The process has been signaled with signal "11". Till now I was not able to find a solution that would help me. This is my code in controller:

   public function pdfReport(Request $request){
    $pdf = \Snappy::loadView('index', compact(
                  'name', 'lname', 'date', 'address'
                  ))
                  ->setOrientation('portrait')
                  ->setOption('margin-bottom', 0)
                  ->setOption('margin-top', 0)
                  ->setOption('margin-left', 0)
                  ->setOption('margin-right', 0);
     return $pdf->download(str_replace(' ', '', $request->description) . Carbon::now()->format('dYm_His') . '.pdf');
  }

Any help is appreciated!!!

like image 748
Felicity Avatar asked Sep 05 '25 03:09

Felicity


1 Answers

This is probably not related to the OP's question, but in case anyone else is getting this, it might be helpful:

In my case, the The process has been signaled with signal "11" exception was linked to an infinite loop. I encountered this exception when running a test case that was stuck in a self-calling recursion.

More generally speaking, a signal 11 is a segmentation fault, and the exception is raised by the Symfony Process class. A segmentation fault is usually an illegal memory access and can be caused by a buffer or stack overflow.

So, in my case, it was a stack overflow due to the infinite recursion.

like image 121
Lupinity Labs Avatar answered Sep 07 '25 23:09

Lupinity Labs