float *c_data = (float*)_mm_malloc(sizeof(float)*lda*ldb, 64);
float *c_data_T = (float*)_mm_malloc(sizeof(float)*lda*ldb, 64);
transpose_block_SSE4x4(c_data, c_data_T, ldb, lda, lda, ldb, BLOCK_SIZE);
// update the object cdata
mxArray *newCData = mxCreateNumericMatrix(lda, ldb, mxSINGLE_CLASS, mxREAL);
mxSetData(newCData, c_data_T);
mxSetProperty(prhs[0], 0, "CData", newCData);
_mm_free(c_data);
MATLAB crash file:C:\Users\HB69954\AppData\Local\Temp\matlab_crash_dump.19388-1:
------------------------------------------------------------------------
Assertion detected at Sat Mar 30 14:08:27 2019
------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Default Encoding : windows-1252
Deployed : false
Graphics card 1 : Intel Corporation ( 0x8086 ) Intel(R) HD Graphics 4600 Version 10.18.10.3540
Graphics card 2 : NVIDIA ( 0x10de ) NVIDIA Quadro K1100M Version 24.21.14.1131
Host Name : MWKS430514
MATLAB Architecture : win64
MATLAB Entitlement ID: 703359
MATLAB Root : C:\Program Files\MATLAB\R2016b
MATLAB Version : 9.1.0.441655 (R2016b)
OpenGL : hardware
Operating System : Microsoft Windows 7 Enterprise
Processor ID : x86 Family 6 Model 60 Stepping 3, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : Version 6.1 (Build 7601: Service Pack 1)
Fault Count: 1
Assertion in void __cdecl `anonymous-namespace'::error(const struct `anonymous-namespace'::header *const ,const unsigned __int64,const void *const ,const unsigned __int64,const class boost::basic_format<char,struct std::char_traits<char>,class std::allocator<char> > &) at b:\matlab\foundation_libraries\src\fl\mem\alignment.cpp line 323:
The pointer passed to 'vector_check' is invalid
and does not appear to have come from any of the following routines:
vector_malloc, vector_calloc, vector_realloc
mxMalloc*, mxCalloc*, mxRealloc*
This suggests one of the following has happened:
- the pointer has already been freed
- the pointer came from an incompatible allocator (e.g. new, malloc, utMalloc)
- the pointer didn't come from any allocator (e.g. the stack, uninitialized memory)
- a memory corruption destroyed the pointer or its header
THIS DATA IS FOR INTERNAL DIAGNOSTIC PURPOSES ONLY
PID: 19388
NATIVE ALIGNMENT: 16 (0x10)
REQ ALIGNMENT: 32 (0x20)
ALIGNED POINTER: 000000007EDF0080
REQ SIZE: 0 (0)
HEADER ADDRESS: 000000007EDF0070
HEADER SIZE: 16 (0x10)
UNALIGNED POINTER: 000000007EDE1293
HEADER->SIZE: 2128543856 (0x7edf0070)
HEADER->CHECK: 3991793133 (0xedededed)
HEADER->ALIGNMENT: 60909 (0xeded)
HEADER->OFFSET: 60909 (0xeded)
Register State (captured):
RAX = 00000000fe9df2e8 RBX = 00000000fe9df2e8
RCX = 0000000004025880 RDX = 0000000000000000
RSP = 0000000004025800 RBP = 00000000fe943de8
RSI = 00000000fe9df268 RDI = 0000000000000000
R8 = 000007fffffde000 R9 = 000007feed1a0000
R10 = 00000000fe9cf783 R11 = 00000000fe9cf783
R12 = 00000000fe9df2e8 R13 = 0000000004025ec0
R14 = 00000000fe9cf218 R15 = 00000000fe943de8
RIP = 00000000fe80971a EFL = 00000206
CS = 0033 FS = 0053 GS = 002b
Stack Trace (captured):
[ 0] 0x00000000fe804153 C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00082259 fl::diag::thread_context::unspecified_bool+00000051
[ 1] 0x00000000fe802a68 C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00076392 fl::diag::stacktrace_base::capture+00000024
[ 2] 0x00000000fe80682b C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00092203 fl::diag::thread_context::unspecified_bool+00009995
[ 3] 0x00000000fe805737 C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00087863 fl::diag::thread_context::unspecified_bool+00005655
[ 4] 0x00000000fe80911b C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00102683 fl::diag::terminate+00000059
[ 5] 0x00000000fe8bdba4 C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00842660 fl::mem::MObserverBase::realloc_pre+00008564
[ 6] 0x00000000fe8bd038 C:\Program Files\MATLAB\R2016b\bin\win64\libmwfl.dll+00839736 fl::mem::MObserverBase::realloc_pre+00005640
[ 7] 0x0000000180012428 C:\Program Files\MATLAB\R2016b\bin\win64\libmx.dll+00074792 matrix::detail::noninlined::mx_array_api::mxSetIr+00000776
[ 8] 0x000000018000c36d C:\Program Files\MATLAB\R2016b\bin\win64\libmx.dll+00050029 mxArray_tag::set_pdata_untrusted+00000033
[ 9] 0x000007fefa7c5dbf C:\Users\HB69954\Documents\GitHub\heavyOilToolbox\loadProcDasBin\array_mapper.mexw64+00089535
...
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetExt>.mexw64</TargetExt>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(MATLAB_ROOT)\extern\include;</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<CompileAs>CompileAsC</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(MATLAB_ROOT)\extern\lib\win64\microsoft;</AdditionalLibraryDirectories>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);libmx.lib;libmex.lib;libmat.lib;</AdditionalDependencies>
<AdditionalOptions>/export:mexFunction %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>