Página 2 de 2

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 15:07
por sygecom
Então está errado esse GASPRO, não se deve travar um registro primeiro e depois dar um APPEND BLANK, imagine você colocando o primeiro registro em uma tabela nova, qual registro ele vai travar ? tem coisa errada ai nessa lógica...e o COMMIT deve vir antes do UNLOCK

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 15:54
por Alexandre Silva
é amigo,,o gaspro gera os fontes assim... tem muitos recursos....
olha só encontro o log dos erros...talvez algun colega consiga ver
ta sempre ligado a Ordprod
REPBLO(0) in libg2.prg libg2 e a lib do gaspro adaptada que baixamos aqui.

Código: Selecionar todos

Function BLOARQ(xArg1,xArg2)
   Local xVar1,xVar2,xVar3
   xArg1:= IIf(PCount() = 0,0,xArg1)
   xArg2:= IIf(PCount() < 2,1,xArg2)
   xVar2:= xArg1
   xVar1:= xArg1 = 0
   xVar3:= .F.
   Do While (xArg1 >= 0 .OR. xVar1)
      If (FLock())
         xVar3:= .T.
         Exit
      EndIf
      dbox("Tentando bloquear|"+IIf(xVar1,"(NŽO","(ESC")+" cancela)",15,Nil,xArg2,Nil,"OUTRO USURIO ACESSANDO|O ARQUIVO")
      xArg1:= xArg1-xArg2
   EndDo
   Clear Typeahead
   Return xVar3

Código: Selecionar todos

------------------------------------------------------------------------
Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
Terminated at: 2011.05.07 12:56:07
Erro irrecuper vel 6005: Exception error: 

    Exception Code:C0000005
    Exception Address:00521911
    EAX:00850371  EBX:00F3F5D0  ECX:0000000B  EDX:00000001
    ESI:00000000  EDI:00000400  EBP:00000000
    CS:EIP:001B:00521911  SS:ESP:0023:0022F4F0
    DS:0023  ES:0023  FS:003B  GS:0000
    Flags:00010206
    CS:EIP: 8B 4D 34 C6 44 24 30 69 BE 06 00 00 00 8B 43 40
    SS:ESP: 00F70FE4 3B9B4F17 00000000 004A0A7C 7C809C1B 00F59A38 00F404F0 00000090 00E54E4C 00E54E2C 00850371 00450332 00F59F04 00F647BC 00F6995C 0042813A

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...

Modules:
0x00400000 0x004B5000 G:\poliv1\dados\INFO_IN_.EXE
0x7C900000 0x000B3000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 0x00100000 C:\WINDOWS\system32\kernel32.dll
0x77F50000 0x000AB000 C:\WINDOWS\system32\ADVAPI32.DLL
0x77DB0000 0x00092000 C:\WINDOWS\system32\RPCRT4.dll
0x77F20000 0x00011000 C:\WINDOWS\system32\Secur32.dll
0x77BF0000 0x00058000 C:\WINDOWS\system32\msvcrt.dll
0x7E360000 0x00091000 C:\WINDOWS\system32\USER32.dll
0x77E50000 0x00049000 C:\WINDOWS\system32\GDI32.dll
0x72FB0000 0x00026000 C:\WINDOWS\system32\WINSPOOL.DRV

Called from DBCOMMITALL(0)
Called from OPB_INCL(0) in OPBAIXA.prg
Called from OPBAIXA(0) in OPBAIXA.prg
Called from INF_MENU(0) in INF_MENU.prg
Called from MAIN(0) in INFO_IND.prg
------------------------------------------------------------------------
Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
Terminated at: 2011.05.09 07:41:41
Erro irrecuper vel 9108: hb_nsxIndexUnLockWrite: unlock error.
Called from INDEXORD(0)
Called from POINTER_DBF(0) in INF_FUN2.prg
Called from OKBASEPED(0) in INF_OUTR.prg
Called from CRIT(0) in INF_FUNC.prg
Called from (b)STOREALL(0) in getsys.prg
Called from GETPOSTVALIDATE(0) in getsys.prg
Called from GETREADER(0) in getsys.prg
Called from READMODAL(0) in getsys.prg
Called from ORD_GET1(0) in ORDPROD.prg
Called from EDIT(0) in INF_PROC.prg
Called from ORDPROD(0) in ORDPROD.prg
Called from INF_MENU(0) in INF_MENU.prg
Called from MAIN(0) in INFO_IND.prg
------------------------------------------------------------------------
Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
Terminated at: 2011.05.09 12:50:43
Erro irrecuper vel 6005: Exception error: 

    Exception Code:C0000005
    Exception Address:00521911
    EAX:00840415  EBX:00F0C640  ECX:00000005  EDX:00000001
    ESI:00000000  EDI:00000002  EBP:00000000
    CS:EIP:001B:00521911  SS:ESP:0023:0022F4F0
    DS:0023  ES:0023  FS:003B  GS:0000
    Flags:00010202
    CS:EIP: 8B 4D 34 C6 44 24 30 69 BE 06 00 00 00 8B 43 40
    SS:ESP: 00F6D90C 3B9B51A7 00000000 004A0A7C 7C809C1B 00E69900 00F49F98 00000030 00E54E4C 00E54E2C 00840415 00450332 00E6A20C 00F8AB0C 00F67C84 0042813A

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...

Modules:
0x00400000 0x004B5000 G:\poliv1\dados\INFO_IN_.EXE
0x7C900000 0x000B3000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 0x00100000 C:\WINDOWS\system32\kernel32.dll
0x77F50000 0x000AB000 C:\WINDOWS\system32\ADVAPI32.DLL
0x77DB0000 0x00092000 C:\WINDOWS\system32\RPCRT4.dll
0x77F20000 0x00011000 C:\WINDOWS\system32\Secur32.dll
0x77BF0000 0x00058000 C:\WINDOWS\system32\msvcrt.dll
0x7E360000 0x00091000 C:\WINDOWS\system32\USER32.dll
0x77E50000 0x00049000 C:\WINDOWS\system32\GDI32.dll
0x72FB0000 0x00026000 C:\WINDOWS\system32\WINSPOOL.DRV

Called from DBCOMMITALL(0)
Called from OPB_INCL(0) in OPBAIXA.prg
Called from OPBAIXA(0) in OPBAIXA.prg
Called from INF_MENU(0) in INF_MENU.prg
Called from MAIN(0) in INFO_IND.prg
------------------------------------------------------------------------
Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
Terminated at: 2011.05.09 13:05:51
Erro irrecuper vel 6005: Exception error: 

    Exception Code:C0000005
    Exception Address:00521911
    EAX:00850371  EBX:00F3F5D0  ECX:00000000  EDX:00000001
    ESI:00000000  EDI:00000400  EBP:00000000
    CS:EIP:001B:00521911  SS:ESP:0023:0022F4F0
    DS:0023  ES:0023  FS:003B  GS:0000
    Flags:00010206
    CS:EIP: 8B 4D 34 C6 44 24 30 69 BE 06 00 00 00 8B 43 40
    SS:ESP: 00F6F2CC 3B9B5189 00000000 004A0A7C 7C809C1B 84DEEFFC 0089F3D8 00000030 00E54E4C 00E54E2C 00850371 00450332 00F409F4 00F78A04 00F6809C 0042813A

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...

Modules:
0x00400000 0x004B5000 G:\poliv1\dados\INFO_IN_.EXE
0x7C900000 0x000B3000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 0x00100000 C:\WINDOWS\system32\kernel32.dll
0x77F50000 0x000AB000 C:\WINDOWS\system32\ADVAPI32.DLL
0x77DB0000 0x00092000 C:\WINDOWS\system32\RPCRT4.dll
0x77F20000 0x00011000 C:\WINDOWS\system32\Secur32.dll
0x77BF0000 0x00058000 C:\WINDOWS\system32\msvcrt.dll
0x7E360000 0x00091000 C:\WINDOWS\system32\USER32.dll
0x77E50000 0x00049000 C:\WINDOWS\system32\GDI32.dll
0x72FB0000 0x00026000 C:\WINDOWS\system32\WINSPOOL.DRV

Called from DBCOMMITALL(0)
Called from OPB_INCL(0) in OPBAIXA.prg
Called from OPBAIXA(0) in OPBAIXA.prg
Called from INF_MENU(0) in INF_MENU.prg
Called from MAIN(0) in INFO_IND.prg
------------------------------------------------------------------------
Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
Terminated at: 2011.05.09 15:15:28
Erro irrecuper vel 6005: Exception error: 

    Exception Code:C0000005
    Exception Address:77C278C0
    EAX:00000000  EBX:0089C3E8  ECX:00000000  EDX:00000000
    ESI:00000000  EDI:0022EF9E  EBP:00E579F8
    CS:EIP:001B:77C278C0  SS:ESP:0023:0022EF5C
    DS:0023  ES:0023  FS:003B  GS:0000
    Flags:00010246
    CS:EIP: 8B 01 BA FF FE FE 7E 03 D0 83 F0 FF 33 C2 83 C1
    SS:ESP: 005219B5 00000000 3B9B4F16 00000000 004A0A0C 7C809C2B 00000001 00E4E934 0043A83D 00E5509C 00E5507C 00F55300 00450272 00002C69 00000000 0000FE38

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...


Modules:
0x00400000 0x004B2000 G:\poliv1\dados\INFO_IN_.EXE
0x7C900000 0x000B6000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 0x00100000 C:\WINDOWS\system32\kernel32.dll
0x77F50000 0x000AB000 C:\WINDOWS\system32\ADVAPI32.DLL
0x77DB0000 0x00093000 C:\WINDOWS\system32\RPCRT4.dll
0x77F20000 0x00011000 C:\WINDOWS\system32\Secur32.dll
0x77BF0000 0x00058000 C:\WINDOWS\system32\msvcrt.dll
0x7E360000 0x00091000 C:\WINDOWS\system32\USER32.dll
0x77E50000 0x00049000 C:\WINDOWS\system32\GDI32.dll
0x72FB0000 0x00026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x76360000 0x0001D000 C:\WINDOWS\system32\IMM32.DLL
0x76330000 0x00010000 C:\WINDOWS\system32\WINSTA.dll
0x5BCB0000 0x00055000 C:\WINDOWS\system32\NETAPI32.dll

Called from DBUNLOCK(0)
Called from REPBLO(0) in libg2.prg
Called from ITE_GET1(0) in NfiSCAL.prg
Called from ITE_INCL(0) in NfiSCAL.prg
Called from (b)SUBNIVEL(0) in INF_PROC.prg
Called from SUBNIVEL(0) in INF_PROC.prg
Called from NFI_INCL(0) in NfiSCAL.prg
Called from NFISCAL(0) in NfiSCAL.prg
Called from INF_MENU(0) in INF_MENU.prg
Called from MAIN(0) in INFO_IND.prg
------------------------------------------------------------------------

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 16:04
por sygecom
Me responda uma coisa, tem mais algum outro aplicativo seu ou de terceiros usando esses DBF ou INDICE que não é compilado com o a versão do Harbour que você está usando ?

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 16:14
por Alexandre Silva
Nao com esses dbf e indice. só tem esse que é gerado pelo GASPRO, no clipper funcionava....
outros aplicativos que tenho sao em clipper puro, eu mesmo escrevi todas a rotinas,
agora passei 2 para Harbour, esses que escrevi entao 100 %.
.
Essa do gaspro tenho que converter para 32 bits na mara , o cliente so tem maquinas desse tipo... entao converti e tava indo tudo certo,
exceto esse problema da corrupcao,
Interessante que tenho quase 200 dbf e sõ esse ta dando problema... logico 'e o mais usado/acessado.. e base de todo sistema..
pode ter alguma problema nessa "LIB' que estamos usando... hoje mesmo vi a questao do INKEY que fez cair o uso da CPU para quase 0
Espero encontrar o problema da corrupcao, tudo tem que ter uma solucao..

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 16:53
por Alexandre Silva
Called from MAIN(0) in INFO_IND.prg
036 ------------------------------------------------------------------------
037 Application Internal Error - G:\poliv1\dados\INFO_IN_.EXE
038 Terminated at: 2011.05.09 07:41:41
039 Erro irrecuper vel 9108: hb_nsxIndexUnLockWrite: unlock error.
040 Called from INDEXORD(0)
041 Called from POINTER_DBF(0) in INF_FUN2.prg
042 Called from OKBASEPED(0) in INF_OUTR.prg
043 Called from CRIT(0) in INF_FUNC.prg
044 Called from (b)STOREALL(0) in getsys.prg
045 Called from GETPOSTVALIDATE(0) in getsys.prg
046 Called from GETREADER(0) in getsys.prg
047 Called from READMODAL(0) in getsys.prg
048 Called from ORD_GET1(0) in ORDPROD.prg
049 Called from EDIT(0) in INF_PROC.prg
050 Called from ORDPROD(0) in ORDPROD.prg
051 Called from INF_MENU(0) in INF_MENU.prg
052 Called from MAIN(0) in INFO_IND.prg
* Porque o indexord aqui deu erro ??

Código: Selecionar todos

   Sintaxe: POINTER_DBF( [ExpA] [,ExpL] )
   Funcao.: acha/restaura ponteiro dos dbf do vetor sistema
               ExpA = arranjo de RECNO() dos dbf do vetor sistema
               ExpL = se .t. deixa abertos os dbf's usados apos salvamento
   Retorna: arranjo de RECNO() dos dbf do vetor sistema
*/
FUNC POINTER_DBF(reg_dbf, deixa_ab)
LOCAL t, i_, ar_, i_reg, i_ord, i_tmp, db_, db_s, repoe:=(reg_dbf!=NIL), rel_dbf:={}, seq_dbf, cp_, db_r
PRIV cpord:="", criterio:="", chv_rela:="", chv_1:=""
deixa_ab=IF(deixa_ab=NIL,.f.,deixa_ab)
IF !repoe                                // ira retornar os RECNO() de cada dbf
   reg_dbf:={}                           // inicializa vetor de retorno
   ar_=ALIAS()                           // salva area atual
ENDI
FOR t=1 TO nss                           // para cada sistema do vetor sistema...
   db_=sistema[t,O_ARQUI,O_NOME]         // nome do dbf
   db_s=LEFT(db_,3)+"_SEQ"             // nome do dbf de sequencia
   IF repoe                              // vai repor os ponteiros dos dbf's
      IF reg_dbf[t,1]>=0                 // se o arquivo estava aberto
         IF !EMPTY(SELECT(db_))           // se o dbf esta aberto
            IF LEN(reg_dbf[t,3])=0 .AND. LEN((db_)->(INDEXKEY(LEN(sistema[t,O_INDIC])+1)))>0
               CLOSE (db_)                  // e ind tmp nao for o mesmo
            ENDI                          // fecha arq para abrir ind novamente
         ENDI

         #ifdef COM_REDE
            USEARQ(db_,.f.)              // selecina ou abre o arquivo
         #else
            USEARQ(db_)                  // selecina ou abre o arquivo
         #endi

         IF LEN(reg_dbf[t,3])>0          // tinha indice temporario
            IF INDEXKEY(LEN(sistema[t,O_INDIC])+1)<>reg_dbf[t,3]
               cpord=reg_dbf[t,3]          // se nao for o mesmo
               INDTMP()                    // indexa novamente
            ENDI
         ENDI
         DBSETORDER(reg_dbf[t,2])        // restaura o indice e o
         GO reg_dbf[t,1]                 // seu ponteiro
         SET RELA TO                     // retira todas as relacoes existentes
         IF reg_dbf[t,5]>=0              // se tem sequencial
            USEARQ(db_s,.f.,,,.f.)       // abre arquivo de cps sequencial
            GO reg_dbf[t,5]              // e reposiciona seu ponteiro
         ENDI
      ELSE                               // se o arquivo estava fechado
         IF !EMPTY(SELECT(db_)) .AND.;   // e agora esta aberto
            !deixa_ab                    // e quer fechar,
            CLOSE (db_)                  // entao vamos fecha-lo
         ENDI
      ENDI
   ELSE                                  // acha situacao dos dbf's
      IF !EMPTY(SELECT(db_))             // se o dbf esta aberto
         i_reg=(db_)->(RECNO())          // pega o seu ponteiro
         i_ord=(db_)->(INDEXORD())    // e o seu indice atual
         i_tmp=(db_)->(INDEXKEY(LEN(sistema[t,O_INDIC])+1))   // indice temporario
         rel_dbf:={}                     // relacoes do arquivo
         i_=1                            // pega todas que existir
         DO WHILE LEN((db_)->(DBRELATION(i_)))>0
            AADD(rel_dbf,{(db_)->(DBRELATION(i_)),ALIAS((db_)->(DBRSELECT(i_)))}) // adiciona ponteiro ao vetor de retorno
            i_++
         ENDD
         IF !EMPTY(SELECT(db_s))           // se o dbf de sequencial esta aberto
            seq_dbf=(db_s)->(RECNO())    // pega o seu ponteiro
         ELSE
            seq_dbf=-1                   // nao tem cp sequencial
         ENDI
      ELSE                               // caso contrario vamos
         i_tmp=""
         i_reg:=i_ord:=seq_dbf := -1       // nao tem relacao zera o vetor
         rel_dbf:={}
      ENDI
      AADD(reg_dbf,{i_reg,i_ord,i_tmp,rel_dbf,seq_dbf})     // adiciona ponteiro ao vetor de retorno
   ENDI
NEXT
IF !repoe                                // se esta enchendo o vetor, adiciona
   AADD(reg_dbf,ar_)                     // a area atual no ultimo elemento
ELSE                                     // se esta restabelecendo,
   FOR t=1 TO nss                        // vamos recolocar as relacoes...
      db_=sistema[t,O_ARQUI,O_NOME]      // nome do dbf
      IF LEN(reg_dbf[t,4])>0             // tem relacoes?
         SELE (db_)                      // vai para area do dbf
         FOR i_=1 TO LEN(reg_dbf[t,4])   // e corre todos as relacoes anteriores
            cp_=reg_dbf[t,4,i_,1]        // expresao de ligacao
            db_r=reg_dbf[t,4,i_,2]       // dbf de ligacao
            SET RELA ADDI TO &cp_. INTO &db_r. // recoloca a relacao
         NEXT
      ENDI
   NEXT
   IF LEN(reg_dbf[nss+1])>0              // se tinha dbf aberto na area atual
      SELE (reg_dbf[nss+1])              // vamos abri-lo
   ELSE
      SELE 0                             // abre primeira area livre
   ENDI
ENDI
RETU reg_dbf              

DBFNSX/1012 corrupcao no arq de indice NSX

Enviado: 10 Mai 2011 19:22
por Alexandre Silva
Me responda uma coisa, tem mais algum outro aplicativo seu ou de terceiros usando esses DBF ou INDICE que não é compilado com o a versão do Harbour que você está usando ?
.. acho que nao tinha entendido.. sim existe uma rotina externa que tb le os indices da ordprod, mas apenas le, e é compilada com o mesmo harbour..uso dbsetindex pois preciso usar o indice 3 nesse caso..

Código: Selecionar todos

FUNCTION MAIN()
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_ES850C
Request dbfNSX
Rddsetdefault("dbfNSX")
Dbsetdriver("dbfNSX")
vindice:='.NSX'
cls
vconta:=0
set talk off
set bell off
set status off
set console off
set scoreboard off
set wrap on
SET DELETED ON // <==
set intensity on
set confirm on
set escape on
set message to 24 center
set date british
set decimals to 2
set century on
set epoch to 1930
*---------
vetsit:={}
aadd(vetsit,"R")
aadd(vetsit,"*")
aadd(vetsit,"G")
aadd(vetsit,"A")
aadd(vetsit,"S")
aadd(vetsit,"E")
*--
SELE 0
USE ORDPROD ALIAS ORDPROD shared
dbsetindex("ordprod1"+vindice)
dbsetindex("ordprod2"+vindice)
dbsetindex("ordprod3"+vindice)
dbsetindex("ordprod4"+vindice)
dbsetindex("ordprod5"+vindice)