Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Robert Foley
On Thu, 7 Nov 2019 at 15:12, Alex Bennée wrote: > > > > For a fix, we could put this at the beginning of qemu_set_log_filename(). > > if (logfilename) { > > g_free(logfilename); > > logfilename = NULL; > > } > > g_free(logfilename) should be safe against NULL. However we need to > ensure

Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Robert Foley
Agree with all the suggestions below. These are great ideas. Will make the changes. Thanks, -Rob Foley On Thu, 7 Nov 2019 at 11:32, Alex Bennée wrote: > > > Robert Foley writes: > > > One test ensures that the logfile handle is still valid even if > > the logfile is changed during logging. >

Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Alex Bennée
Robert Foley writes: > Thanks for providing the stack trace. > > We debugged this and it seems to come about because of an interesting > circumstance. We added our new tests after a pre-existing test, > parse_path(), which runs into an issue, a dangling pointer, which > could lead to a double

Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Robert Foley
Thanks for providing the stack trace. We debugged this and it seems to come about because of an interesting circumstance. We added our new tests after a pre-existing test, parse_path(), which runs into an issue, a dangling pointer, which could lead to a double free. There were no other tests

Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Alex Bennée
Alex Bennée writes: > Robert Foley writes: > >> One test ensures that the logfile handle is still valid even if >> the logfile is changed during logging. >> The other test validates that the logfile handle remains valid under >> the logfile lock even if the logfile is closed. Also this

Re: [PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Alex Bennée
Robert Foley writes: > One test ensures that the logfile handle is still valid even if > the logfile is changed during logging. > The other test validates that the logfile handle remains valid under > the logfile lock even if the logfile is closed. > > Signed-off-by: Robert Foley > --- >

[PATCH 4/4] Added tests for close and change of logfile.

2019-11-07 Thread Robert Foley
One test ensures that the logfile handle is still valid even if the logfile is changed during logging. The other test validates that the logfile handle remains valid under the logfile lock even if the logfile is closed. Signed-off-by: Robert Foley --- tests/test-logging.c | 74