]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not die silently when dying via std::terminate().
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 18 Jun 2017 19:08:57 +0000 (07:08 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 18 Jun 2017 19:08:57 +0000 (07:08 +1200)
commit4d6ac88b0c875396fa947572ef9e5b3107b9f306
tree58046013b3a231cce707e41a86e8cfdf290b66bc
parent93756a7c105f97bcf875b9f0ba79fd2057be92fb
Do not die silently when dying via std::terminate().

Report exception failures that call std::terminate(). Exceptions unwind
stack towards main() and sooner or later get handled/reported by Squid.
However, exception _failures_ just call std::terminate(), which aborts
Squid without the stack unwinding. By default, a std::terminate() call
usually results in a silent Squid process death because some default
std::terminate_handler implementations do not say anything at all while
others write to stderr which Squid redirects to /dev/null by default.

Many different problems trigger std::terminate() calls. Most of them are
rare, but, after the C++11 migration, one category became likely in
Squid: A throwing destructor. Destructors in C++11 are implicitly
"noexcept" by default, and many old Squid destructors might throw.

These reporting changes do not bypass or eliminate any failures.
src/main.cc