I encounter invalid memory access with Inspector XE 2011 with the ippiTranspose_8u_C3R and ippiTranspose_8u_C4R functions when used with negative strides. See the code below for an example.
This sometimes leads to access violations in our application.
I am running the latest 7.0 update 7 IPP on Windows 64-bit, Intel Core i7-2720QM.
Can this be reproduced in your test environment?
It probably is an alignment issue, but a having a non 32-bit alignment is not supposed to give access violations in an application, just a decrease in speed.
The memory allocation of the source memory block which is processed in my application is not something I can control.
If you can also reproduce the invalid memory access with the Inspector I would consider this a bug that needs to be fixed in an upcoming update.
If you have aMicrosoft Visual Studio 20xx Professional Editionplease look at source codes ofCRT-function 'calloc'.
You will see that'calloc' uses a Win32 API function 'HeapAlloc'. It is hard to believe that Microsoft developers
missed an allignment issue.
Also, CRT-functions'calloc' and 'malloc' are different by nature and take a look:
Allocates a memory block ( not initialized )
Declaration: void * malloc( size_t size )
Where, 'size' is a number of bytes to allocate
Allocates an array in memory with elements initialized to 0
Declaration: void * calloc( size_t num, size_t size )
Where, 'num' is a number of elements, and 'size' is a length in bytes of each element
IPP-function 'ippiMalloc' is similar to CRT-function 'malloc'.
>>...is not supposed to give access violations...
Some SSE instructionsand intrinsic functionsshould work with alligned memory blocks and if they are
not allignedan Access Violation exception is thrown.
The issue for ippiTranspose_8u_C3R remains, even after Iused yoursuggested changes.See the code below. To removesome'uninitialized memory access' warning from the Inspector output I added additional memory initialization.
So with the code below I still get 'Uninitialized partial memory access' in ippiTranspose_8u_C3R with the Inspector, while running the 32-bit 7.0 IPP update 7 on windows 7 64-bit. This is suspicous as this leads to chrashes in our application.
Can Intel verify that this is an issue in the implementation of ippiTranspose_8u_C3R?
Hello Jurrien, have you ever solved this problem?
There was a similar problem in my src code few days ago. The error msg of the compiler was "Aborted.(core dump)".
I checked the src code and found that I access memory out of length I defined.
If the length of the data before transposition is L, you should allocate L*Nc length memory for the output of transposition.
Which, Nc means number of channel, Nc=3 if ippiTranspose_xx_C3R is used for instance.
Any method of memory allocation is OK.
Ippu8 *out = (Ipp8u*)malloc(L*Nc*sizeof(Ipp8u)); something like that.
command "malloc" can ensure address alignment.And maybe address alignment is not the main cause of this problem.
Hope that will be helpful.