This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix libstdc++/12352


Paolo Carlini wrote:

Pétur Runólfsson wrote:

[snip]

This should be detectable with the testcase I attached to the PR
if the outer loop is run often enough.

Thanks.

As I wrote, I didn't hope to fix *all* the problems, unfortunately...

However, I tried your testcase with a command line parameter up to ~1000-3000 and nothing happened. I would appreciate if you could prepare a more sensitive testcase and perhaps file a different PR, in order to better keep track of the issue: in the next days I would like to work on a few other PR before returning to excpetion safety.

FWIW, it's not trivial to write black box tests exercising exception safety, especially when it comes to dynamic allocation. One approach that has worked for me is to replace operator new with one that works in two modes: -- tracking mode records all calls to it made from a program the program is run once in this mode to record all such calls -- test mode iteratively runs the program and forces operator new to throw an exception for each call previously recorded, recording any possible leaks Obviously, this can be a pretty lengthy process.

Regards
Martin



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]