Page 1 of 3
Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Fri Sep 20, 2024 6:40 pm
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 ?
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 2:08 am
by nageswaragunupudi
MSVC 64 bits or BCC 64 bits?
attached example
Where is it please?
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 7:33 am
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
//------------------------------------//
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 1:11 pm
by Cgallegoa
Thanks mr Rao.
FWH-24.07,
xHarbour 1.3.1 Build 20240624
Borland 7.70,
all in 64 bits
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sat Sep 21, 2024 6:10 pm
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]
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 1:43 am
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.
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 2:15 am
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
//------------------------------------//
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 7:47 am
by Enrico Maria Giordano
nageswaragunupudi wrote:Meanwhile, can you please test another minor variation?
Same problem.
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 1:48 pm
by Cgallegoa
Meanwhile, can you please test another minor variation?
Same problem
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 5:09 pm
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.
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 5:57 pm
by Enrico Maria Giordano
Works fine here!
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 6:55 pm
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.
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 7:18 pm
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.
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 7:27 pm
by nageswaragunupudi
I sent you a personal email
Re: Bug Maria_Connect() FWH-24.07 64 bits ???
Posted: Sun Sep 22, 2024 7:30 pm
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?