Boost logo

Boost :

Subject: Re: [boost] [Stacktrace] review, please stop discussing non-Stacktrace issues
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-12-17 13:17:02


On 17 Dec 2016 at 17:31, Peter Dimov wrote:

> > 3. Please could people actually review Stacktrace's implementation code
> > instead of inferring implementation from what someone else said here about
> > something they half read in the tutorial. Specifically, is its API design
> > solid? Is the use of std::string in its public API acceptable?
>
> There's nothing wrong with using std::string in principle, but it's
> obviously not async safe. The operations however that return std::strings
> are also not async safe at the moment, so it's not the std::string return
> value that's the problem.
>
> The documentation has an example of printing a stack trace from a SIGSEGV
> handler, which is undefined behavior as it stands. So it's not clear to me
> whether the library is supposed to be useful - in its decoding/printing
> part, not just in its capture part - in signal handlers.

Thanks Peter, you did a great job covering my own concerns here.

I can tell you it is entirely possible to write a stacktrace printer
which is async safe on POSIX. I've done it before. The Windows case
is much harder to achieve, you basically need to bring in non system
libraries because DbgHelp is crap.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk