Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Program freezes when using "addAxisCamera" #105

Closed
harrison6462 opened this issue Mar 10, 2021 · 6 comments
Closed

Program freezes when using "addAxisCamera" #105

harrison6462 opened this issue Mar 10, 2021 · 6 comments

Comments

@harrison6462
Copy link

I'm using the sample code to use cscore to create a daemon process to run my vision code in python. When I try to use cscore.addAxisCamera, a large amount of the time the python program starts up and gets stuck inside the method permanently, but sometimes it works (the outcome was nondeterministic). We couldn't figure out anything that differs between the runs where it works vs. those where it freezes, and there's no error logging since it never exits the method.

@virtuald
Copy link
Member

What platform?

@harrison6462
Copy link
Author

Sorry I'm not sure what platform you're referring to. We're running it on the most up to date RoboRIO with the standard robotpy + robotpy-cscore libraries.
Also, I should probably mention that using the Java implementation of addAxisCamera always works, so it's not a matter of the hardware.

@virtuald
Copy link
Member

Do you have the ability to install gdb and get a stack trace of when it's frozen? That could be helpful. Another thing that could be helpful is to have a minimal example that reproduces it? I just tried to reproduce it and wasn't able to -- but I guess that makes sense since you said it wasn't deterministic.

Looking at it, I think it's likely that there's a GIL related deadlock? It's a pretty simple change to fix it, but I don't have time to fix it tonight and build a new wheel. Will try to get to it tomorrow night and see if that fixes it for you.

@harrison6462
Copy link
Author

Minimal example:
cs = CameraServer.getInstance()
print('entering addAxiscamera')
cs.addAxisCamera('169.254.241.45', name='axis-cam')
print('I suceeded!')

I deployed this 10 times and it worked on the first, fourth, ninth, and tenth times and froze the rest (we're running the python process with unbuffered printing to stdout/stderr).

I've been trying to get gdb installed on my RIO but I can't figure out how to install it without debian / apt-get.

@virtuald
Copy link
Member

virtuald commented Mar 12, 2021

I was going to tell you to use robotpy-installer to download/install gdb, but it seems that it doesn't work (reference: robotpy/roborio-packages#29).

I'll take a look at it tonight and see if I can duplicate with that snippet -- thats seems like a pretty easy thing to try.

@virtuald
Copy link
Member

I was able to duplicate the issue with that snippet, and I'm building a new release. robotpy-cscore 2021.0.2 will have the fix in it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants