Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang when receiving empty images. #268

Open
PjotrSvetachov opened this issue Apr 24, 2024 · 0 comments
Open

Hang when receiving empty images. #268

PjotrSvetachov opened this issue Apr 24, 2024 · 0 comments

Comments

@PjotrSvetachov
Copy link

We have a Brainlab system that can send empty images when different images in the hierarchy are not fused properly. When that happens it sends the header but m_BodySizeToRead becomes 0 and so it does not send any more data. Then AllocatePack()/AllocateBuffer() will think we are actually sending an image instead of receiving and thus sets the message to 130 (IGTL_HEADER_SIZE + IGTL_IMAGE_HEADER_SIZE)
The example code given on line 66 of the file igtlMessageHeader.h will then hang waiting for data that is never send from the Brainlab system. This is because the code uses GetPackBodySize() to get the data size, which is 72. To remedy this one should first check that GetBodySizeToRead() > 0 before trying executing the code on line 66.

I know this is a niche case and would not occur if the brainlab system would not report empty images as available. But that is out of our control. I don't know if this can be patched in the library but it might be worth modifying the example code to warn for this.

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

No branches or pull requests

1 participant