TThread class invokes Windows98's internal bug and system crashes
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
TThread class, in its constructor, calls WinAPI CreateThread function with the second parameter (stack size in bytes) set to 0. According to Microsoft documentation, system should allocate for the thread a stack which size corresponds to main thread's stack size. Unfortunately, Windows98 fails to do that, and calling TThread.Create (or calling the "Resume" method if thread was created suspended) leads to system crash (mostly "page fault in kernel32.dll" and sometimes "stack error in kernel32.dll") - I mean, real system-wide crash which hangs the computer and causes loss of all unsaved data in all applications... :(
But when non-zero stack size is specified in call to CreateThread, everything works just fine - I may say that, I switched in my program from WinAPI calls to using TThread class (porting to Linux in progress) and program started crashing. I put 0 in the CreateThread call in my old version, and it started crashing too.
Microsoft Windows 98, 4.10.1998 (Russian version), AMD Duron 800MHz, RAM 256Mb, motherboard based on the VIA chipset.
Additional information:
Reporter: Anton Rzheshevski aka Cheb
EMail: chebmaster at mtu-net dot ru
Mantis conversion info:
- Mantis ID: 4949
- OS: WIN32
- Version: 1.9.2
- Fixed in version: 1.9.3