Skip to content

Low level error when browsing a DBFVFP table. Revision 2.11 test #985

@jpmoschi

Description

@jpmoschi

Revision 2.11 for BetaTesters
Low level error when browsing a DBFVFP table with DataGridView. See the error call stack at the end of this report.
The table has null values and indexes and they were recreated with actual revision 2.11. In Revision 2.10.0.3 it function correctly but another similar error was reported at the end of #953 when we try to resolve null values in DBFVFP.
The new error occurs in the first Browse(), the older one reported before is in the 3rd. The code:
`method creadbf AS logic
// first run create the table creada.dbf with null values
// 2nd run create index tags. Then browse.
local lresult:= false
LOCAL LSTRUCT:= { {"c1","C:0", 10,0},{"n1","N:0", 20,8}, {"D1","D:0", 10,0},{"T1","T:0", 10,0}}

RddSetDefault ( "DBFVFP" )
LOCAL PATHCREADA:= _DBF + "CREADA"
if File(PATHCREADA+".DBF")
DbUseArea(,"DBFVFP",PATHCREADA , "NEWTABLE" )
if File( PATHCREADA +".cdx")
if DbClearIndex( ,PATHCREADA +".cdx")
System.IO.File.Delete(PATHCREADA.ToString()+".cdx")
ENDIF
ENDIF

  lresult:= DBCreateOrder("tagc1",PATHCREADA ,  "c1" )// , {|| c1} ) 
  if lresult
     lresult:= DBCreateOrder("tagn1",PATHCREADA ,  "str(n1,20,8)" )//, {|| n1} ) 
     if lresult
        lresult:= DBCreateOrder("tagd1", PATHCREADA,  "dtoc(d1))// ", {|| d1} ) 
        if lresult
           //lresult:= DBCreateOrder("tagt1",PATHCREADA ,  "t1", {|| t1} ) 
           lresult:= DBCreateOrder("tagt1",PATHCREADA ,  "ttoc(t1,1)" ) 
        endif
     endif
  endif
  select newtable
  // check order with nulls visually 
  if lresult 
     lresult:= DBSetOrder("tagc1",pathcreada)
     browse() <---------- The error is here!!!
  endif
  if lresult 
     lresult:= DBSetOrder("tagn1",pathcreada)
     browse()
  endif 
  if lresult
     lresult:= DBSetOrder("tagd1",pathcreada)
     browse()    --> Another error reported before in #953 
  endif
  if lresult
     lresult:= DBSetOrder("tagt1",pathcreada)
     browse()
  endif
  RETURN lresult

else
IF NOT DbCreate(_dbf +"creada", LSTRUCT,,TRUE,"NEWTABLE" )
return lresult
ENDIF
endif
local dt:= DateTime()
IF NEWTABLE->DBAPPEND()
NEWTABLE->C1:= "ASDF T1>"
NEWTABLE->N1:= 1234
NEWTABLE->D1:= DATE()
NEWTABLE->T1:= dt
IF NEWTABLE->DBAPPEND()
NEWTABLE->C1:= "ASDF T1<"
NEWTABLE->N1:= -4321
NEWTABLE->D1:= DATE()
NEWTABLE->T1:= dt-100
ENDIF
ENDIF
lresult:= NEWTABLE->DbCloseArea() // It is mandatory to reopen the table, else brake
if DbUseArea(,"DBFVFP",_dbf + "creada" , "NEWTABLE" )
IF NEWTABLE->DBAPPEND()
NEWTABLE->C1:= null
NEWTABLE->N1:= null
NEWTABLE->D1:= null
NEWTABLE->T1:= null
ENDIF
set date british
NEWTABLE->DbGoTop()
BROWSE()
lresult:= true
ENDIF
NEWTABLE->DbCloseArea()
RETURN lresult`

The error copied from Inmediate Window:
e
{System.Windows.Forms.DataGridViewDataErrorEventArgs}
Cancel: FALSE
ColumnIndex: -1
Context: Display
Exception: {"La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."}
RowIndex: 1
ThrowException: FALSE
cancel: FALSE
columnIndex: -1
context: Display
exception: {"La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."}
rowIndex: 1
throwException: FALSE

e.Exception
{"La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."}
Arg: ""
ArgNum: 0
ArgType: 0
ArgTypeReq: 0
ArgTypeReqType: null
ArgTypeType: null
Args: {object[0]}
CallFuncSym: null
CanDefault: TRUE
CanRetry: FALSE
CanSubstitute: FALSE
Cargo: null
Data: {System.Collections.ListDictionaryInternal}
Description: "La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."
FileHandle: 0
FileName: "C:\Users\UsrTest\Source\repos\X-Sharp\DBFS\CREADA.DBF"
FuncPtr: 0x00000000
FuncSym: "CdxTag.SkipRaw"
GenCodeText: "Corruption detected"
Gencode: 32
HResult: -2146233088
HelpLink: null
IPForWatsonBuckets: 0x71603fd0
InnerException: {"La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."}
IsTransient: FALSE
MaxSize: 0
Message: "La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."
MethodSelf: null
OSCode: 0
OSCodeText: ""
Operation: ""
RemoteStackTrace: null
Severity: 2
Source: "XSharp.Rdd"
Stack: " en System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
en System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
en XSharp.RDD.CDX.CdxTag._saveCurrentRecord(CdxNode node)
en XSharp.RDD.CDX.CdxTag._getNextKey(SkipDirection moveDirection)
en XSharp.RDD.CDX.CdxTag._nextKey(Int32 keyMove)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.DBFCDX.SkipRaw(Int32 move)
en XSharp.RDD.DBF.Skip(Int32 nToSkip)

en XSharp.DbDataSource.get_Item(Int32 index)
en System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
en System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.GetErrorText(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
en System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
en System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
en System.Windows.Forms.Control.WmPaint(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.DataGridView.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.RunDialog(Form form)
en System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
en System.Windows.Forms.Form.ShowDialog()
en WindowsFormsApplication1.Exe.Functions.Browse(Object oTable) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 63
en WindowsFormsApplication1.Exe.Functions.Browse() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 20
en NSOMA.Form2.creadbf() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 327
en NSOMA.Form2.button1_Click(Object sender, EventArgs e) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 141
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en NSOMA.MyStartupCode.Start() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Program.prg:línea 645
"
StackTrace: " en System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
en System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
en XSharp.RDD.CDX.CdxTag._saveCurrentRecord(CdxNode node)
en XSharp.RDD.CDX.CdxTag._getNextKey(SkipDirection moveDirection)
en XSharp.RDD.CDX.CdxTag._nextKey(Int32 keyMove)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.DBFCDX.SkipRaw(Int32 move)
en XSharp.RDD.DBF.Skip(Int32 nToSkip)
en XSharp.DbDataSource.get_Item(Int32 index)
en System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
en System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.GetErrorText(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
en System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
en System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
en System.Windows.Forms.Control.WmPaint(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.DataGridView.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.RunDialog(Form form)
en System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
en System.Windows.Forms.Form.ShowDialog()
en WindowsFormsApplication1.Exe.Functions.Browse(Object oTable) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 63
en WindowsFormsApplication1.Exe.Functions.Browse() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 20
en NSOMA.Form2.creadbf() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 327
en NSOMA.Form2.button1_Click(Object sender, EventArgs e) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 141
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en NSOMA.MyStartupCode.Start() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Program.prg:línea 645
"
SubCode: 1002
SubCodeText: "Invalid skipping number"
SubSystem: "DBFVFP"
SubstituteType: 0
TargetSite: {Void _dbfError(System.Exception, UInt32, UInt32, System.String, System.String, UInt32, Boolean)}
Tries: 0
WatsonBuckets: null
_ArgType: 0
_ArgTypeReq: 0
_ArgTypeReqType: null
_ArgTypeType: null
_HResult: -2146233088
_StackTrace: " en System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
en System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
en XSharp.RDD.CDX.CdxTag._saveCurrentRecord(CdxNode node)
en XSharp.RDD.CDX.CdxTag._getNextKey(SkipDirection moveDirection)
en XSharp.RDD.CDX.CdxTag._nextKey(Int32 keyMove)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.CDX.CdxTag.SkipRaw(Int32 nToSkip)
en XSharp.RDD.DBFCDX.SkipRaw(Int32 move)
en XSharp.RDD.DBF.Skip(Int32 nToSkip)
en XSharp.DbDataSource.get_Item(Int32 index)
en System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
en System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetError(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.GetErrorText(Int32 rowIndex)
en System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
en System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
en System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
en System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
en System.Windows.Forms.Control.WmPaint(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.DataGridView.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.RunDialog(Form form)
en System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
en System.Windows.Forms.Form.ShowDialog()
en WindowsFormsApplication1.Exe.Functions.Browse(Object oTable) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 63
en WindowsFormsApplication1.Exe.Functions.Browse() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Browse.prg:línea 20
en NSOMA.Form2.creadbf() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 327
en NSOMA.Form2.button1_Click(Object sender, EventArgs e) en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Form2.prg:línea 141
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en NSOMA.MyStartupCode.Start() en C:\Users\UsrTest\Source\repos\X-Sharp\WindowsFormsApplication1\Program.prg:línea 645
"
_Subcode: null
_className: null
_data: null
_dynamicMethods: null
_exceptionMethod: null
_exceptionMethodString: null
_helpURL: null
_innerException: {"La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."}
_ipForWatsonBuckets: 0x71603fd0
_message: "La matriz de origen no es suficientemente larga. Compruebe srcIndex, la longitud y los límites inferiores de la matriz."
_remoteStackIndex: 0
_remoteStackTraceString: null
_safeSerializationManager: {System.Runtime.Serialization.SafeSerializationManager}
_source: null
_stackTrace: {sbyte[192]}
_stackTraceString: null
_watsonBuckets: null
_xcode: -532462766
_xptrs: 0x00000000

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions