Addendum:
 
I might add that the results are also consistent (in their inconsistency at
least) on a different OS and hardware platform.  One in which I can trap
buffer overwrites, double frees and the like on the instruction that they
occur.  (see ElectricFence - unfortunately, not available for Windows).
 
The only thing I can think is that the API is adjusting addresses or playing
with a cache of some sort when allocating and freeing some of its objects.
I would certainly consider this a bug in the API (BMC: hint hint).  
 
Cheers
Ben

  _____  

From: Ben Chernys [mailto:[EMAIL PROTECTED] 
Sent: May 29, 2007 9:04 AM
To: '[email protected]'
Subject: RE: Problem with function FreeARQualifierStruct


After much effort, I discovered a cause for your error that I do not
understand but have worked around.  The workaround is appropriate for you as
well.
 
I get exactly your symptoms which is a stack corruption generally followed
by a bad return or as we used to say many many moons ago: a bad branch.
 
These are notoriously difficult bugs to track down.  In my case, I make a
handful of flavours of a binary for each of the last few releases of the
API.  Only very few odd flavours would blow and those that did would change
with different tests.
 
In any event, here is what I have discovered and it is simple:
 
If I allocate an AR object, I cannot give it to AR to free.  I must
replicate the similarly named AR function within my code for those objects
that I allocate.  If ARS (the API) allocates an object, then I should use
the FreeAR f() to free it.
 
Hope this helps,
Ben Chernys

Senior Software Architect
Software Tool House Inc.

Canada / Deutschland / Germany
Mobile:      +49 162 175 0956   GMT + 1
Email:        <mailto:[EMAIL PROTECTED]>
mailto:[EMAIL PROTECTED]
Web:          <http://www.softwaretoolhouse.com/>
http://www.softwaretoolhouse.com

A free notepad for Diary fields:
 <http://www.softwaretoolhouse.com/downloads/DiaryFieldEditor.htm>
http://www.softwaretoolhouse.com/downloads/DiaryFieldEditor.htm
An ARS integration, import, batch facility:
 <http://www.softwaretoolhouse.com/products/SthMupd>
http://www.softwaretoolhouse.com/products/SthMupd
  


  _____  

From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Beketov Danila
Sent: May 29, 2007 7:52 AM
To: [email protected]
Subject: Problem with function FreeARQualifierStruct


** 

Hi

 

I have a problem with Remedy C API function "FreeARQualifierStruct". I need
to load qualifier structure manually, see follow:

 

   ARQualifierStruct     qualifier;

 

   memset((char *) &qualifier, '\0', sizeof(ARQualifierStruct));

   qualifier.operation = AR_COND_OP_REL_OP;

   qualifier.u.relOp = (ARRelOpStruct *) malloc(sizeof(ARRelOpStruct));

   qualifier.u.relOp->operation = (unsigned int) AR_REL_OP_EQUAL;

   qualifier.u.relOp->operandLeft.tag = (unsigned int) AR_FIELD;

   qualifier.u.relOp->operandLeft.u.fieldId = (ARInternalId) 7;

   qualifier.u.relOp->operandRight.tag = (unsigned int) AR_VALUE;

   qualifier.u.relOp->operandRight.u.value.dataType = AR_DATA_TYPE_INTEGER;

   qualifier.u.relOp->operandRight.u.value.u.intVal = (ARLong32) 1;

 

If execute "FreeARQualifierStruct(&qualifier, FALSE);" I get the follow
error:

 



 

It's mean I have a problem with feeing allocated memory, but when I load
qualifier with "ARLoadARQualifierStruct" I get the same qualifier that was
defined above (I check it in debugger), and "FreeARQualifierStruct" exicute
without errors. I don't understand this situation. What I do wrong?

 

Sorry for my bad english

__20060125_______________________This posting was submitted with HTML in
it___ 

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

<<image002.jpg>>

Reply via email to