Re: [Harbour] Win98 + MT crash
Przemek, If possible then I would like to ask you to make final tests. Now it should work even with CodeGuard. Tested with Rev12933, with and without CodeGuard. All tests/mt/mttest*.prg (apart from mttest10.prg that needs GUI) are working now on both WinNT and Win95. btw, my Win95 machine is a Pentium-S 100MHz 96MB ram, so I modified mttest06 and mttest07 to use smaller N_COUNT and N_JOBS when running with CodeGuard (unmodified mttest05 took 3 hours to finished). Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Thu, 19 Nov 2009, Chen Kedem wrote: Hi, If possible then I would like to ask you to make final tests. Now it should work even with CodeGuard. Tested with Rev12933, with and without CodeGuard. All tests/mt/mttest*.prg (apart from mttest10.prg that needs GUI) are working now on both WinNT and Win95. Thank you very much for you help and tests. So now Win9x builds are functional again at least for base core code. It will be good to make peridically some regression tests. btw, my Win95 machine is a Pentium-S 100MHz 96MB ram, so I modified mttest06 and mttest07 to use smaller N_COUNT and N_JOBS when running with CodeGuard (unmodified mttest05 took 3 hours to finished). Ops, yes this values were tunes for modern computers and native executing without CodeGuard/Valgrind or other similar virtual environment. Again thank you for your time. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: Re:[Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, Executing hbmk2.exe (Rev12895) on a Win95 I get an error message that the program try to access undefined function InterlockedCompareExchange in KERNEL32.DLL This function exists on WinNT but not on Win95, maybe the same is true for Win98. It is used in vm/dlmalloc.c and vm/fm.c Thank you very much for the information. This function is used only by DLMALLOC code which is enabled by default in MSVC, BORLAND, MINGW and WATCOM windows builds. Please try to recompile Harbour without DLMALLOC using HB_FM_WIN_ALLOC macro, i.e.: set HB_USER_PRGFLAGS=-DHB_FM_WIN_ALLOC And check if it's enough to run Harbour application in Win95. If yes then we can change dlmalloc.c to use something different for spinlocks what will not cause problems for Win9x. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
Przemek, Please try to recompile Harbour without DLMALLOC using HB_FM_WIN_ALLOC macro, i.e.: set HB_USER_PRGFLAGS=-DHB_FM_WIN_ALLOC And check if it's enough to run Harbour application in Win95. I guess its set HB_USER_CFLAGS=-DHB_FM_WIN_ALLOC On WinNT all is the same (working), on the Win95 I get huge amount of CodeGuard erros when trying to run hbmk2.exe (just the exe without parameters) I do (on the WinNT): ..\bin\hbmk2 mttest01 and run mttest01.exe on the Win95, I get the expected Harbour run time error. if I do this (on the WinNT): ..\bin\hbmk2 -mt mttest01 and run mttest01.exe on the Win95, well, it crashed Windows into BSoD. Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, Please try to recompile Harbour without DLMALLOC using HB_FM_WIN_ALLOC macro, i.e.: set HB_USER_PRGFLAGS=-DHB_FM_WIN_ALLOC And check if it's enough to run Harbour application in Win95. I guess its set HB_USER_CFLAGS=-DHB_FM_WIN_ALLOC Yes, sorry my typo. On WinNT all is the same (working), on the Win95 I get huge amount of CodeGuard erros when trying to run hbmk2.exe (just the exe without parameters) What errors? Do you have the same errors when you use: set HB_USER_CFLAGS=-DHB_FM_STD_ALLOC instead of HB_FM_WIN_ALLOC? I do (on the WinNT): ..\bin\hbmk2 mttest01 and run mttest01.exe on the Win95, I get the expected Harbour run time error. if I do this (on the WinNT): ..\bin\hbmk2 -mt mttest01 and run mttest01.exe on the Win95, well, it crashed Windows into BSoD. But I guess it was working on WinNT. Can you catch the exact place where it's crashing? I'm interesting in C call stack. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
Przemek, on the Win95 I get huge amount of CodeGuard erros when trying to run hbmk2.exe (just the exe without parameters) What errors? See sample at the end. Do you have the same errors when you use: set HB_USER_CFLAGS=-DHB_FM_STD_ALLOC instead of HB_FM_WIN_ALLOC? Yes, the same type of CodeGuard errors. (only on the Win95, in the WinNT it works all the time with no errors) Also, all the errors CodeGuard report have the same ThreadID. Can you catch the exact place where it's crashing? I'm interesting in C call stack. Got it! Harbour is complied with set HB_USER_CFLAGS=-DHB_FM_STD_ALLOC --tt1.prg-- proc test return --- ..\bin\hbmk2 -debug -inc -mt tt1 -w -n -b cg32.lib (I used -inc so I'll have c output files, but it was a clean test) When running tt1.exe on Win95 I get: Error 1. 0x100400 (Thread 0xFFFD209F): Access in invalid memory: Attempt to access 488 byte(s) at 0x. memset(0x, 0x00 [' Call Tree: 0x004483DD(=TT1.EXE:0x01:0473DD) ../../../../ESTACK.C#165 0x004490D2(=TT1.EXE:0x01:0480D2) ../../../../ESTACK.C#354 0x0040D69F(=TT1.EXE:0x01:00C69F) ../../../../HVM.C#670 0x0040DF69(=TT1.EXE:0x01:00CF69) ../../../../HVM.C#916 0x00479889(=TT1.EXE:0x01:078889) ../../../../MAINSTD.C#96 0x0053DCDE(=TT1.EXE:0x01:13CCDE) -- Error 2. 0x110400 (Thread 0xFFFD209F): Access in invalid stack: Attempt to access 4 byte(s) at 0x007BFD70. Call Tree: 0x00476B6C(=TT1.EXE:0x01:075B6C) ../../../../EXTRAP.C#197 0xBFF9A3FB(=KERNEL32.DLL:0x02:0223FB) 0x005369AE(=TT1.EXE:0x01:1359AE) 0xBFF7663C(=KERNEL32.DLL:0x01:00563C) 0xBFF859FA(=KERNEL32.DLL:0x02:00D9FA) 0xFFECBAD7 -- Error 3. 0x11 (Thread 0xFFFD209F): Pointer in invalid stack: 0x007BFD70. Call Tree: 0x00476C16(=TT1.EXE:0x01:075C16) ../../../../EXTRAP.C#204 0xBFF9A3FB(=KERNEL32.DLL:0x02:0223FB) 0x005369AE(=TT1.EXE:0x01:1359AE) 0xBFF7663C(=KERNEL32.DLL:0x01:00563C) 0xBFF859FA(=KERNEL32.DLL:0x02:00D9FA) 0xFFECBAD7 -- : -- Error 00031. 0x110400 (r) (Thread 0xFFFD209F): Access in invalid stack: Attempt to access 4 byte(s) at 0x007BFD8C. Call Tree: 0x00476BC6(=TT1.EXE:0x01:075BC6) ../../../../EXTRAP.C#203 0xBFF9A3FB(=KERNEL32.DLL:0x02:0223FB) 0x005369AE(=TT1.EXE:0x01:1359AE) Error 00032. 0x300010 (Thread 0xFFFD209F): Resource leak: The memory block (0xBD392C) was never freed The memory block (0x00BD392C) [size: 12 bytes] was allocated with malloc Call Tree: 0x00453023(=TT1.EXE:0x01:052023) ../../../../FM.C#592 0x00446562(=TT1.EXE:0x01:045562) ../../../../DYNSYM.C#122 0x00446A10(=TT1.EXE:0x01:045A10) ../../../../DYNSYM.C#252 0x00426583(=TT1.EXE:0x01:025583) ../../../../HVM.C#7790 0x00426747(=TT1.EXE:0x01:025747) ../../../../HVM.C#7830 0x00408F3C(=TT1.EXE:0x01:007F3C) debugger.c#771 -- Error 00033. 0x300010 (Thread 0xFFFD209F): Resource leak: The memory block (0xBD5924) was never freed The memory block (0x00BD5924) [size: 12 bytes] was allocated with malloc Call Tree: 0x00453023(=TT1.EXE:0x01:052023) ../../../../FM.C#592 0x00446562(=TT1.EXE:0x01:045562) ../../../../DYNSYM.C#122 0x00446A10(=TT1.EXE:0x01:045A10) ../../../../DYNSYM.C#252 0x00426583(=TT1.EXE:0x01:025583) ../../../../HVM.C#7790 0x00426747(=TT1.EXE:0x01:025747) ../../../../HVM.C#7830 0x004E20A5(=TT1.EXE:0x01:0E10A5) rddsys.c#24 -- : And many more, I had to kill the program. Without -mt flag, the program run with no errors. Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, Yes, the same type of CodeGuard errors. (only on the Win95, in the WinNT it works all the time with no errors) Also, all the errors CodeGuard report have the same ThreadID. It looks like a problem with TLS data. It's possible that on Win9x it has different low level representation and our ASM inline code does not work correctly. Can you make yet another test with harbour compiled with HB_USE_TLS macro i.e.: set HB_USER_CFLAGS=-DHB_USE_TLS -DHB_FM_STD_ALLOC best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
Przemek, Can you make yet another test with harbour compiled with HB_USE_TLS macro i.e.: set HB_USER_CFLAGS=-DHB_USE_TLS -DHB_FM_STD_ALLOC The build (on the NT) fail with lots (I killed it after 40,000 errors) of CodeGuard errors while running hbmk2.exe in the Making shared version of Harbour binaries I get these errors also if I just execute hbmk2.exe with no parameters. (all tests where made with Rev12895) Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, Can you make yet another test with harbour compiled with HB_USE_TLS macro i.e.: set HB_USER_CFLAGS=-DHB_USE_TLS -DHB_FM_STD_ALLOC The build (on the NT) fail with lots (I killed it after 40,000 errors) of CodeGuard errors while running hbmk2.exe in the Making shared version of Harbour binaries I get these errors also if I just execute hbmk2.exe with no parameters. (all tests where made with Rev12895) Yes, but it is result of CodeGuard bug which do not works well with __thread static variables so this is expected behavior. Can you make simple runtime test without CodeGuard? I would like to locate the reason of problem. Then we can look for possible workarounds. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
Przemek, Yes, but it is result of CodeGuard bug which do not works well with __thread static variables Opps forgot about it. set HB_USER_CFLAGS=-DHB_USE_TLS -DHB_FM_STD_ALLOC With this and without CodeGuard, mttest01.prg run well on Win95. Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, Yes, but it is result of CodeGuard bug which do not works well with __thread static variables Opps forgot about it. set HB_USER_CFLAGS=-DHB_USE_TLS -DHB_FM_STD_ALLOC With this and without CodeGuard, mttest01.prg run well on Win95. Thank you very much for your tests. I've have just committed modification which disables ASM inline macros for TLS and InterlockedCompareExchange[Pointer]() in DLMALLOC. If possible then I would like to ask you to make final tests. Now it should work even with CodeGuard. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
Przemek, If possible then I would like to ask you to make final tests. Now it should work even with CodeGuard. Will do that tomorrow morning. Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Chen Kedem wrote: Hi, If possible then I would like to ask you to make final tests. Now it should work even with CodeGuard. Will do that tomorrow morning. Thank you very much. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Win98 + MT crash
On Wed, 18 Nov 2009, Szak�ts Viktor wrote: Hi Przemek and All, After seeing reports on HMG Forum about hbmk2 failing on Win98, I verified it myself and there is indeed something wrong with MT mode on Win98 systems, and it's not directly related to compiler. So hbmk2 was the test program I used, BCC 5.5 and MinGW 4.4.1 builds. Running hbmk2.exe without parameter, gave these results: (no console output appeared so it must be crashing in startup phase) As I wrote in last message in related thread please try to reduce the problem using .prg files in tests/mt. Are all of them crashing? If yes then please try to run mttest01.prg compiled by MINGW in GDB to see where it crashes. best regards, Przemek ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re:[Harbour] Win98 + MT crash
Executing hbmk2.exe (Rev12895) on a Win95 I get an error message that the program try to access undefined function InterlockedCompareExchange in KERNEL32.DLL This function exists on WinNT but not on Win95, maybe the same is true for Win98. It is used in vm/dlmalloc.c and vm/fm.c Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
RE: Re:[Harbour] Win98 + MT crash
I wrote: Executing hbmk2.exe (Rev12895) on a Win95 I get an error message that the program try to access undefined function InterlockedCompareExchange in KERNEL32.DLL Another test (Rev12895, BCC32, WinNT): ..\bin\hbmk2 mttest01 Running mttest01.exe on both WinNT and Win95 I get an Argument error HB_THREADJOIN. ..\bin\hbmk2 -mt mttest01 mttest01.exe run fine on WinNT and missing InterlockedCompareExchange error on Win95. It is used in vm/dlmalloc.c and vm/fm.c And in external/sqlite3/sqlite3.c Chen. ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour