question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

boost thread: trying joining itself: Resource deadlock avoided

See original GitHub issue

Hi, every now and then, I get the following error:

terminate called after throwing an instance of 'baslerboost::exception_detail::clone_impl<baslerboost::exception_detail::error_info_injector<baslerboost::thread_resource_error> >'
  what():  boost thread: trying joining itself: Resource deadlock avoided

I haven’t figured out a way to reproduce it. I have 4 cameras running in two threads (two cameras per thread).

Any idea?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
thiesmoellercommented, Sep 18, 2019

always catching exception and return true

yes this is what i do. decide in the exception handler if can proceed -> true if this is really a stop -> false

and output the exception contents to a logger channel

0reactions
simonaertssencommented, Aug 7, 2020

Hi, I’m having some difficulties with subclassing the pylon.ImageEventHandler, as I cannot find an implementation with a more elaborate example than in the sample grabusinggrabloopthread.py

I have made an implementation as found below, and the grabResult is saved as an attribute of the class, which I can access from outside the class, as I wish to process the result somewhere else. I would expect some sort of signal to be available when a new grabResult is registerd (eg when OnImageGrabbed is called). How can I make this more robust?

class ImageEventHandler (pylon.ImageEventHandler):

def __init__(self, callback):
    super().__init__()
    self.returnImageCallback = callback
    self.grabbedImage = None

def OnImageGrabbed(self, camera, grabResult):
    if grabResult.GrabSucceeded():
        with grabResult.GetArrayZeroCopy() as ZCArray:
            self.grabbedImage = ZCArray
        self.returnImageCallback(self.grabbedImage)
Read more comments on GitHub >

github_iconTop Results From Across the Web

joining a thread: "resource deadlock avoided" - Stack Overflow
The problem is the thread context which is calling IoService::stop() . You are calling it from a handler function, which means that it's...
Read more >
C++ Resource deadlock avoid. std - Jaime Lin
The thread owner joins itself. Two threads join each other. My code. I utilized the boost io_service to run a heartbeat routine in...
Read more >
[boost] [thread 1.48] Multiple interrupt/timed_join leads to ...
Hi all, I was investigating a rare deadlock when issuing an interrupt and a timed_join in parallel. I come out with the the...
Read more >
Avoiding Deadlock - Multithreaded Programming Guide
In a self deadlock or recursive deadlock, a thread tries to acquire a lock already held by the thread. Recursive deadlock is very...
Read more >
Deadlock. - C++ Forum
I recently made code that causes a deadlock (or atleast tries to ... an instance of 'std::system_error' what(): Resource deadlock avoided ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found