[libcamera-devel] [PATCH 0/3] lc-compliance: Fix SimpleCapture test

Paul Elder paul.elder at ideasonboard.com
Tue Dec 13 10:37:59 CET 2022


This series fixes bug 171 [1] *properly*.

This issue was that a Request was reused and not queued to the Camera,
then the buffers were freed before the Requests were destroyed, causing
the Requests to cancel the freed buffers -> segfault.

Technically this isn't an issue anymore because of "lc-compliance:
simple_capture: Free Requests properly" [2], but still this fix is more
proper.

Fix this by reusing the Requests only if they will be queued to the
Camera.

Additionally, add a note about this issue to the application developer
guide, and a todo regarding a potential race condition in
Camera::queueRequest.

[1] https://bugs.libcamera.org/show_bug.cgi?id=171
[2] https://git.libcamera.org/libcamera/libcamera.git/commit/?id=9a913eb9107483fcea01bd0e82c21e3733a5ddb2

Paul Elder (3):
  lc-compliance: simple_capture: Fix Request reuse
  Documentation: application-developer: Elaborate on request reuse
  libcamera: camera: Add todo for race condition on queueRequest

 Documentation/guides/application-developer.rst |  4 ++++
 src/apps/lc-compliance/simple_capture.cpp      |  2 +-
 src/libcamera/camera.cpp                       | 15 +++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

-- 
2.35.1



More information about the libcamera-devel mailing list