Re: [PATCH 15/67] convert trivial sprintf / strcpy calls to xsnprintf
- From
Stefan Beller <sbeller@google.com>
- Date
- Sep 15, 2015, 20:38 UTC
- Message-ID
- <CAGZ79kb5qWnOnJGY8JR3Z9UqT2xp390A6-LvNudBk=e3N2W41Q@mail.gmail.com>
- In-Reply-To
- <20150915184211.GA31939@sigill.intra.peff.net>
On Tue, Sep 15, 2015 at 11:42 AM, Jeff King <peff@peff.net> wrote:
> That misses the "assert" behavior of xsnprintf.
When I saw the first patches of this series, I like them.
Some off topic thoughts:
Having an "assert" behavior is not a good user experience though and should be fixed. To fix it we need stack traces. And the git version. And telling the user to send it to the mailing list.
I wonder if we want to include a trace where possible (i.e. when compiled with gcc or other precompiler conditions) into these assertive behaviors. I'd guess we have an assertive behavior if die("BUG:...") is called, so maybe we can just check inside of die if we want to print a stack trace additionally ?
In my dream world we would have a similar mechanism as in the kernel, a "BUG:..." will be automatically sent to some collection agency via UDP.