[squid-dev] [PATCH] Do not die silently when dying via std::terminate()

Alex Rousskov rousskov at measurement-factory.com
Thu May 18 00:20:55 UTC 2017


Hello,

    While triaging a silent crash of a production Squid, I realized that
our death reporting code has a serious (and recently grown) hole. The
attached patch closes it. This reporting-only patch does not fix any
crashes. There are more technical details in the preamble.

Researching this problem gave me an idea on how we can preserve Squid
stack when dying from unhandled runtime exceptions. This patch does not
implement that idea but adds a corresponding XXX and TODO comments.

This patch changes the same SquidMainSafe() code as the pending atomic
PID patch does. While the changes conflict at the patch level, they are
fully compatible at the "logic level". The conflict is easy to resolve.


HTH,

Alex.
P.S. The "current exception" reporting code was copied, with
adaptations, from Web Polygraph. It uses a relatively well-known
"re-throw exception to determine its type" trick. There are several ways
to build a reporting API for exceptions. The proposed design worked the
best (after several trials and errors) in Polygraph.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQUID300-silent-term-death-t4.patch
Type: text/x-diff
Size: 4707 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20170517/50357377/attachment.patch>


More information about the squid-dev mailing list