[libcamera-devel,0/3] lc-compliance: Fix SimpleCapture test
mbox series

Message ID 20221213093802.704177-1-paul.elder@ideasonboard.com
Headers show
Series
  • lc-compliance: Fix SimpleCapture test
Related show

Message

Paul Elder Dec. 13, 2022, 9:37 a.m. UTC
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(-)