[libcamera-devel,0/3] base: Fix crash with recursive messages dispatch
mbox series

Message ID 20210701230741.14320-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • base: Fix crash with recursive messages dispatch
Related show

Message

Laurent Pinchart July 1, 2021, 11:07 p.m. UTC
Hello,

This patch series fixes a crash related to recursive dispatch of
messages, as reported in https://bugs.libcamera.org/show_bug.cgi?id=26.

Patch 1/3 is a small drive-by documentation fix. Patch 2/3 adds a test
case to trigger the issue, and patch 3/3 fixes it. Please see patch 3/3
for a detailed explanation of the problem and the fix.

David, would you be able to check if this fixes the issue you've
reported ?

Laurent Pinchart (3):
  base: thread: Document the postMessage() function as thread-safe
  test: message: Test recursive Thread::dispatchMessages() calls
  base: thread: Fix recursive calls to dispatchMessages()

 src/libcamera/base/thread.cpp | 45 ++++++++++++++++++------
 test/message.cpp              | 66 +++++++++++++++++++++++++++++++++--
 2 files changed, 99 insertions(+), 12 deletions(-)

Comments

David Plowman July 2, 2021, 1:02 p.m. UTC | #1
Hi Laurent

Thank you very much for working on this problem, it is highly appreciated!

On Fri, 2 Jul 2021 at 00:08, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hello,
>
> This patch series fixes a crash related to recursive dispatch of
> messages, as reported in https://bugs.libcamera.org/show_bug.cgi?id=26.
>
> Patch 1/3 is a small drive-by documentation fix. Patch 2/3 adds a test
> case to trigger the issue, and patch 3/3 fixes it. Please see patch 3/3
> for a detailed explanation of the problem and the fix.
>
> David, would you be able to check if this fixes the issue you've
> reported ?

I've applied the patches and all is good so far. To be fair, the
problem has definitely been less frequent recently than it used to be,
but I'll keep going for the next few days and add a tag once I reckon
I've used it enough!

Best regards
David

>
> Laurent Pinchart (3):
>   base: thread: Document the postMessage() function as thread-safe
>   test: message: Test recursive Thread::dispatchMessages() calls
>   base: thread: Fix recursive calls to dispatchMessages()
>
>  src/libcamera/base/thread.cpp | 45 ++++++++++++++++++------
>  test/message.cpp              | 66 +++++++++++++++++++++++++++++++++--
>  2 files changed, 99 insertions(+), 12 deletions(-)
>
> --
> Regards,
>
> Laurent Pinchart
>