Hi,
I am facing quite a strange issue where the value of function parameter is not coherent between the caller and called function. let me explain it using a simplified scenario -
int8 *gpui8TmpAddrCaller = NULL;
uint8 *gpui8TmpAddrCallee = NULL;
void fn_callee (uint8 *pui8DescAddr)
{
gpui8TmpAddrCallee = pui8DescAddr;
/*fn_validateBuff is a function which validates sanity of header content*/
ASSERT (STAT_SUCCESS == fn_validateBuffHdr(pui8DescAddr));
}
void fn_caller ( void )
{
uint8 *pui8UserMem = NULL;
pui8UserMem = (uint8 *)malloc( 64 );
if ( NULL != pui8UserMem)
{
/* Fill predefined header*/
fn_fillBuffHdr (&pui8UserMem);
gpui8TmpAddrCaller = pui8UserMem;
fn_callee (pui8UserMem);
}
}
The first function (fn_callee) is invoked periodically from fn_caller with an buffer address passed as argument.
the passed buffer has a fixed header which is validated in the callee function and an assert is raised if validation fails.
I am getting the ASSERT hit after somewhere around ~90 invocations. when I check the value of gpui8TmpAddrCaller and gpui8TmpAddrCallee in expression window, they are completely different but does not look like memory corruption.
I am not able to understand how what might be the cause of this problem and how can I debug it.
I am using the following -
Nyquist C6670 EVM Board
SYS/BIOS 6.34
XDC Tools 3.24
C6000 Code Generation Tools v7.4.1
MCSDK 2.01
Thanks,
Jitendra
