Segmentation fault crashes matlab, use of BLAS and LAPACK libraries

3 views (last 30 days)
Hi, I am using MEX to compile a C code with MATLAB R2011b 64 bit, I managed to generate the .mexw64 file, however when I try to use the file, I get a segmentation fault causing Matlab to crash.
The error log file is as follows.
MATLAB crash <file:C>:\Users\himans\AppData\Local\Temp\matlab_crash_dump.12196-3:
------------------------------------------------------------------------ Segmentation violation detected at Mon Nov 11 11:46:19 2013 ------------------------------------------------------------------------
Configuration: Crash Decoding : Disabled Default Encoding: windows-1252 MATLAB Root : C:\Program Files\MATLAB\R2011b MATLAB Version : 7.13.0.564 (R2011b) Operating System: Microsoft Windows 7 Processor ID : x86 Family 6 Model 10 Stepping 7, GenuineIntel Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode Window System : Version 6.1 (Build 7601: Service Pack 1)
Fault Count: 3
Abnormal termination: Segmentation violation
Register State (from fault): RAX = 0000000000000000 RBX = 19801700577d99e0 RCX = 0066005c00000008 RDX = 19801700577d99e0 RSP = 000000002856eb60 RBP = 0066005c0000000c RSI = 0000000000000000 RDI = 1cb019e0577d9a40
R8 = 1cb019e0577d9a40 R9 = 13201140577d9920
R10 = 13201140577d9920 R11 = 16501420577d9980
R12 = 16501420577d9980 R13 = 000000002856ecc0
R14 = 0000000000000000 R15 = 0000000000000000
RIP = 0000000026baa3b0 EFL = 00010246
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault): [ 0] 0x0000000026baa3b0 C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+11969456 ( xerbla+10451632 ) [ 1] 0x00000000266dfbff C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+06945791 ( xerbla+5427967 ) [ 2] 0x00000000260e840d C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+00689165 ( ZUPMTR+353341 ) [ 3] 0x0000000027f3d82c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00448556 ( _kmp_invoke_microtask+000140 ) [ 4] 0x0000000027f1bc4e C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00310350 ( _kmpc_invoke_task_func+000158 ) [ 5] 0x0000000027f1962c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00300588 ( _kmp_fork_call+023196 ) [ 6] 0x0000000027f3e507 C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00451847 ( _kmp_launch_worker+000551 ) [ 7] 0x000000007705652d C:\Windows\system32\kernel32.dll+00091437 ( BaseThreadInitThunk+000013 ) [ 8] 0x000000007728c541 C:\Windows\SYSTEM32\ntdll.dll+00181569 ( RtlUserThreadStart+000033 )
Abnormal termination: Segmentation violation
Register State (from fault): RAX = 0000000000000000 RBX = 3fc03980577d9c20 RCX = 0066005c00000008 RDX = 3fc03980577d9c20 RSP = 000000002867ed60 RBP = 0066005c0000000c RSI = 0000000000000000 RDI = 42f03c60577d9c80
R8 = 42f03c60577d9c80 R9 = 396033c0577d9b60
R10 = 396033c0577d9b60 R11 = 3c9036a0577d9bc0
R12 = 3c9036a0577d9bc0 R13 = 000000002867eec0
R14 = 0000000000000000 R15 = 0000000000000000
RIP = 0000000026baa3b0 EFL = 00010246
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault): [ 0] 0x0000000026baa3b0 C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+11969456 ( xerbla+10451632 ) [ 1] 0x00000000266dfbff C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+06945791 ( xerbla+5427967 ) [ 2] 0x00000000260e840d C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+00689165 ( ZUPMTR+353341 ) [ 3] 0x0000000027f3d82c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00448556 ( _kmp_invoke_microtask+000140 ) [ 4] 0x0000000027f1bc4e C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00310350 ( _kmpc_invoke_task_func+000158 ) [ 5] 0x0000000027f1962c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00300588 ( _kmp_fork_call+023196 ) [ 6] 0x0000000027f3e507 C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00451847 ( _kmp_launch_worker+000551 ) [ 7] 0x000000007705652d C:\Windows\system32\kernel32.dll+00091437 ( BaseThreadInitThunk+000013 ) [ 8] 0x000000007728c541 C:\Windows\SYSTEM32\ntdll.dll+00181569 ( RtlUserThreadStart+000033 )
Abnormal termination: Segmentation violation
Register State (from fault): RAX = 0000000000000000 RBX = 2ca02840577d9b00 RCX = 0066005c00000008 RDX = 2ca02840577d9b00 RSP = 00000000285feae0 RBP = 0066005c0000000c RSI = 0000000000000000 RDI = 2fd02b20577d9b60
R8 = 2fd02b20577d9b60 R9 = 26402280577d9a40
R10 = 26402280577d9a40 R11 = 29702560577d9aa0
R12 = 29702560577d9aa0 R13 = 00000000285fec40
R14 = 0000000000000000 R15 = 0000000000000000
RIP = 0000000026baa3b0 EFL = 00010246
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault): [ 0] 0x0000000026baa3b0 C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+11969456 ( xerbla+10451632 ) [ 1] 0x00000000266dfc9b C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+06945947 ( xerbla+5428123 ) [ 2] 0x00000000260e840d C:\Program Files\MATLAB\R2011b\bin\win64\mkl.dll+00689165 ( ZUPMTR+353341 ) [ 3] 0x0000000027f3d82c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00448556 ( _kmp_invoke_microtask+000140 ) [ 4] 0x0000000027f1bc4e C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00310350 ( _kmpc_invoke_task_func+000158 ) [ 5] 0x0000000027f1962c C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00300588 ( _kmp_fork_call+023196 ) [ 6] 0x0000000027f3e507 C:\Program Files\MATLAB\R2011b\bin\win64\libiomp5md.dll+00451847 ( _kmp_launch_worker+000551 ) [ 7] 0x000000007705652d C:\Windows\system32\kernel32.dll+00091437 ( BaseThreadInitThunk+000013 ) [ 8] 0x000000007728c541 C:\Windows\SYSTEM32\ntdll.dll+00181569 ( RtlUserThreadStart+000033 )
Is this because I haven't modified the code using mwSize and mwIndex for 64 bit compatibility ? I tried searching on how to modify the code but started getting more and more confused. Can someone guide me to some article on how to modify the code so as to run the code without the segmentation error.
Thanks for the help Himanshu

Answers (0)

Community Treasure Hunt

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

Start Hunting!