Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have setup default Ubuntu Server 12.04 on Amazon EC2 micro instance. I've setup the usual, PHP, Apache, MySQL, etc. Everything runs ok, until I try to upload some file via PHP. The file size does not matter. It happens even with 5kb jpeg file. What I get is:

[Thu Nov 08 18:52:11 2012] [notice] child pid 1199 exit signal Segmentation fault (11)

When I execute the same code, but without ataching the image, it works (but I need the image, of course)

I have to note that exactly the same code is working great on an OpenSUSE 11.1 machine, I'm just moving it on Amazon instance for further testing. I've setup dozens of servers and never encountered this error. I really am stuck, as I could not find anything related.

uname -a gives

Linux server 3.2.0-31-virtual #50-Ubuntu SMP Fri Sep 7 16:36:36 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Apache/2.2.22 (Ubuntu), PHP 5.3.10-1ubuntu3.4

php variables:

post_max_size   150M
memory_limit    256M
upload_max_filesize 150M

Note: I also added swap file 2Gb, and also tested the same on a bigger EC2 instance with 1.7Gb of RAM, just in case, and the result was exactly the same, so it's not insufficient memory.

share|improve this question
    
Does dropping the post_max_size and upload_max_filesize help? –  David Schwartz Nov 8 '12 at 22:08
    
No, it was initially very low and it was the same. –  kkazakov Nov 9 '12 at 3:48

1 Answer 1

up vote 0 down vote accepted

I have finally resolved it. Turns out, there's a bug in imagefillborder() method. I was able to trace it to these rows, both failing:

I have to note that this code WORKS on PHP 5.2.x, so this means it's a new introduced bug in 5.3.x.

My image size is 296 px x 296 px. I'm creating rounded corners and filling all four corners with a color. These that fail are the top right and bottom right corners ( notice the second value matches the image size ). When I decrement with 1px, it works as supposed.

Really weird bug.

This one segfaults:

imagefilltoborder(Resource id #95, 296, 0, 1924607, 1924607);
imagefilltoborder(Resource id #95, 296, 296, 1924607, 1924607);

This one works:

imagefilltoborder(Resource id #96, 296-1, 0, 11333839, 11333839);
imagefilltoborder(Resource id #96, 296-1, 296-1, 11333839, 11333839);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.