FWH64 : ERROR SE SALE DEL SISTEMA

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Antonio Linares » Wed Aug 21, 2024 7:04 am

Carlos,

Investigando en el error de xHarbour 64, no es tanto por el uso de hb_gcAll() sino por estas dos líneas en tu función CheckConect()

IsQry:= oServer:Query("Select 1")
IsQry:End()

Si comentas esas dos líneas, hb_gcAll() funciona bien

Estamos más cerca de resolverlo... :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Enrico Maria Giordano » Wed Aug 21, 2024 8:05 am

I need a minimal PRG sample to reproduce the problem here, sorry. Carlos, can you provide it?
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby CARLOS ATUNCAR » Fri Aug 23, 2024 4:28 pm

Antonio, lo cambie de esta forma

if oServer:ping()
IsQry:= oServer:QueryResult("Select 1")
Else
lConn := .F.
Endif

y descomente HB_GCALL( .F. ) // limpiamos la memoria

y si trabaja sin problema, pero con las lib que enviastes no he probado con las lib de la descarga
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby CARLOS ATUNCAR » Fri Aug 23, 2024 4:50 pm

Antonio, he creado este ejemplo y lo he compilado con buildx64.bat y si funciona lo anterior

Code: Select all  Expand view  RUN
#include "fivewin.ch"

Static oServer

Function Main

oServer := connect()
If CheckConect()
   ?"EXISTE CONEXION AL SERVIDOR"
Endif
OServer:End()
Return nil

Static Function Connect
LOCAL oServer
LOCAL cServer, cUser, cPassword, cDBName

cServer   := GetPvProfString("mysql","host"    ," " ,".\connect.ini")
cUser     := GetPvProfString("mysql","user"    ," " ,".\connect.ini")
cPassword := GetPvProfString("mysql","psw"     ," " ,".\connect.ini")
cDBName   := GetPvProfString("mysql","dbname"  ," " ,".\connect.ini")

// abrimos la conexion
TRY
   FWCONNECT oServer HOST cServer ;
                     USER cUser ;
                     PASSWORD cPassword ;
                     DATABASE cDBName
CATCH oErr
   oServer:ShowError()
END

Return oServer


Function CheckConect
local IsQry,aWait
local lConn:= .T.

Try
   if oServer:ping()
      IsQry := oServer:Query("Select 1 AS num")    
      IsQry:End()
   Else
      lConn := .F.
   Endif
Catch o
   Try
      oServer:ReConnect()
      SysRefresh()
   Catch e
      lConn := .F.
      oServer:Showerror()
   End
End

return lConn
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby CARLOS ATUNCAR » Fri Aug 23, 2024 4:57 pm

Con este ejemplo no llega al A2 salvo que comente la linea 104 oWait:end()

Code: Select all  Expand view  RUN
#include "fivewin.ch"

Static oServer

Function Main
local owait

WaitOn("Espere un momento....",@oWait )
HB_GCALL( .F. )
oServer := connect()
If CheckConect()
    ?"A1"
    WaitOff( @oWait )
    ?"A2"
   ?"EXISTE CONEXION AL SERVIDOR"
Endif
OServer:End()
Return nil

Static Function Connect
LOCAL oServer
LOCAL cServer, cUser, cPassword, cDBName

cServer   := GetPvProfString("mysql","host"    ," " ,".\connect.ini")
cUser     := GetPvProfString("mysql","user"    ," " ,".\connect.ini")
cPassword := GetPvProfString("mysql","psw"     ," " ,".\connect.ini")
cDBName   := GetPvProfString("mysql","dbname"  ," " ,".\connect.ini")

// abrimos la conexion
TRY
   FWCONNECT oServer HOST cServer ;
                     USER cUser ;
                     PASSWORD cPassword ;
                     DATABASE cDBName
CATCH oErr
   oServer:ShowError()
END

Return oServer


Function CheckConect
local IsQry,aWait
local lConn:= .T.

Try
   if oServer:ping()
      IsQry := oServer:Query("Select 1 AS num")    
      IsQry:End()
   Else
      lConn := .F.
   Endif
Catch o
   Try
      oServer:ReConnect()
      SysRefresh()
   Catch e
      lConn := .F.
      oServer:Showerror()
   End
End

return lConn

function waitOn( cCaption, oWait, cTitle )  //simula un waiton de grump
   LOCAL nWidth
   local lVal := .t.
   local oBrush
   local oImage, lSetAlpha := .t.
   local bAction  := { || .t. }

   default cTitle := "Usuario, un momento por favor"
   DEFINE BRUSH oBrush COLOR RGB( 192, 216, 255 )   //rosa


   IF cCaption == NIL
      DEFINE DIALOG oWait ;
         FROM 0,0 TO 5, Len( cTitle ) + 4 ;
         STYLE nOr( DS_MODALFRAME, WS_POPUP )  TRANSPARENT //BRUSH oBrush
   ELSE
      DEFINE DIALOG oWait ;
         FROM 0,0 TO 6, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
         TITLE cTitle ;
         STYLE DS_MODALFRAME  TRANSPARENT //BRUSH oBrush
   ENDIF

   oWait:cMsg   := cCaption

   nWidth := oWait:nRight - oWait:nLeft


   ACTIVATE DIALOG oWait CENTER ;
      ON PAINT oWait:Say( 1, 0, xPadC( oWait:cMsg, nWidth ) ) ;
      NOWAIT
   SysRefresh()


return (lVal)

//------------------------------------------------------------------------------

function WaitOff( oWait )
   IF valtype(oWait) != 'U'  /* waiton has to be called first! */
      oWait:end()
      oWait := NIL
   ENDIF
   sysRefresh()
RETURN NIL
 
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Antonio Linares » Fri Aug 23, 2024 5:03 pm

Estimado Carlos,

Es que el método End() al llamar o oWait:End() llama a hb_gcAll()

Enrico ya ha localizado el bug en xHarbour y esta trabajando para arreglarlo :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby CARLOS ATUNCAR » Fri Aug 23, 2024 5:07 pm

ok si sirve de ayuda con este cambio si funciona

Code: Select all  Expand view  RUN
#include "fivewin.ch"

Static oServer

Function Main
local owait

WaitOn("Espere un momento....",@oWait )
HB_GCALL( .F. )
oServer := connect()
If CheckConect()
    ?"A1"
    WaitOff( @oWait )
    ?"A2"
   ?"EXISTE CONEXION AL SERVIDOR"
Endif
OServer:End()
Return nil

Static Function Connect
LOCAL oServer,o
LOCAL cServer, cUser, cPassword, cDBName

cServer   := GetPvProfString("mysql","host"    ," " ,".\connect.ini")
cUser     := GetPvProfString("mysql","user"    ," " ,".\connect.ini")
cPassword := GetPvProfString("mysql","psw"     ," " ,".\connect.ini")
cDBName   := GetPvProfString("mysql","dbname"  ," " ,".\connect.ini")

// abrimos la conexion
TRY
   FWCONNECT oServer HOST cServer ;
                     USER cUser ;
                     PASSWORD cPassword ;
                     DATABASE cDBName
CATCH o
   oServer:ShowError()
END

Return oServer


Function CheckConect
local IsQry,aWait,o,e
local lConn:= .T.

Try
   if oServer:ping()
      IsQry := oServer:QueryResult("Select 1 AS num")    
      *IsQry:End()
   Else
      lConn := .F.
   Endif
Catch o
   Try
      oServer:ReConnect()
      SysRefresh()
   Catch e
      lConn := .F.
      oServer:Showerror()
   End
End

return lConn

function waitOn( cCaption, oWait, cTitle )  //simula un waiton de grump
   LOCAL nWidth
   local lVal := .t.
   local oBrush
   local oImage, lSetAlpha := .t.
   local bAction  := { || .t. }

   default cTitle := "Usuario, un momento por favor"
   DEFINE BRUSH oBrush COLOR RGB( 192, 216, 255 )   //rosa


   IF cCaption == NIL
      DEFINE DIALOG oWait ;
         FROM 0,0 TO 5, Len( cTitle ) + 4 ;
         STYLE nOr( DS_MODALFRAME, WS_POPUP )  TRANSPARENT //BRUSH oBrush
   ELSE
      DEFINE DIALOG oWait ;
         FROM 0,0 TO 6, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
         TITLE cTitle ;
         STYLE DS_MODALFRAME  TRANSPARENT //BRUSH oBrush
   ENDIF

   oWait:cMsg   := cCaption

   nWidth := oWait:nRight - oWait:nLeft


   ACTIVATE DIALOG oWait CENTER ;
      ON PAINT oWait:Say( 1, 0, xPadC( oWait:cMsg, nWidth ) ) ;
      NOWAIT
   SysRefresh()


return (lVal)

//------------------------------------------------------------------------------

function WaitOff( oWait )
   IF valtype(oWait) != 'U'  /* waiton has to be called first! */
      ?"ANTES DE FALLAR"
      oWait:end()
      oWait := NIL
   ENDIF
   sysRefresh()
RETURN NIL
 
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Enrico Maria Giordano » Sat Aug 24, 2024 9:09 am

What about removing all the calls to hb_gcall() from your program? Do you see any visible negative effect?
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Antonio Linares » Sat Aug 24, 2024 9:36 am

Dear Enrico,

We need to fix the xHarbour hb_gcAll() bug
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Enrico Maria Giordano » Sat Aug 24, 2024 10:02 am

I'm not sure it is a bug in xHarbour. However, I absolutely cannot fix it. I wrote to Ron in the xHarbour newsgroup. He's the only one that could understand the problem.
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Antonio Linares » Sat Aug 24, 2024 11:09 am

Dear Enrico,

> I wrote to Ron in the xHarbour newsgroup

Could you please provide the url to the posted msg ? many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Enrico Maria Giordano » Sat Aug 24, 2024 12:05 pm

There is no url for usenet. You have to use a news client (I'm using Thunderbird) and subscribe to a news server (I'm using eternal-september.org).
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Antonio Linares » Sat Aug 24, 2024 12:07 pm

Is it in google groups ?

thank you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby Enrico Maria Giordano » Sat Aug 24, 2024 1:02 pm

Google Groups is not updated with new usenet messages since February (Google decision).
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: FWH64 : ERROR SE SALE DEL SISTEMA

Postby CARLOS ATUNCAR » Sun Sep 08, 2024 4:36 am

Saludos Antonio, algún avance ?
Carlos Atuncar - CaSoftSystem
Chincha - Perú
carlosalbatun@gmail.com
CARLOS ATUNCAR
 
Posts: 176
Joined: Thu Sep 17, 2015 11:40 pm
Location: Chincha - Peru

PreviousNext

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 21 guests