HolyLab / Imagine

A graphical interface for recording with OCPI microscopes.
1 stars 1 forks source link

Pixmapper memory access error #59

Closed Cody-G closed 6 years ago

Cody-G commented 6 years ago

This one is nasty. After recording 300000+ frames I got a "memory access error" triggered by this line. I've never had an error from the pixel mapper before, and I don't remember changing anything related to it recently. I have a feeling this is going to be difficult to reproduce. Maybe we could run it in live mode for a long time (I don't see any reason why this should only trigger during a recording, that was just my bad luck).

Here's an image of the GUI when the error was triggered. I wasn't interacting with it, just watching the image and histogram update.

img_20171010_185844

I don't understand why the color pixel mapper was executing at all...the images were being shown in black and white, and we have a separate function for that. Edit: The histogram is colored, maybe it's that? Ignoring that strange detail I have a vague guess at what's happening. I was recording with a very small ROI and very high framerate. Imagine was working very hard on displaying the image, and since the image was small it actually succeeded at updating really fast (I didn't measure but I would guess 50+ frames per second). So this high rate may have exposed a race condition in the display code. In that case we may be able to fix it by limiting the display update rate, but of course the better way to fix it would be to find where the race is occurring and prevent it.

If we can't quickly find a solution that we're confident about then I think we should consider allowing the user to turn off the display entirely to work around the bug. It's very costly to encounter this bug in a long recording with a live specimen.

kdw503 commented 6 years ago

I think color pixel mapper should not be executing in black and white mode. That might be the problem. I will check it. Could you let me know GUI setting parameters and send json file?

Cody-G commented 6 years ago

Just sent, thanks for looking into it!

On Wed, Oct 11, 2017 at 9:50 AM, Dae Woo Kim notifications@github.com wrote:

I think color pixel mapper should not be executing in black and white mode. This might be the problem. I will check it. Could you let me know GUI setting parameters and send json file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HolyLab/Imagine/issues/59#issuecomment-335837017, or mute the thread https://github.com/notifications/unsubscribe-auth/AE78hLa2EHQTk9ZeDa5Swo6pcIoSFiH8ks5srNXSgaJpZM4P03g5 .

kdw503 commented 6 years ago

I tested this several times but couldn't meet this problem yet. And, imagine didn't go into handleColorPixmap() function either. Instead, I met some missing frames problem sometimes. We need to keep looking this problem.

kdw503 commented 6 years ago

I found some suspicious lines. And fixed it, I'm not sure this will fix this issue though. The suspicious lines are these. If we connect a signal to the same slot many times, it is counted as several connections. So, if the signal is activated the same slot is called several times. So I fix these lines.

Cody-G commented 6 years ago

I haven't run into this again, so let's assume it's fixed. Thank you!

kdw503 commented 6 years ago

Good! Thank you for checking this error.