Renamed subject & reduced the Message body to user list limit of 64 KB ( current Message too big: 213290 bytes )
-AVM -------- Forwarded Message -------- Subject: RE: [users] ckptnd memory leak(very serious) Date: Tue, 19 May 2015 06:33:45 +0000 From: Yao Cheng LIANG <[email protected]>To: 'A V Mahesh' <[email protected]>, [email protected] <[email protected]>
CC: Yao Cheng LIANG <[email protected]>Thanks for information. Now the more urgent issue is ckptnd process crash. I have built an application as attached which will get all the sections, but this sometime would cause ckptnd to crash. This app runs on the same node as the active replica.
Please help to see if there is any issue with the application. Ted *From:*A V Mahesh [mailto:[email protected]] *Sent:* Tuesday, May 19, 2015 2:00 PM *To:* Yao Cheng LIANG; [email protected] *Subject:* Re: [users] ckptnd memory leak(very serious) Hi Ted, >>[Ted]: I read spec, but nowhere states that. Follwing are the ioWriteVector/ioReadVector free procedure .1) The ioWriteVector - is a in parameter to A pointer to an array with elements ioVector[0], ..., ioVector[numberOfElements - 1] data is in the scope of your application function it , so it should be freed by application if dynamically allocated .
===============================================================================================
char data[] = "Application Data ........";
SaCkptIOVectorElementT ioWriteVector[1] = {
{
.sectionId = SA_CKPT_DEFAULT_SECTION_ID,
.dataBuffer = data,
.dataSize = strlen(data),
.dataOffset = 0,
.readSize = 0
}
};
result1 = saCkptCheckpointWrite(checkpointHandle,
ioWriteVector,
1,
&dummy);
===============================================================================================
2) The saCkptIOVectorElementDataFree() functions frees the memory to
which data points and which was allocated by the
Checkpoint Service library in a previous call to the
saCkptCheckpointRead() function.
========================================================================================
result2 = saCkptCheckpointRead(checkpointHandle,
ioReadVector,
1,
&erroroneousVectorIndex);
if(result2 == SA_AIS_OK) {
if (ioReadVector[1].readSize != 0)
result =
saCkptIOVectorElementDataFree(checkpointHandle,ioReadVector[1].dataBuffer);
//free(ioReadVector[0].dataBuffer);
//ioReadVector[0].dataBuffer = NULL;
}
========================================================================================
[Ted]: so you have found this issue?
No, I am saying In general use write -AVM On 5/19/2015 9:25 AM, Yao Cheng LIANG wrote: See my comments inline. /Ted *From:*A V Mahesh [mailto:[email protected]] *Sent:* Tuesday, May 19, 2015 11:49 AM *To:* Yao Cheng LIANG; [email protected] <mailto:[email protected]> *Subject:* Re: [users] ckptnd memory leak(very serious) Hi Ted, On 5/19/2015 9:16 AM, Yao Cheng LIANG wrote: So upon return of saCkptCheckpointWrite I can safely free the iovectors? Yes see specification for more details. [Ted]: I read spec, but nowhere states that. In 4.2.2 when we are using write, we found memory leak, then we switched to overwrite and found no. I am not sure if in 4.6 the issue is still there. Use write , in general this is most users use case and the fixes will go in this path fist. [Ted]: so you have found this issue? -AVM Thanks. Ted *From:*A V Mahesh [mailto:[email protected]] *Sent:* Tuesday, May 19, 2015 11:37 AM *To:* Yao Cheng LIANG; [email protected] <mailto:[email protected]> *Subject:* Re: [users] ckptnd memory leak(very serious) Hi Ted, >>There is alos possible memory leak for checkpointsectionWrite, the iovector is allocate by us, but we could not free it upon function return, and Icould not find anywhere that would free it. Is this a possible memory leak?iovector memory free is responsibility of application, are you taking about saCkptSectionIdFree() or
saCkptIOVectorElementDataFree() functions ?
-AVM
On 5/18/2015 8:24 PM, Yao Cheng LIANG wrote:
There is alos possible memory leak for checkpointsectionWrite,
the iovector is allocate by us, but we could not free it upon
function return, and Icould not find anywhere that would free
it. Is this a possible memory leak?
Thanks.
Ted
Sent from Windows Mail
*From:*Yao Cheng LIANG <mailto:[email protected]>
*Sent:* Monday, May 18, 2015 2:41 PM
*To:* 'A V Mahesh' <mailto:[email protected]>,
[email protected]
<mailto:[email protected]>
*Cc:* Yao Cheng LIANG <mailto:[email protected]>
Dear Mahesh,
Today my customer reported a segmentation fault with ckptnd. And
core file pointed to *cpnd_proc_getnext_section pass
**“*pTmpSecPtr= NULL” to cpnd_proc_fill_sec_desc(pTmpSecPtr,
..), thus caused crash.
After reading code, I thought there are something wrong with
this function. Please see my comments inline and comments if it
is appropriate to add the lines in Purple.
_uint32_t_
*cpnd_proc_getnext_section*(CPND_CKPT_NODE*cp_node,
CPSV_A2ND_SECT_ITER_GETNEXT*get_next,
SaCkptSectionDescriptorT*sec_des, _uint32_t_ *n_secs_trav)
{
………..
/* search the existing section id */
*n_secs_trav = get_next->n_secs_trav;
*if*(pSecPtr != _NULL_ && *n_secs_trav != 0) {
pSecPtr = cpnd_ckpt_sec_get(cp_node, &get_next->section_id);
}
/* if next is NULL then return no more sections */
*if*(pSecPtr == _NULL_) {
TRACE_4("_cpnd_ replica has no sections");
*return*NCSCC_RC_FAILURE;
}
/* get section descriptor with given filter */
*if*(*n_secs_trav == 0)
pTmpSecPtr = pSecPtr;
*else*
pTmpSecPtr = cpnd_ckpt_sec_get_next(&cp_node->replica_info,
pSecPtr);
[Ted]: here pTmpSecPtr is possible NULL
*switch* (get_next->filter) {
*case* /SA_CKPT_SECTIONS_ANY/:
(*n_secs_trav)++;
[Ted]: here we should check if pTmpSecPtr is NULL, as we do in
the “switch”
***if*(pTmpSecPtr == _NULL_) {
TRACE_4("_cpnd_ replica has no sections ");
TRACE_LEAVE();
*return* NCSCC_RC_FAILURE;
}
*break*;
…….
cpnd_proc_fill_sec_desc(pTmpSecPtr, sec_des);
*return*NCSCC_RC_SUCCESS;
}
*return*NCSCC_RC_FAILURE;
}
Thanks.
Ted
ckpt-test.rar
Description: Binary data
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________ Opensaf-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-users
