mapfish / mapfish-print

A component of MapFish for printing templated cartographic maps. This module is the Java serverside module.
http://mapfish.github.io/mapfish-print-doc/
BSD 2-Clause "Simplified" License
183 stars 416 forks source link

Docker container hangs on M1 Mac environment #3332

Closed sanak closed 1 week ago

sanak commented 2 weeks ago

Context

Describe the bug

I am trying to launch the following folder contents, https://github.com/gtt-project/redmine_gtt_print/tree/1.1-stable/server-example

but when requesting default template print, Docker container hangs with the following fatal error.

mapfish-print-1  | #
mapfish-print-1  | # A fatal error has been detected by the Java Runtime Environment:
mapfish-print-1  | #
mapfish-print-1  | #  SIGSEGV (0xb) at pc=0x00007ffffe73708e, pid=1, tid=84
mapfish-print-1  | #
mapfish-print-1  | # JRE version: OpenJDK Runtime Environment 18.9 (11.0.16+8) (build 11.0.16+8)
mapfish-print-1  | # Java VM: OpenJDK 64-Bit Server VM 18.9 (11.0.16+8, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
mapfish-print-1  | # Problematic frame:
mapfish-print-1  | # V  [libjvm.so+0x74f08e]  G1ParEvacuateFollowersClosure::do_void()+0x1be
mapfish-print-1  | #
mapfish-print-1  | # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
mapfish-print-1  | #
mapfish-print-1  | # An error report file with more information is saved as:
mapfish-print-1  | # /usr/local/tomcat/webapps/ROOT/hs_err_pid1.log
mapfish-print-1  | #
mapfish-print-1  | # If you would like to submit a bug report, please visit:
mapfish-print-1  | #   https://bugreport.java.com/bugreport/crash.jsp
mapfish-print-1  | #
mapfish-print-1  | 
mapfish-print-1  | [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007fffff3c6602]
mapfish-print-1  | 
mapfish-print-1 exited with code 127

I tried to use v33.0 with the following diff, but it also hangs.

--- a/server-example/docker-compose.yml
+++ b/server-example/docker-compose.yml
@@ -1,8 +1,7 @@
-version: '3.4'
-
 services:
   mapfish-print:
-    image: camptocamp/mapfish_print:3.28
+    image: camptocamp/mapfish_print:3.30
+    platform: linux/amd64
     ports:
Error log on v3.30 ``` mapfish-print-1 | WARNING: An illegal reflective access operation has occurred mapfish-print-1 | WARNING: Illegal reflective access by net.sf.jasperreports.engine.util.ClassUtils (file:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/jasperreports-6.20.6.jar) to constructor com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl() mapfish-print-1 | WARNING: Please consider reporting this to the maintainers of net.sf.jasperreports.engine.util.ClassUtils mapfish-print-1 | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations mapfish-print-1 | WARNING: All illegal access operations will be denied in a future release mapfish-print-1 | # mapfish-print-1 | # A fatal error has been detected by the Java Runtime Environment: mapfish-print-1 | # mapfish-print-1 | # SIGSEGV (0xb) at pc=0x00007fffe07ebd55, pid=1, tid=89 mapfish-print-1 | # mapfish-print-1 | # JRE version: OpenJDK Runtime Environment Temurin-11.0.23+9 (11.0.23+9) (build 11.0.23+9) mapfish-print-1 | # Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (11.0.23+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64) mapfish-print-1 | # Problematic frame: mapfish-print-1 | # j sun.security.ssl.HandshakeOutStream.flush()V+11 java.base@11.0.23 mapfish-print-1 | # mapfish-print-1 | # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again mapfish-print-1 | # mapfish-print-1 | # An error report file with more information is saved as: mapfish-print-1 | # /usr/local/tomcat/webapps/ROOT/hs_err_pid1.log mapfish-print-1 | [thread 84 also had an error] mapfish-print-1 | [thread 86 also had an error] mapfish-print-1 | Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled mapfish-print-1 | # mapfish-print-1 | # If you would like to submit a bug report, please visit: mapfish-print-1 | # https://github.com/adoptium/adoptium-support/issues mapfish-print-1 | # mapfish-print-1 | mapfish-print-1 | [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007fffff1ff898] mapfish-print-1 | mapfish-print-1 exited with code 127 ```

How to reproduce

Same as above default-list.zip - requestData-default-list.json.

{
  "layout": "default-list",
  "outputFilename": "gtt-print-default-list",
  "outputFormat": "pdf",
  "attributes": {
    "custom_text": "Custom Text",
    "datasource": [
      {
        "table" : {
          "columns": ["id", "status", "start_date", "created_on", "assigned_to_name", "subject"],
          "data": [
            ["1", "New", "2018/06/24", "2018/06/24 10:11", "user1", "Title1"],
            ["2", "New", "2018/06/24", "2018/06/24 10:05", "user2", "Title2"],
            ["3", "New", "2018/06/22", "2018/06/22 14:41", "user3", "Title3"]
          ]
        }
      }
    ]
  }
}

Actual results

No obtained results due to hangs. Log is as follows.

mapfish-print-1  | WARNING: An illegal reflective access operation has occurred
mapfish-print-1  | WARNING: Illegal reflective access by net.sf.jasperreports.engine.util.ClassUtils (file:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib/jasperreports-6.20.6.jar) to constructor com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl()
mapfish-print-1  | WARNING: Please consider reporting this to the maintainers of net.sf.jasperreports.engine.util.ClassUtils
mapfish-print-1  | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
mapfish-print-1  | WARNING: All illegal access operations will be denied in a future release
mapfish-print-1  | 08:45:29.453 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.453 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.461 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.461 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.463 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.466 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.466 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.467 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.467 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.467 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.469 [ForkJoinPool-1-worker-115] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | 08:45:29.469 [ForkJoinPool-1-worker-229] WARN  n.s.j.engine.xml.JRTextFieldFactory - The 'isStretchWithOverflow' attribute is deprecated. Use the 'textAdjust' attribute instead.
mapfish-print-1  | #
mapfish-print-1  | # A fatal error has been detected by the Java Runtime Environment:
mapfish-print-1  | #
mapfish-print-1  | #  SIGSEGV (0xb) at pc=0x00007ffffe4cdf29, pid=1, tid=76
mapfish-print-1  | #
mapfish-print-1  | # JRE version: OpenJDK Runtime Environment Temurin-11.0.23+9 (11.0.23+9) (build 11.0.23+9)
mapfish-print-1  | # Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (11.0.23+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
mapfish-print-1  | # Problematic frame:
mapfish-print-1  | # V  [libjvm.so+0xacdf29]  LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, Thread*)+0x159
mapfish-print-1  | #
mapfish-print-1  | # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
mapfish-print-1  | #
mapfish-print-1  | # An error report file with more information is saved as:
mapfish-print-1  | # /usr/local/tomcat/webapps/ROOT/hs_err_pid1.log
mapfish-print-1  | #
mapfish-print-1  | # If you would like to submit a bug report, please visit:
mapfish-print-1  | #   https://github.com/adoptium/adoptium-support/issues
mapfish-print-1  | #
mapfish-print-1  | 
mapfish-print-1  | [error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007fffff1ff898]
mapfish-print-1  | 
mapfish-print-1 exited with code 127

Expected results

PDF should be generated without hangs.

sanak commented 1 week ago

Well, I seem to hit the following Docker Desktop for Apple Silicon issue.

Obviously, it seems to be Docker Desktop side issue, so I close this issue. 🙇