[Avocado-devel] handling segfault of test process

Brian J. Murrell brian at interlinx.bc.ca
Fri Nov 16 14:17:08 UTC 2018


On Thu, 2018-11-15 at 10:17 -0500, Brian J. Murrell wrote:
> If I have a test class with a setUp(), test*() function(s) and a
> tearDown(), is it true that if some operation in a test*() function
> causes a segfault, tearDown() won't get run?

This certainly seems to be the case.  A quick test does reveal that
those three functions are all run in the same process.

> If this is true, what is the advise for writing/structuring tests
> that
> are testing, say, a library (through python bindings to such a
> library)
> that is in development and as such could segfault?

I did a quick test of using multiprocessing to farm out a separate
function in a test*() to a subprocess which seems to work.  Of course
communication between the function being run and test*() is limited but
I wonder if this kind of technique can/should be formalized in avocado.

That all aside, is there any facility in avocado to process the core
file from a test process segfaulting?  Any suggestions on how such a
thing could be done, to say, at least get a backtrace of segfaulted
process?

Cheers,
b.





More information about the Avocado-devel mailing list