Project

General

Profile

Actions

Defect #23962

open

Redmine Out of Memory Exception when exporting issues with lots of columns (> 50) to PDF

Added by Stephane Evr about 8 years ago. Updated over 6 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
PDF export
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

I was able to reproduce the bug descibed hereafter on a bitnami vanilla redmine install. This bug makes the server eventually run out of memory, so is quite severe in my opinion.

Environment:
  Redmine version                3.3.0.stable
  Ruby version                   2.1.10-p492 (2016-04-01) [x86_64-linux]
  Rails version                  4.2.6
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.4
  Cvs                            1.12.13
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  no plugin installed

The bug occurs when trying to export to pdf a list of issues (on the issues page) with a huge amount of columns (around 50 or more). It happens even if there is only 1 issue to export.

To reproduce the bug, you can create around 40 custom fields with a random name (30 chars) / format and assign them to a tracker / project. then create an issue with random content in the fields. Then on the issues page, export to pdf with all columns included.

Because anyway the pdf would not look nice with such big amount of columns, we could perhaps forbid the export if there are too many columns (lets say > 40) selected in the export.

This is what I added to mitigate the error, in app/controllers/issues_controller.rb#index:

if params[:format] == 'pdf' && @query.column_names.count > 40
  redirect_to(:back)
  flash[:error] = "Please reduce the amount of columns selected." 
  return
end

After further investigation, I found the problem to be located in lib/redmine/export/pdf.rb, in the RDMMultiCell method. So it may be due to RBPDF...


Related issues

Has duplicate Redmine - Defect #28337: Problem when creating PDF with too many columnsClosed

Actions
Actions

Also available in: Atom PDF