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

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

Postby Cgallegoa » Fri Sep 20, 2024 6: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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

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

Postby nageswaragunupudi » Sat Sep 21, 2024 2:08 am

MSVC 64 bits or BCC 64 bits?

attached example

Where is it please?
Regards

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

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

Postby Enrico Maria Giordano » Sat Sep 21, 2024 7:33 am

Here it is:

Code: Select all  Expand view
#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
//------------------------------------//
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Cgallegoa » Sat Sep 21, 2024 1: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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

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

Postby nageswaragunupudi » Sat Sep 21, 2024 6: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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby Cgallegoa » Sun Sep 22, 2024 1: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-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 492
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

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

Postby nageswaragunupudi » Sun Sep 22, 2024 2: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: Select all  Expand view
#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
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby Enrico Maria Giordano » Sun Sep 22, 2024 7:47 am

nageswaragunupudi wrote:Meanwhile, can you please test another minor variation?


Same problem.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Cgallegoa » Sun Sep 22, 2024 1:48 pm

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

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

Postby nageswaragunupudi » Sun Sep 22, 2024 5: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: Select all  Expand view
#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: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India


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

Postby nageswaragunupudi » Sun Sep 22, 2024 6: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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby Enrico Maria Giordano » Sun Sep 22, 2024 7: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: Select all  Expand view
( 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
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby nageswaragunupudi » Sun Sep 22, 2024 7:27 pm

I sent you a personal email
Regards

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

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

Postby nageswaragunupudi » Sun Sep 22, 2024 7: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: Select all  Expand view
( 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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 53 guests