Hi,

Confirmed on Fedora 11 with qt 4.5.2 as native package.

Both 'hbmk2 demoxbp' and 'hbmk2 -static demoxbp' builds are fully operational.
So the pointer to a variable resident temporary on the stack was the problem.

Best regards,
István 

-----Original Message-----
From: Bisz István [mailto:istvan.b...@t-online.hu] 
Sent: 2009. szeptember 10. 13:52
To: 'Harbour Project Main Developer List.'
Subject: RE: [Harbour] demoxbp segfault in Fedora 11

Hi,

The segfault error is fixed with the a correction in QApplication.cpp, see 
below. The problem was with 'argc' passed to Qt by reference:

QApplication ( int & argc, char ** argv )

I just moved it out from the stack. Now the 'hbmk2 demoxbp' and 'hbmk2 -static 
demoxbp' builds are running. Tested until now on CentOS 5.3 with qtsdk-2009.03. 

Best regards,
István

Index: QApplication.cpp
===================================================================
--- QApplication.cpp    (revision 12449)
+++ QApplication.cpp    (working copy)
@@ -89,6 +89,9 @@
 static QApplication * app = NULL;
 static bool hbqtinit = false;
 
+int argc1;
+char ** argv1;
+
 /*
  * QApplication ( int & argc, char ** argv )
  * QApplication ( int & argc, char ** argv, bool GUIenabled )
@@ -129,15 +132,17 @@
 
 static void hbqt_Init( void * cargo )
 {
+/*
    int argc;
    char ** argv;
+*/
 
    HB_SYMBOL_UNUSED( cargo );
 
-   argc = hb_cmdargARGC();
-   argv = hb_cmdargARGV();
+   argc1 = hb_cmdargARGC();
+   argv1 = hb_cmdargARGV();
 
-   app = new QApplication( argc, argv );
+   app = new QApplication( argc1, argv1 );
 
    if( app )
       hbqtinit = true;
@@ -145,7 +150,7 @@
    if( ! hbqtinit )
       hb_errInternal( 11001, "hbqt_Init(): QT Initilization Error.", NULL, 
NULL );
 
-   hb_cmdargInit( argc, argv );
+   hb_cmdargInit( argc1, argv1 );
 
    hb_vmAtExit( hbqt_Exit, NULL );
 }


-----Original Message-----
From: Przemyslaw Czerpak [mailto:dru...@acn.waw.pl] 
Sent: 2009. szeptember 6. 12:46
To: Harbour Project Main Developer List.
Subject: Re: [Harbour] demoxbp segfault in Fedora 11

On Sat, 05 Sep 2009, Szak�ts Viktor wrote:

Hi,

>> Yes, it is normal to exclude the fulstatic case from shared, static and
>> fulstatic test cases. But back to the original issue, why have we 
>> different
> I'm not sure I understand the issue here. I'd still be interested
> how can it happen that gpm is detected at build time but missing
> at hbmk2 time.

We do not link anything in core code using full static mode so we
do not know if it works.
I guess that gpm-devel is installed only with shared library and
libgpm.a is not installed.

>> behavior between shared and static builds? The same problem appears with
>> demoqt buils. It's time to go deeper in these issues.
> No idea, I hope someone will be able to give some hints.

Not all libraries are installed in static mode. Please also remember
that not all features can work in static mode so full static binaries
may not be fully functional.

best regards,
Przemek


_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to