daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Use after free when calling destroyDaphneContext() #745

Closed CPestka closed 5 months ago

CPestka commented 5 months ago

When running valgrind on the test suite, one of the issues that come up is a use after free in the cli section of the tests.

use_after_free.txt

During the generation of kernels around (nearly) all cpp kernels a call to preKernelInstrumentation(int, DaphneContext) and postKernelInstrumentation(int, DaphneContext) are placed. This causes a use after free in postKernelInstrumentation for the destroyDaphneContext kernel, as it takes the just destroyed ctx as one of its arguments.

There should be an exception for this kernel in genKernelsInst.py, as already present for createDaphneContext.

philipportner commented 5 months ago

Thanks for spotting this, I pushed a fix.