Segmentation violation on Docker using MCR

1 view (last 30 days)
Hi there. I'm trying to run two function exported via Matlab Compiler in a Java application running inside a Docker container.
The installation of MCR inside the container is successful:
Step 37/67 : RUN ./install -destinationFolder /opt/mcr -agreeToLicense yes -mode silent
---> Running in 382605e4e0ac
Preparing installation files ...
Installing ...
(Jun 26, 2017 08:32:51) ##################################################################
(Jun 26, 2017 08:32:51) #
(Jun 26, 2017 08:32:51) # Today's Date:
(Jun 26, 2017 08:32:51) Mon Jun 26 08:32:51 UTC 2017
(Jun 26, 2017 08:32:51)
(Jun 26, 2017 08:32:51) System Info
(Jun 26, 2017 08:32:51) OS: Linux 4.4.0-81-generic
(Jun 26, 2017 08:32:51) Arch: amd64
(Jun 26, 2017 08:32:51) Data Model: 64
(Jun 26, 2017 08:32:51) Language: en
(Jun 26, 2017 08:32:51) Java Vendor: Oracle Corporation
(Jun 26, 2017 08:32:51) Java Home: /tmp/mathworks_5/sys/java/jre/glnxa64/jre
(Jun 26, 2017 08:32:51) Java Version: 1.7.0_60
(Jun 26, 2017 08:32:51) Java VM Name: Java HotSpot(TM) 64-Bit Server VM
(Jun 26, 2017 08:32:51) Java Class Path: /tmp/mathworks_5/java/config/installagent/pathlist.jar
(Jun 26, 2017 08:32:51) User Name: root
(Jun 26, 2017 08:32:51) Current Directory: /tmp/mathworks_5
(Jun 26, 2017 08:32:51) Input arguments:
(Jun 26, 2017 08:32:51) root /opt/mcr_installer
(Jun 26, 2017 08:32:51) libdir /tmp/mathworks_5
(Jun 26, 2017 08:32:51) destinationFolder /opt/mcr
(Jun 26, 2017 08:32:51) agreeToLicense yes
(Jun 26, 2017 08:32:51) mode silent
(Jun 26, 2017 08:32:51) standalone true
(Jun 26, 2017 08:32:51) connectionMode OFFLINE_ONLY
(Jun 26, 2017 08:32:52) Starting local product/component search in download directory
(Jun 26, 2017 08:32:52) Searching for archives...
(Jun 26, 2017 08:32:52) Reading /opt/mcr_installer/archives
(Jun 26, 2017 08:32:52) Assembling product list...
(Jun 26, 2017 08:32:52) 1467 files found in /opt/mcr_installer/archives
(Jun 26, 2017 08:32:52) Reading /opt/mcr_installer
(Jun 26, 2017 08:32:52) 9 files found in /opt/mcr_installer
(Jun 26, 2017 08:32:52) Archive search complete. 1476 total files found.
(Jun 26, 2017 08:32:55) Completed local product/component search
(Jun 26, 2017 08:32:55) Starting local product/component search in download directory
(Jun 26, 2017 08:32:55) Searching for archives...
(Jun 26, 2017 08:32:55) /opt/mcr/v92/archives doesn't exist ... skipping.
(Jun 26, 2017 08:32:55) Archive search complete. 0 total files found.
(Jun 26, 2017 08:32:55) Completed local product/component search
(Jun 26, 2017 08:32:56) Installing Product: MATLAB Runtime - Builder JA 9.2
(Jun 26, 2017 08:33:01) Installing Product: MATLAB Runtime - Core 9.2
(Jun 26, 2017 08:33:31) Installing Product: MATLAB Runtime - GPU 9.2
(Jun 26, 2017 08:33:55) Installing Product: MATLAB Runtime - Hadoop And Spark 9.2
(Jun 26, 2017 08:33:55) Installing Product: MATLAB Runtime - NET And XL 9.2
(Jun 26, 2017 08:33:55) Installing Product: MATLAB Runtime - Numerics 9.2
(Jun 26, 2017 08:34:11) Notes:
On the target computer, append the following to your LD_LIBRARY_PATH environment variable:
/opt/mcr/v92/runtime/glnxa64:/opt/mcr/v92/bin/glnxa64:/opt/mcr/v92/sys/os/glnxa64:
(Jun 26, 2017 08:34:11) Exiting with status 0
(Jun 26, 2017 08:34:11) End - Successful.
Finished
---> 58937614b2e4
Also the
MWApplication.initialize(MWMCROption.NODISPLAY, MWMCROption.logFile("/opt/matlab_from_java.log"))
is executed without problems and the
MWApplication.isMCRInitialized()
When the application try to use the exported Class1 I got a Segmentation violation during CFT reading I think.
------------------------------------------------------------------------
Segmentation violation detected at Mon Jun 26 08:59:48 2017
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
GNU C Library : 2.19 stable
Host Name : 7603c1c623d7
MATLAB Architecture : glnxa64
MATLAB Root : /opt/mcr/v92
MATLAB Version : 9.2.0.538062 (R2017a)
Operating System : Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2 (2017-04-30) x86_64
Processor ID : x86 Family 6 Model 45 Stepping 7, GenuineIntel
Fault Count: 1
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 00007fa072311e40 RBX = 0000000000000000
RCX = 0000000000000000 RDX = 0000000000000001
RSP = 00007fa072311720 RBP = 00007fa07231af80
RSI = 0000000000000000 RDI = 00007fa07231176f
R8 = 0000000000000000 R9 = 00007fa0a412fbd0
R10 = 00007fa0a41a5080 R11 = 0000000000000000
R12 = 00007fa07231176f R13 = 00007fa07231b2a0
R14 = 00007fa0d10919e8 R15 = 00007fa07231b610
RIP = 00007fa0c55d33a3 EFL = 0000000000010202
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fa0c55d33a3 /opt/mcr/v92/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6+00537507 _ZNSi6sentryC2ERSib+00000019
[ 1] 0x00007fa0c55d46fa /opt/mcr/v92/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6+00542458 _ZNSi5tellgEv+00000026
[ 2] 0x00007fa089efaa65 bin/glnxa64/libmwmclmcr.so+03119717 _ZN6mclmcr12CtfExtractorC1EN5boost10shared_ptrISiEENS1_8functionIFmPKcS6_EEE+00000117
[ 3] 0x00007fa089e87cc6 bin/glnxa64/libmwmclmcr.so+02649286 _Z25mclMakeCtfStreamExtractorN5boost10shared_ptrISiEE+00000118
[ 4] 0x00007fa08bae5e59 /opt/mcr/v92/bin/glnxa64/libnativemcl.so+01121881 Java_com_mathworks_toolbox_javabuilder_internal_MWMCR_mclInitializeComponentInstance+00001081
[ 5] 0x00007fa0cd012d98 <unknown-module>+00000000
[ 6] 0x00007fa0cd006233 <unknown-module>+00000000
[ 7] 0x00007fa0cd006233 <unknown-module>+00000000
[ 8] 0x00007fa0cd0004e7 <unknown-module>+00000000
[ 9] 0x00007fa0d7a950a5 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06299813
[ 10] 0x00007fa0d7a93b08 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06294280
[ 11] 0x00007fa0d7d29caf /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09006255
[ 12] 0x00007fa0d7d2aa60 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09009760
[ 13] 0x00007fa0d7b11383 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06808451 JVM_InvokeMethod+00000483
[ 14] 0x00007fa0cd012d98 <unknown-module>+00000000
[ 15] 0x00007fa0cd006233 <unknown-module>+00000000
[ 16] 0x00007fa0cd006233 <unknown-module>+00000000
[ 17] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 18] 0x00007fa0cd006233 <unknown-module>+00000000
[ 19] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 20] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 21] 0x00007fa0cd006233 <unknown-module>+00000000
[ 22] 0x00007fa0cd006233 <unknown-module>+00000000
[ 23] 0x00007fa0cd006233 <unknown-module>+00000000
[ 24] 0x00007fa0cd006058 <unknown-module>+00000000
[ 25] 0x00007fa0cd006058 <unknown-module>+00000000
[ 26] 0x00007fa0cd006058 <unknown-module>+00000000
[ 27] 0x00007fa0cd006233 <unknown-module>+00000000
[ 28] 0x00007fa0cd0004e7 <unknown-module>+00000000
[ 29] 0x00007fa0d7a950a5 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06299813
[ 30] 0x00007fa0d7a93b08 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06294280
[ 31] 0x00007fa0d7d29caf /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09006255
[ 32] 0x00007fa0d7d2aa60 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09009760
[ 33] 0x00007fa0d7b11383 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06808451 JVM_InvokeMethod+00000483
[ 34] 0x00007fa0cd012d98 <unknown-module>+00000000
[ 35] 0x00007fa0cd006233 <unknown-module>+00000000
[ 36] 0x00007fa0cd006233 <unknown-module>+00000000
[ 37] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 38] 0x00007fa0cd006233 <unknown-module>+00000000
[ 39] 0x00007fa0cd006233 <unknown-module>+00000000
[ 40] 0x00007fa0cd006233 <unknown-module>+00000000
[ 41] 0x00007fa0cd006058 <unknown-module>+00000000
[ 42] 0x00007fa0cd006233 <unknown-module>+00000000
[ 43] 0x00007fa0cd006233 <unknown-module>+00000000
[ 44] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 45] 0x00007fa0cd006058 <unknown-module>+00000000
[ 46] 0x00007fa0cd006058 <unknown-module>+00000000
[ 47] 0x00007fa0cd006058 <unknown-module>+00000000
[ 48] 0x00007fa0cd006058 <unknown-module>+00000000
[ 49] 0x00007fa0cd006058 <unknown-module>+00000000
[ 50] 0x00007fa0cd006058 <unknown-module>+00000000
[ 51] 0x00007fa0cd006706 <unknown-module>+00000000
[ 52] 0x00007fa0cd006058 <unknown-module>+00000000
[ 53] 0x00007fa0cd006706 <unknown-module>+00000000
[ 54] 0x00007fa0cd006706 <unknown-module>+00000000
[ 55] 0x00007fa0cd006058 <unknown-module>+00000000
[ 56] 0x00007fa0cd006706 <unknown-module>+00000000
[ 57] 0x00007fa0cd006058 <unknown-module>+00000000
[ 58] 0x00007fa0cd006706 <unknown-module>+00000000
[ 59] 0x00007fa0cd006058 <unknown-module>+00000000
[ 60] 0x00007fa0cd006706 <unknown-module>+00000000
[ 61] 0x00007fa0cd006058 <unknown-module>+00000000
[ 62] 0x00007fa0cd006706 <unknown-module>+00000000
[ 63] 0x00007fa0cd006058 <unknown-module>+00000000
[ 64] 0x00007fa0cd006706 <unknown-module>+00000000
[ 65] 0x00007fa0cd006058 <unknown-module>+00000000
[ 66] 0x00007fa0cd006706 <unknown-module>+00000000
[ 67] 0x00007fa0cd006058 <unknown-module>+00000000
[ 68] 0x00007fa0cd006706 <unknown-module>+00000000
[ 69] 0x00007fa0cd006058 <unknown-module>+00000000
[ 70] 0x00007fa0cd006706 <unknown-module>+00000000
[ 71] 0x00007fa0cd006058 <unknown-module>+00000000
[ 72] 0x00007fa0cd006058 <unknown-module>+00000000
[ 73] 0x00007fa0cd006706 <unknown-module>+00000000
[ 74] 0x00007fa0cd006706 <unknown-module>+00000000
[ 75] 0x00007fa0cd006706 <unknown-module>+00000000
[ 76] 0x00007fa0cd006706 <unknown-module>+00000000
[ 77] 0x00007fa0cd006706 <unknown-module>+00000000
[ 78] 0x00007fa0cd006706 <unknown-module>+00000000
[ 79] 0x00007fa0cd006706 <unknown-module>+00000000
[ 80] 0x00007fa0cd006233 <unknown-module>+00000000
[ 81] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 82] 0x00007fa0cd0068e1 <unknown-module>+00000000
[ 83] 0x00007fa0cd006058 <unknown-module>+00000000
[ 84] 0x00007fa0cd006706 <unknown-module>+00000000
[ 85] 0x00007fa0cd006058 <unknown-module>+00000000
[ 86] 0x00007fa0cd006706 <unknown-module>+00000000
[ 87] 0x00007fa0cd006706 <unknown-module>+00000000
[ 88] 0x00007fa0cd0004e7 <unknown-module>+00000000
[ 89] 0x00007fa0d7a950a5 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06299813
[ 90] 0x00007fa0d7a93b08 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06294280
[ 91] 0x00007fa0d7a93dd7 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06294999
[ 92] 0x00007fa0d7a93ef7 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06295287
[ 93] 0x00007fa0d7b128d5 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+06813909
[ 94] 0x00007fa0d7deefff /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09814015
[ 95] 0x00007fa0d7def105 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+09814277
[ 96] 0x00007fa0d7cb68c8 /opt/jdk1.7.0_80/jre/lib/amd64/server/libjvm.so+08534216
[ 97] 0x00007fa0d8ad9064 /lib/x86_64-linux-gnu/libpthread.so.0+00032868
[ 98] 0x00007fa0d83f562d /lib/x86_64-linux-gnu/libc.so.6+00951853 clone+00000109
[ 99] 0x0000000000000000 <unknown-module>+00000000
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.** This crash report has been saved to disk as /root/matlab_crash_dump.1-1 **
MATLAB is exiting because of fatal error
Thank you,
  1 Comment
Alessandro Aglietti
Alessandro Aglietti on 26 Jun 2017
Also using the libstdc++ from OS cause same error
Stack Trace (from fault):
[ 0] 0x00007ff6ccb938b3 /usr/lib/x86_64-linux-gnu/libstdc++.so.6+00518323 _ZNSi6sentryC1ERSib+00000019
[ 1] 0x00007ff6ccb94c0 /usr/lib/x86_64-linux-gnu/libstdc++.so.6+00523274 _ZNSi5tellgEv+00000026
[ 2] 0x00007ff6891d5a65 bin/glnxa64/libmwmclmcr.so+03119717 _ZN6mclmcr12CtfExtractorC1EN5boost10shared_ptrISiEENS1_8functionIFmPKcS6_EEE+00000117
[ 3] 0x00007ff689162cc6 bin/glnxa64/libmwmclmcr.so+02649286 _Z25mclMakeCtfStreamExtractorN5boost10shared_ptrISiEE+00000118
[ 4] 0x00007ff68adc0e59 /opt/mcr/v92/bin/glnxa64/libnativemcl.so+01121881 Java_com_mathworks_toolbox_javabuilder_internal_MWMCR_mclInitializeComponentInstance+00001081
[ 5] 0x00007ff6d0398d98 <unknown-module>+00000000
[...]

Sign in to comment.

Accepted Answer

Alessandro Aglietti
Alessandro Aglietti on 26 Jun 2017
Resolved, the problem was the decompiler I used for extract the Matlab Compiler generated jar.
It fail to decompress the ctf file, resulting in an empty file...
As a workaround I use unzip.
You can see the Dockerfile diff there
https://github.com/growingabit/appengine-matlab-service/compare/2895970d45bc...b37bc50e1467
Regards

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!