FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug Maria_Connect() FWH-24.07 64 bits ???
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Fri Sep 20, 2024 06:40 PM

Hi team,

I'm encountering an unexpected issue in María_Connect() FWH-24.07 64-bit. I'm wondering if it's a bug or if I've overlooked something:

Please try the following steps: compile the attached example, run it, click on "Show table Customer", open and close the browse, and then click "Show table Customer" again. After closing the table the second time, the program inexplicably terminates without any error messages.

I suspect there might be an underlying issue with the RowSet() function.

Antonio, Rao, could you help us ?

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 02:08 AM
MSVC 64 bits or BCC 64 bits?
attached example
Where is it please?
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 07:33 AM
Here it is:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()
   LOCAL oDlg

   SET DATE ITALIAN
   SET CENTURY ON

   DEFINE DIALOG oDlg SIZE 320,200 PIXEL TRUEPIXEL TITLE "Bug Maria_Connect() ???"
        @ 40,70 BUTTON "Show Table Customer" OF oDlg PIXEL ACTION ShowTable( ) SIZE 180,40
     ACTIVATE DIALOG oDlg CENTERED

return nil
//------------------------------------//

Function ShowTable( )
   LOCAL aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
                 "209.250.245.152,fwh,fwhuser,FiveTech@2022" }
   LOCAL oCn, oRs
       
   oCn := Maria_Connect(  aStr[ 1 ] , .T.)
   oRs   := oCn:RowSet( "customer" )

   xBrowse(oRs)

   oCn:Close()

Return NIL
//------------------------------------//
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 01:11 PM

Thanks mr Rao.

FWH-24.07,

xHarbour 1.3.1 Build 20240624

Borland 7.70,

all in 64 bits

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 06:10 PM

For some reasons I am not able to use xHarbour64 right now. I will test and get back in a day or two.

But I did test exactly the same program you provided with xHarbour and Harbour bcc 32 bits, Harbour MSVC 32 bits and Harbour MSVC 64 bits

In all the 4 cases the program worked perfectly and opened customer table as many times as I wantd.

I will also test with xHarbour 64 bits soon and get back.

Please be rest assured both maria_Connect() and RowSet() classes work perfectly and have no issues.

In this example, we are connecting to and disconnecting from the server every time. Normally we connect once at the start of the application at the close at the end of the application. Sometimes we may exceed the server limits. aStr[ 1 ] is located in NewYork and a[2] is located in Europe.

Also please try with aStr[2]

Regards



G. N. Rao.

Hyderabad, India
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 01:43 AM

Mr. Rao,

With xHarbour and Harbour, both in 32 bits, it works perfectly.

With Harbour 64 bits, it works perfectly.

Definitely the problem is with xHarbour 64 bits.

I've tried with different servers, even localhost, etc. and it's always the same. A table opens, closes, then the same or another table opens again, and after a few seconds the application exits without any error or message. It simply closes on its own.

I eagerly await any guidance on how to fix it.

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 02:15 AM
I understand.
I will test with xHarbiour64 and get back.
Earlier also I remember we found a low level issue with release of memory when oCn and oRs variables are released.

Meanwhile, can you please test another minor variation?
Code (fw): Select all Collapse
#include "fivewin.ch"

static oCn

function Main()
   LOCAL oDlg

   LOCAL aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
                 "209.250.245.152,fwh,fwhuser,FiveTech@2022" }

   oCn := Maria_Connect(  aStr[ 1 ] , .T.)


   DEFINE DIALOG oDlg SIZE 320,200 PIXEL TRUEPIXEL TITLE "Bug Maria_Connect() ???"
   @ 40,70 BUTTON "Show Table Customer" OF oDlg PIXEL ACTION ShowTable( ) SIZE 180,40
   ACTIVATE DIALOG oDlg CENTERED

   oCn:Close()

return nil
//------------------------------------//

Function ShowTable( )

   LOCAL oRs

   oRs   := oCn:RowSet( "customer" )

   xBrowse( oRs )

   oRs:Close()

Return NIL
//------------------------------------//
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 07:47 AM
nageswaragunupudi wrote:Meanwhile, can you please test another minor variation?
Same problem.
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 01:48 PM
Meanwhile, can you please test another minor variation?
Same problem

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 05:09 PM
Thank you both a lot.

I would be extremely thankful if you kindly take a little more trouble by testing this variation.
This would help me to narrow down the problem
Code (fw): Select all Collapse
#include "fivewin.ch"

static oCn, oRs

function Main()
   LOCAL oDlg

   LOCAL aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
                   "209.250.245.152,fwh,fwhuser,FiveTech@2022" }

   oCn := Maria_Connect(  aStr[ 1 ] , .T.)

   DEFINE DIALOG oDlg SIZE 320,200 PIXEL TRUEPIXEL TITLE "Bug Maria_Connect() ???"
   @ 40,70 BUTTON "Show Table Customer" OF oDlg PIXEL ACTION ShowTable( ) SIZE 180,40
   ACTIVATE DIALOG oDlg CENTERED

   oCn:Close()

return nil
//------------------------------------//

Function ShowTable( )

   static cTable   := "states"

   if cTable == "states"
      cTable   := "customer"
   else
      cTable   := "states"
   endif

   if oRs == nil
      oRs   := oCn:RowSet( "select * from " + cTable )
   else
      oRs:ReQuery( "select * from " + cTable )
   endif

   xBrowse( oRs )

Return NIL
//------------------------------------//
Thank you in advance.
Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 05:57 PM

Works fine here!

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 06:55 PM

The issue is narrowed down to release of variables oCn and oRs.

Kindly recall the issue we had with hb_gcall()

We seem to have some issue with the DESTRUCTOR methods of these classes and xHarbour 64 bits, though working fine with all other compilers.

Only you can help.

Regards



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 07:18 PM
No, sorry, only Ron can help, but he does not respond to my report in the newsgroup comp.lang.xharbour... :-(

Anyway, I made some tests and found that the problem could be with the call to the cleanup function of a block node:
Code (fw): Select all Collapse
( s_pCurrBlock->pFunc )( ( void * ) ( s_pCurrBlock + 1 ) );
I don't know why the fifth block (the fifth call) causes the crash. Too much for me, too many xHarbour internals are involved, sorry. I even don't know why there is that +1 in the expression. :-(
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 07:27 PM

I sent you a personal email

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 07:30 PM
Enrico Maria Giordano wrote:No, sorry, only Ron can help, but he does not respond to my report in the newsgroup comp.lang.xharbour... :-(

Anyway, I made some tests and found that the problem could be with the call to the cleanup function of a block node:
Code (fw): Select all Collapse
( s_pCurrBlock->pFunc )( ( void * ) ( s_pCurrBlock + 1 ) );
I don't know why the fifth block (the fifth call) causes the crash. Too much for me, too many xHarbour internals are involved, sorry. I even don't know why there is that +1 in the expression. :-(
I hope this is the same code in xHarbour both 32 and 64 bits.
Then, why should it work well in 32 bits and not 64 bits?
Regards



G. N. Rao.

Hyderabad, India