Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - What does "Segmentation fault (core dumped)"-Error means?

Tags:

php

I wrote a simple crawler using Simple HTML Dom Parser to scrape some stuff.

It's a simple script only running with 1 process and nothing massive. But after some time it produces a "Segmentation fault (core dumped)"-error, when I am running it in the shell.

When I run the script in the browser it says

"Error: The connection to the server was reset while the page was loading.".

I have made sure to unset() every variable as soon as possible and also increased the memory_limit in php.ini, but still I get this error :/

Does someone know what it means and how to solve it?

Thanks for any suggestions!

like image 999
Crayl Avatar asked Mar 30 '13 04:03

Crayl


People also ask

What is core dumped in segmentation fault?

Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.” When a piece of code tries to do read and write operation in a read only location in memory or freed block of memory, it is known as core dump. It is an error indicating memory corruption.

What is meant by segmentation fault?

A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core . Segfaults are caused by a program trying to read or write an illegal memory location.

What causes SIGSEGV?

A SIGSEGV signal or segmentation error occurs when a process attempts to use a memory address that was not assigned to it by the MMU.


1 Answers

I have this problem when a made a recursive loop by accident, so it runs out of memory. But the way it tells me is by making a Segmentation fault (core dumped) error!

So look a the code you most recently wrote and check if you made a error like this! My example was very simple (and stupid). I was just a little to fast to accept the autocomplete's suggestion :)

public function getAttendees()
{
    return $this->getAttendees();
}

Hope this can help someone in the future

like image 95
Visti K Avatar answered Sep 21 '22 22:09

Visti K