Page 1 of 1

internal data structures corrupted issue

Posted: Mon Nov 14, 2011 9:59 am
by BruceN
One customer is getting sporatic errors. They have had this happen about twice a month or so (doing several hundred to a thousand or so invoices a month).

Sell_Items is the main invoicing routine (quite long with numerous functions called within it). Normally with an error i can get a clue from the call stack, but here it is garbage (same with other times).

I can see that error 41 is the internal data structures... but cant find info on subcode 5 and i dont have a clue how to find the issue.

thanks

-------------------------
Error writing sell_itemsfor invoice 10425274
Date: 10/27/11 Time: 08:30:35
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: N VALUE: 2
-> VALTYPE: C VALUE:
-> VALTYPE: C VALUE:
-> VALTYPE: C VALUE:
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : NIL
oError:description : Internal data structures corrupted
oError:filename :
oError:genCode : 41
oError:operation : SELL_ITEMS
oError:osCode : 0
oError:severity : 2
oError:subCode : 5
oError:subSystem : BASE
oError:thread : 1
oError:tries : 0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
À…¾0(1237116)

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 10:12 am
by rdonnay
Do you use any SET RELATIONs in your code?

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 10:27 am
by BruceN
yes, i have a few dc_setrelations... is that a problem?

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 10:29 am
by Auge_Ohr
BruceN wrote:I can see that error 41 is the internal data structures... but cant find info on subcode 5 and i dont have a clue how to find the issue.
0005 - [BASE] - ???
Associated with: "41:Internal data structures corrupted"
Caused by: Various things, including: "Memory(0)", ":UpdateBuffer()",
"AppEvent()", "ValType()", etc.
Remarks: Also in Fatal Error Logs: "EH: 5"/"OS: 0"/"XPP: 41",
"Function: atmStartGCThread(void*)", "Module: ATM"

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 11:01 am
by rdonnay
One of the more common IDSC problems I have seen over the years is caused by closing a database that has a relation set to it.

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 5:11 pm
by BruceN
Thanks... I'll check to see if we close the related database when we close the primary one (and close the related one first, I assume).

Re: internal data structures corrupted issue

Posted: Mon Nov 14, 2011 7:29 pm
by rdonnay
Yes, always close the related databases first.

Re: internal data structures corrupted issue

Posted: Tue Nov 15, 2011 2:06 am
by skiman
Hi,

You can replace your close command or function with the preprocessor to a new function. I have an AboCLoseArea() which replace dbclosearea().

Code: Select all

Function ABOCloseArea(cAlias)
*****************************
LOCAL bErrorHandler
   if empty(cAlias)
      cAlias := Alias()
   endif
   if !empty(cAlias) .And. Select(cAlias) # 0
      bErrorHandler := ErrorBlock({|e| Break(e)})
      BEGIN SEQUENCE
         (cAlias)->(DbClearRelation())
         (cAlias)->(DbCloseArea())
      END SEQUENCE
      ErrorBlock(bErrorHandler)
   endif
return nil
This way it is modified after recompiling your code.