Boost logo

Boost Users :

From: Rush Manbert (rush_at_[hidden])
Date: 2006-04-26 20:42:29


Brown Gabe wrote:
> Hi Everyone,
>
> Hopefully this isn't some noob question, but here goes... I'm trying to
> run boost 1.3.1 in Visual C++ 8 VC8 and I keep getting an access violation
> at the termination of my thread. I've tried looking to see what the problem
> is but I can't seem to determine the problem. I'm using the plain example
> thread.cpp
>
<snip>

> I get the expected out from the application. Upon tracing my code, the
> exception only occurs when the worker thread exits.
>
> Exception occured in threadex.c on line 348.
> Unhandled exception at 0x7c9012b4 in test.exe: 0xC0000005: Access violation
> reading location 0xcccccccc.
>
> " __try {
> _endthreadex (
> ( (unsigned (__CLR_OR_STD_CALL *)(void
> *))(((_ptiddata)ptd)->_initaddr) )
> ( ((_ptiddata)ptd)->_initarg ) ) ;"
>
> Any thoughts on what might cause an error like this???
>
> --

Others may have more intelligent, or more focused, suggestions, but here
are two things to check:

1) 0xcccccccc looks very much like the contents of an uninitialized
variable when running under the debug heap management code. My guess is
that you are using an uninitialized pointer value whose contents are
0xcccccccc.

See http://www.codeguru.com/cpp/w-p/win32/tutorials/article.php/c9535__1
the follow the "continued" link to the second page. The fill values are
listed there.

2) I assume you're using VS 2005? The Debug | Exceptions... dialog lets
you set it to break when an exception is thrown, rather than fielding an
unhandled exception. I don't know anything about debugging threads, though.

Best of luck,
Rush


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net