PHP Classes

Seg Fault on larger images >4MB

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  Seg Fault on larger images >4MB  >  (Un) Subscribe thread alerts  
Subject:Seg Fault on larger images >4MB
Summary:The script mailbox_parse fails on larger images >4MB
Messages:4
Author:Chitiga Georges
Date:2011-09-14 15:39:35
Update:2011-09-16 08:58:49
 

  1. Seg Fault on larger images >4MB   Reply   Report abuse  
Picture of Chitiga Georges Chitiga Georges - 2011-09-14 15:39:36
Hi,
First thing I want to say really nice job on this but I got a issue that I`m confronting for a week here.

So I am using mime_parser, pop3_stream and the script mailbox_browse.php.
Mailbox_browse is a a modified version but nothing in bad, added some queries, some verifications, etc.

I am currently using php 5.2.13, when I run the script and send a email with a large text file >4MB everything works fine but when I send a JPG file larger then 2MB the program crashes and in the log file I see a segmentation fault.

So here it is what I tested:
- modifying fopen mode to "rb" to force binary mode didn't work(made the appropiate line in pop3.php in strcmp($mode, "rb").
- the messages are saved on disk but there are no permissions issues(all files 644 and folders 755)
- Sending big text files works, only large images files.
- There is no memory problems nor on the machine or in php.ini (set to 1024MB)
- No execution time problems too.
- smaller files work.
- It dies while decoding the attachment.
- I believe is from the pop_stream class but unsure of what modifications to do in order this to work

Any help on getting this to decode large jpg attachments will be a great.
Thank you.

  2. Re: Seg Fault on larger images >4MB   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-09-15 08:33:52 - In reply to message 1 from Chitiga Georges
Segmentation fault usually means the PHP version you are using is buggy. Try a newer PHP version and see if still crashes.

  3. Re: Seg Fault on larger images >4MB   Reply   Report abuse  
Picture of Chitiga Georges Chitiga Georges - 2011-09-15 09:19:42 - In reply to message 2 from Manuel Lemos
Thanks Manuel for the fast reply. I will try and update PHP but I wanted to leave this as a last resort because I have a large website on the same server and that means a lot of time spent on upgrading the website and fix issues that might come up with the new version. All I wanted to know if this is a known issue.

Thanks.

  4. Re: Seg Fault on larger images >4MB   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-09-16 08:58:49 - In reply to message 3 from Chitiga Georges
No problem.

PHP scripts by themselves cannot make PHP crash. So, it can only be a problem specific of that PHP version.

In any case, always try any PHP versions on development environments before you upgrade PHP on your server, so you can make sure it will not cause problems with your applications.