View Issue Details

IDProjectCategoryView StatusLast Update
0011362mantisbtattachmentspublic2010-08-16 06:49
ReporterOlaf123 Assigned Todhx  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.0rc2 
Fixed in Version1.2.1 
Summary0011362: Picture dowload fails wit exhausted memory error with firefox 3.5.7 but not with IE8
Description

When I try to download a small picture (PNG or JPG) that was previously successfully uploaded and is displayed properly as preview, I get a page with a lot of strange characters. At the end the following error message:

<em>Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 524289 bytes) in D:\Programs\xampp\htdocs\Mantis_Ontw\file_download.php on line 191</em>

This only happen with the latest firefox 3.5.7 browser. I don't recall this happening before so I am not entirely sure that the error is in Mantis and has nothing to do with firefox. It does <b>not</b> happen with IE8!

TagsNo tags attached.

Relationships

related to 0006047 confirmed Mimetype of attached files. 
has duplicate 0011602 closeddhx The view.php?id=bugid which have image attachment can't be display 
has duplicate 0011720 closeddhx file_download.php running out of memory 

Activities

Olaf123

Olaf123

2010-01-08 04:29

reporter  

Error.png (12,553 bytes)   
Error.png (12,553 bytes)   
rerbin

rerbin

2010-01-08 04:35

reporter   ~0024094

Please update to the "Nightly Build" version.Download from http://www.mantisbt.org/builds
I met the same problem in the 1.2rc2,but no problem in the version 1.2.0rc2 2010-01-07-master-1.2.x-96813c5

Olaf123

Olaf123

2010-01-11 03:01

reporter   ~0024124

I took the file_download.php from the nightly built. On firefox, the preview disapeared and the download still gave an error. This time it was just the error:
( ! ) Fatal error: Call to undefined function http_content_disposition_header() in D:\Programs\xampp\htdocs\Mantis_Ontw\file_download.php on line 121
Call Stack

Time Memory Function Location

1 0.0018 130408 {main}( ) ..\file_download.php:0

I will try to create a full mantis installation with the nightly built this week.

cor3huis

cor3huis

2010-01-22 11:35

reporter   ~0024225

Last edited: 2010-01-22 11:40

View 2 revisions

Also experienced issue with Firefox 3.5.7 on Karmic MantisBT v1.2RC2 but not anymore on MantisBT 1.2.0rc2 git live as of 20100122

Lots of changes in the respons in the Content-Disposition area.
WRONG
Content-Encoding: gzip
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

OK
Content-Disposition: filename="Error.png"
Content-Length: 12553
Connection: close
Content-Type: image/png

and possible more.

watergad

watergad

2010-02-02 09:39

reporter   ~0024289

Since the download is ok (despite of the error) but the error message is appended,
I was forced to suppress error by "@" in the file_download.php:
@$buffer = file_get_contents.....
Otherwise it breaks or distorts various text files - xml, txt, etc.

Hope this will be fixed somewhen.

dhx

dhx

2010-02-07 08:14

reporter   ~0024339

Can you please use a clean checkout of the latest 1.2.x master or 1.3.x master branches? Overwriting individual files in your old installation with newer files from the git repository won't work. It's an upgrade all or nothing problem :)

With a clean checkout (please specify if you're using 1.2.x or 1.3.x or both), do you still get the memory exhaustion error message appended to the end of the HTTP response?

rerbin

rerbin

2010-02-22 04:19

reporter   ~0024457

I met the problem like this in mantisbt-1.2.0rc2-2010-02-19-master-1.2.x-4a56720.when i view have two small images,the page view.php?id=bugid can't display,i can only see the error message like "Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 524289 bytes)".
but it's hard to reproduce,i only met one time.

Olaf123

Olaf123

2010-02-26 02:33

reporter   ~0024530

Last edited: 2010-02-26 02:33

View 2 revisions

Sorry. I did not have the time to run extensive tests. I downloaded the the 1.2 version that came available. Now it all works again

monotek

monotek

2010-03-10 04:14

reporter   ~0024691

I have this problem too.

I use Mantis 1.2.0 Final and Firefox 3.6 in Windows XP SP3.

IE8 does not show this problem:

Error occurs when i change from view.php (with inline jpg) to view_all_bug_page.php.

<br />
<b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 524289 bytes) in <b>/var/www/mantis/mantis12/file_download.php</b> on line <b>209</b><br />
HTTP/1.1 200 OK
Date: Wed, 10 Mar 2010 09:10:31 GMT
Server: Apache
X-Powered-By: PHP/5.2.4-2ubuntu5.10
Cache-Control: no-store, no-cache, must-revalidate
Last-Modified: Wed, 10 Mar 2010 09:10:31 GMT
Expires: Wed, 10 Mar 2010 09:10:31 GMT
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html;charset=utf-8

b296
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
<html>
<head>
...

arturp

arturp

2010-03-15 05:22

reporter   ~0024747

Last edited: 2010-03-16 03:31

View 2 revisions

I have this problem too. Mantis 1.2.0 Final and Firefox 3.6 in Windows XP SP3.
Problem is also with downloading file (errors, problem with opening files ) not only with memory.

Allowed memory [...] in [...]/file_download.php on line 209

Issue has attached 3 pictures:
72,892 bytes
67,737 bytes
91,242 bytes

memory_limit = 512M in php.ini

SOLUTION from previous version:
file_download.php (line 159)
change file_send_chunk( $t_local_disk_file ) to readfile ( $t_local_disk_file )

monotek

monotek

2010-03-17 09:19

reporter   ~0024776

This seems to fix the problem for mee too.

dhx

dhx

2010-03-31 06:33

reporter   ~0024973

I couldn't reproduce the problem before but this issue seems to keep reappearing. As PHP's readfile() does it's own chunking we don't need a custom implementation of our own. Hopefully this solves all the reports we've been having of file downloads not working nicely with large files.

Please let me know how this fix works out for you.

monotek

monotek

2010-04-01 07:17

reporter   ~0024996

Thanks!

Seems to be fixed.

Cant reproduce in MantisBT 1.2.0 2010-04-01-master-1.2.x-d1d00c0

obones

obones

2010-04-13 08:11

reporter   ~0025114

Last edited: 2010-04-13 08:21

View 2 revisions

Works for me too, I applied the first diff to the 1.2.0 installation I have here, it now works just fine.

Note: I have no idea what the second diff is for, it seems it does not apply to the 1.2.0 release

Related Changesets

MantisBT: master-1.2.x f845ed54

2010-03-31 10:11:33

dhx

Details Diff
Fix 0011362: Use readfile instead of custom file_send_chunk

PHP's inbuilt readfile() function already does its own internal
chunking. We should use this function instead of our own file chunk
reading function to improve reliability and performance.
Affected Issues
0011362
mod - file_download.php Diff File

MantisBT: master fbfdfe40

2010-03-31 10:11:33

dhx

Details Diff
Fix 0011362: Use readfile instead of custom file_send_chunk

PHP's inbuilt readfile() function already does its own internal
chunking. We should use this function instead of our own file chunk
reading function to improve reliability and performance.
Affected Issues
0011362
mod - file_download.php Diff File

Issue History

Date Modified Username Field Change
2010-01-08 04:29 Olaf123 New Issue
2010-01-08 04:29 Olaf123 File Added: Error.png
2010-01-08 04:35 rerbin Note Added: 0024094
2010-01-11 03:01 Olaf123 Note Added: 0024124
2010-01-22 11:35 cor3huis Note Added: 0024225
2010-01-22 11:40 cor3huis Note Edited: 0024225 View Revisions
2010-02-02 09:39 watergad Note Added: 0024289
2010-02-07 08:10 dhx Relationship added related to 0006047
2010-02-07 08:14 dhx Note Added: 0024339
2010-02-07 08:15 dhx Status new => feedback
2010-02-22 04:19 rerbin Note Added: 0024457
2010-02-26 02:33 Olaf123 Note Added: 0024530
2010-02-26 02:33 Olaf123 Status feedback => new
2010-02-26 02:33 Olaf123 Note Edited: 0024530 View Revisions
2010-03-10 04:14 monotek Note Added: 0024691
2010-03-15 05:22 arturp Note Added: 0024747
2010-03-16 03:31 arturp Note Edited: 0024747 View Revisions
2010-03-17 09:19 monotek Note Added: 0024776
2010-03-31 06:06 dhx Relationship added has duplicate 0011602
2010-03-31 06:07 dhx Relationship added has duplicate 0011720
2010-03-31 06:30 dhx Resolution open => fixed
2010-03-31 06:30 dhx Fixed in Version => 1.3.0-beta.1
2010-03-31 06:30 dhx Changeset attached master-1.2.x f845ed54 =>
2010-03-31 06:30 dhx Changeset attached master fbfdfe40 =>
2010-03-31 06:33 dhx Note Added: 0024973
2010-03-31 06:33 dhx Status new => resolved
2010-03-31 06:33 dhx Fixed in Version 1.3.0-beta.1 => 1.2.2
2010-03-31 06:33 dhx Assigned To => dhx
2010-04-01 07:17 monotek Note Added: 0024996
2010-04-13 08:11 obones Note Added: 0025114
2010-04-13 08:21 obones Note Edited: 0025114 View Revisions
2010-04-23 14:31 jreese Status resolved => closed