Hi

See below the test cases producing positive results with latest SVN and:
1. tdm-mingw.4.4.1 and Qt 4.5.3 for MinGW
2. tdm-mingw.4.4.1 and Qt 4.6.0 for MinGW
3. VS2008 and Qt 4.6 for VS2008 
hbide, demoxbp and demoqt are executed crash free finally in the above listed 
test cases.

Regarding point 1. and 2. a very old problem regarding the demoqt crash on exit 
in default build mode is clarified.

See GDB output with Application Verifier enabled:

        GNU gdb 6.8
        Copyright (C) 2008 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.  Type "show 
copying"
        and "show warranty" for details.
        This GDB was configured as "i686-pc-mingw32"...
        (gdb) run
        Starting program: c:\Downloads\harbour\contrib\hbqt\tests/demoqt.exe
        [New thread 5544.0x10ac]
        warning: Page heap: pid 0x15A8: page heap enabled with flags 0x3.

        warning: AVRF: demoqt.exe: pid 0x15A8: flags 0x80443027: application 
verifier enabled

        [New thread 5544.0x142c]
        [New thread 5544.0x167c]
        [New thread 5544.0x1648]
        Error: dll starting at 0x71690000 not found.
        Error: dll starting at 0xd000000 not found.
        warning: Lowest section in C:\Windows\system32\normaliz.dll is .text at 
00401000

        Error: dll starting at 0x70dd0000 not found.
        BFD: C:\Windows\system32\SLC.dll: Warning: Ignoring section flag 
IMAGE_SCN_MEM_N
        OT_PAGED in section .reloc
        BFD: C:\Windows\system32\SLC.dll: Warning: Ignoring section flag 
IMAGE_SCN_MEM_N
        OT_PAGED in section .reloc
        warning: HEAP[demoqt.exe]:
        warning: Invalid address specified to RtlSizeHeap( 003B0000, 01A99C08 )


        Program received signal SIGTRAP, Trace/breakpoint trap.
        0x77068b2f in ntdll!DbgUiConvertStateChangeStructure ()
           from C:\Windows\system32\ntdll.dll
        (gdb) 

The crash is produced by:
        warning: HEAP[demoqt.exe]:
        warning: Invalid address specified to RtlSizeHeap( 003B0000, 01A99C08 )

The explanation of this event is, as I understand correctly, that malloc and 
free should be redefined to eliminate a conflict with the qt dll-s. 
This redefinition in fm.c is conditioned actually HB_FM_DLMT_ALLOC or 
USE_DL_PREFIX definition (An another solution is HB_FM_WIN_ALLOC with HB_OS_WIN 
not analyzed by me):

        #  if defined( HB_FM_DLMT_ALLOC )
        #     define malloc( n )         mspace_malloc( hb_mspace(), ( n ) )
        #     define realloc( p, n )     mspace_realloc( NULL, ( p ), ( n ) )
        #     define free( p )           mspace_free( NULL, ( p ) )
        #  elif defined( USE_DL_PREFIX )
        #     define malloc( n )         dlmalloc( ( n ) )
        #     define realloc( p, n )     dlrealloc( ( p ), ( n ) )
        #     define free( p )           dlfree( ( p ) )
        #  endif

The first (HB_FM_DLMT_ALLOC) definition generally is defined in MT mode. The 
second (USE_DL_PREFIX) as we can see:

        #  if defined( __BORLANDC__ )

        ...

        #  elif defined( __WATCOMC__ )

        ...

        #     if !defined( USE_DL_PREFIX ) && !defined( HB_FM_DLMT_ALLOC )
        #        define USE_DL_PREFIX
        #     endif
        #  elif defined( _MSC_VER )
        #     if !defined( USE_DL_PREFIX ) && !defined( HB_FM_DLMT_ALLOC )
        #        define USE_DL_PREFIX
        #     endif
        ...

        #  endif
        #  if defined( __cplusplus ) && ! defined( USE_DL_PREFIX )
        #     define USE_DL_PREFIX
        #  endif
        #  include "dlmalloc.c"

        ...

is not defined in ST and MinGW C mode. This sequences analysis explains my 
tests: The mingw build of the demoqt in C mode crashes on the first delete 
operator.
 
The solution is @set HB_USER_CFLAGS=-DUSE_DL_PREFIX.
Hopefully my conclusion is correct, but take into consideration that this is 
just an experiment and not "theory".

See below the script used for my tests:

     @echo PREREQUISITES:
     @echo 1) Installed Qt 4.5.3 for MinGW to the directory: C:/Qt/4.5.3/ ...
     @echo from: 
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.5.3-mingw.exe
     @echo 2) Installed tdm-mingw.4.4.1 to C:\devl\MinGWtdm\ ...
     @echo from: 
http://sunet.dl.sourceforge.net/project/tdm-gcc/TDM-MinGW%20Installer/1.908.0/tdm-mingw-1.908.0-4.4.1-2.exe
     @echo with dual SJLJ and Dwarf-2 installation into the same directory
     @echo Use just the installer without manual unzipping...  
     @echo 3) Updated c:\download\harbour with the latest SVN
     @pause

     @set HB_WITH_QT=C:/Qt/4.5.3/include
     @set HB_COMPILER=mingw
     @set HB_INSTALL_PREFIX=c:\harbour\mingw_4.5.3
     @set PATH=%PATH%;C:\devl\MinGWtdm\bin
     @cd c:\downloads\harbour

     @set HB_USER_CFLAGS=-DUSE_DL_PREFIX

     @win-make clean install

     @set HB_USER_CFLAGS=-DHB_TR_LEVEL_DEBUG
     @set HB_USER_PRGFLAGS=-D__HB_DEBUG__
     @cd c:\downloads\harbour\contrib\hbqt
     @c:\downloads\harbour\win-make clean install

     @set PATH=%PATH%;C:\harbour\mingw_4.5.3\bin
     @cd c:\downloads\harbour\contrib\hbide
     @hbmk2 -rebuild hbide.hbp
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @hbmk2 demoxbp.prg
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @hbmk2 demoqt.prg

     @set PATH=%PATH%;C:\Qt\4.5.3\bin
     @set HB_TR_LEVEL=HB_TR_DEBUG
     @set HB_TR_FLUSH=1
     @cd c:\downloads\harbour\contrib\hbide
     @hbide 2>c:\harbour\hbide.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @demoxbp 2>c:\harbour\demoxbp.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @gdb demoqt 2>c:\harbour\demoqt.trace.log
     @pause

....

     @echo PREREQUISITES:
     @echo 1) Installed Qt 4.5.3 for MinGW to the directory: C:/Qt/4.5.3/ ...
     @echo from: 
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.5.3-mingw.exe
     @echo 2) Installed tdm-mingw.4.4.1 to C:\devl\MinGWtdm\ ...
     @echo from: 
http://sunet.dl.sourceforge.net/project/tdm-gcc/TDM-MinGW%20Installer/1.908.0/tdm-mingw-1.908.0-4.4.1-2.exe
     @echo with dual SJLJ and Dwarf-2 installation into the same directory
     @echo Use just the installer without manual unzipping...  
     @echo 3) Updated c:\download\harbour with the latest SVN
     @pause

     @set HB_WITH_QT=C:/Qt/4.6.0M/include
     @set HB_INSTALL_PREFIX=c:\harbour\mingw
     @set PATH=%PATH%;C:\devl\MinGWtdm\bin
     @cd c:\downloads\harbour

     @set HB_USER_CFLAGS=-DUSE_DL_PREFIX

     @set HB_USER_LDFLAGS=-static-libgcc
     @set HB_USER_DFLAGS=-static-libgcc
     @win-make clean install
     @set HB_USER_LDFLAGS=
     @set HB_USER_DFLAGS=
     @set HB_USER_CFLAGS=-DHB_TR_LEVEL_DEBUG
     @set HB_USER_PRGFLAGS=-D__HB_DEBUG__
     @cd c:\downloads\harbour\contrib\hbqt
     @c:\downloads\harbour\win-make clean install

     @set PATH=%PATH%;C:\harbour\mingw\bin
     @cd c:\downloads\harbour\contrib\hbide
     @hbmk2 -rebuild hbide.hbp
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @hbmk2 demoxbp.prg
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @hbmk2 demoqt.prg

     @set PATH=%PATH%;C:\Qt\4.6.0M\bin
     @set HB_TR_LEVEL=HB_TR_DEBUG
     @set HB_TR_FLUSH=1
     @cd c:\downloads\harbour\contrib\hbide
     @hbide 2>c:\harbour\hbide.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @demoxbp 2>c:\harbour\demoxbp.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @demoqt 2>c:\harbour\demoqt.trace.log
     @pause

...

     @echo PREREQUISITES:
     @echo Installed Qt 4.6 for vs2008 to the default directory: C:/Qt/4.6.0/ 
...
     @echo from: 
http://get.qt.nokia.com/qt/source/qt-win-opensource-4.6.0-vs2008.exe
     @echo Updated c:\download\harbour with the latest SVN
     @pause

     @set HB_WITH_QT=C:/Qt/4.6.0/include
     @set HB_INSTALL_PREFIX=c:\harbour\msvc
     @call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
     @cd c:\downloads\harbour
     @win-make clean install
     @set HB_USER_CFLAGS=-DHB_TR_LEVEL_DEBUG
     @set HB_USER_PRGFLAGS=-D__HB_DEBUG__
     @cd c:\downloads\harbour\contrib\hbqt
     @c:\downloads\harbour\win-make clean install

     @set PATH=%PATH%;C:\harbour\msvc\bin
     @cd c:\downloads\harbour\contrib\hbide
     @hbmk2 -rebuild hbide.hbp
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @hbmk2 demoxbp.prg
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @hbmk2 demoqt.prg

     @set PATH=%PATH%;C:\Qt\4.6.0\bin
     @set HB_TR_LEVEL=HB_TR_DEBUG
     @set HB_TR_FLUSH=1
     @cd c:\downloads\harbour\contrib\hbide
     @hbide 2>c:\harbour\hbide.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbxbp\tests
     @demoxbp 2>c:\harbour\demoxbp.trace.log
     @pause
     @cd c:\downloads\harbour\contrib\hbqt\tests
     @demoqt 2>c:\harbour\demoqt.trace.log
     @pause

Best regards,
István


_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to