|
Boost Users : |
Subject: [Boost-users] Boost::thread and Dr. Watson
From: Francesco Nesci (french_at_[hidden])
Date: 2008-12-18 10:11:37
Hi,
OS: Windows XP
Compiler: VS2003
Boost Version: 1.36
I’ve been assigned to track down a problem
that we’re having
in the field with our software. Sometimes our
program just vanishes without invoking the
postmortem debugger (usually Dr. Watson).
I tracked it down to boost::thread using a catch(…) that calls
std::terminate() as part of a try/catch block around the thread
procedure. This means that when there’s an unhandled C++ or structured
exception the application quietly shuts down. Some
Googling showed that a
few years ago someone else had the same problem. The
email thread petered out without coming
to any resolution.
With the popularity of Boost, I’m hoping that
some other
Windows programmers have run into this issue and have some advice on
how to use
boost threads and get Dr Watson to run when something bad happens. I’ve tried registering my own terminate
handler but I haven’t come up with the code to get Dr. Watson to do its
thing
from inside the handler.
The easiest “fix” would be to edit the code
and remove the
catch(…) but I’m hesitant to do that for a couple of reasons. Specifically, I don’t want to have to have a
special build of boost that we must supply to our users (our
application can
load user plug-ins) and I trust the quality of the Boost code so, while
I’m not
sure of the benefit of the catch(…), I believe that it’s probably well
thought
out and there for good reason.
If anyone else has any experience with this
issue, I’d love
to hear from you. Thanks in advance.
Francesco
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