Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bug in CWorkerThread!!

Status
Not open for further replies.

teriviret

Programmer
Dec 12, 2003
288
US
Try this out, in Visual C++ .NET 2003...

1. Create new ATL project.
2. Add new class, ATL ActiveX control.
3. Add "#include <atlutil.h>" to top of .h file of control
4. Add "CWorkerThread<> m_testThread;" member variable to control class.
5. Compile on Windows XP machine.
6. Copy over to Windows 98 machine.
7. Create the control in tstcon32.
8. Destroy the control.

WHAM -- you will get:

Code:
TSTCON32 caused an invalid page fault in
module KERNEL32.DLL at 015f:bff8abea.
Registers:
EAX=00000000 CS=015f EIP=bff8abea EFLGS=00000246
EBX=00000000 SS=0167 ESP=0067f7dc EBP=0067f87c
ECX=01a00a5c DS=0167 ESI=01a00a80 FS=3937
EDX=00000000 ES=0167 EDI=01a009b8 GS=0000
Bytes at CS:EIP:
a1 08 9d fc bf 50 e8 c3 95 fe ff ff 76 04 e8 35 
Stack dump:
01a00a5c 1000236e 01a00a80 01a00a5c 10003717 00002710 009b3d64
01a009b0 00000000 100092ed 01a009b0 01a009b0 0067f840 10010b4b
ffffffff 10009288

Just declaring the CWorkerThread member variable in your control will cause this to happen. You don't have to call any of its methods (besides the constructor/destructor called for you). Also, the crash only occurs on Windows 98. But it is consistent and very reproduceable. I can make it happen on Windows 98 SE and Windows 98 vanilla, both running the latest patches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top