Bug Maria_Connect() FWH-24.07 64 bits ???

Cgallegoa
Posts: 494
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador
Contact:

Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Cgallegoa »

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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

MSVC 64 bits or BCC 64 bits?
attached example
Where is it please?
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Enrico Maria Giordano »

Here it is:

Code: Select all | Expand

#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
//------------------------------------//
Cgallegoa
Posts: 494
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Cgallegoa »

Thanks mr Rao.

FWH-24.07,
xHarbour 1.3.1 Build 20240624
Borland 7.70,
all in 64 bits
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

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
Cgallegoa
Posts: 494
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Cgallegoa »

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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

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: Select all | Expand

#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
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Enrico Maria Giordano »

nageswaragunupudi wrote:Meanwhile, can you please test another minor variation?
Same problem.
Cgallegoa
Posts: 494
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Cgallegoa »

Meanwhile, can you please test another minor variation?
Same problem
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

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: Select all | Expand

#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
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

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
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by Enrico Maria Giordano »

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: Select all | Expand

( 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. :-(
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

I sent you a personal email
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Bug Maria_Connect() FWH-24.07 64 bits ???

Post by nageswaragunupudi »

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: Select all | Expand

( 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
Post Reply