Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64585

High resolution PDF causes endless GhostScript processing

XMLWordPrintable

    • MOODLE_35_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE

      System:

      • GPL Ghostscript 9.26 on Linux CentOS 7.5.1804
      • 8 cores CPU
      • Moodle 3.5.2+ (Build: 20181031)

      How to reproduce:

      • In Moodle settings:
        • Set GhostScript path in ghostscript
        • Enable assignfeedback_editpdf
      • In a Moodle course:
        • As a teacher, create a new activity "assign"
        • As a student, post the high resolution PDF (see attached) in the activity and submit it to teacher

      Problem:

      GhostScript's process on this PDF will never ending (I waited 96 hours). GhostScript takes 100% of one CPU core and stay stuck on this special PDF. The others PDF files in queue are never processed. I can see the PNG growing very slowly in the data/temp folder but it's like it will never stop growing despite the rendering is stuck at a certain point.

      When I run the same GhostScript's shell command manualy on the PDF file, it takes some minutes but finally success. Here is the shell command:

      /usr/bin/gs -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dDOINTERPOLATE -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=[OUTPUT_FILE_PATH] [INPUT_FILE_PATH]

      I'm not sure if it's a bug or if it's a normal behaviour regarding the resolution of the PDF as nothing appears in the logs. Even so it impacts performances on whole Moodle site and prevent other PDF to be rendered. As there is no control on which PDF students can submit, a limit on what GS will process based on file resolution or execution time could be an improvement (if it's not a bug).

       

        1. Devoir Vélib.pdf
          195 kB
        2. gs-moodle
          0.2 kB

            Votes:
            30 Vote for this issue
            Watchers:
            34 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.