[libcamera-devel] [PATCH] lc-compliance: simple_capture: Free Requests properly

Nícolas F. R. A. Prado nfraprado at collabora.com
Wed Nov 30 18:30:04 CET 2022


On Tue, Nov 29, 2022 at 08:00:05PM +0900, Paul Elder via libcamera-devel wrote:
> In the simple capture tests, in the capture functions, the Requests were
> auto-deallocated by the function going out of scope after the test
> completed. However, before the end of the scope, the Framebuffers that
> the Requests referred to were manually freed. Thus when the Requests
> were deallocated, they tried to cancel their Framebuffers, which involve
> setting the status to cancelled, which obviously causes a segfault
> because the Framebuffers had already been freed.
> 
> Fix this by moving the list of Requests to a member variable and
> deallocating them before deallocating the Framebuffers at stop() time.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>

I ended up sending almost exactly the same patch [1], so that's kind of a
R-by/T-by tag in itself :), but here they are explicitly:

Reviewed-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>

Thanks,
Nícolas

[1] https://patchwork.libcamera.org/patch/17918/


More information about the libcamera-devel mailing list