Ask Your Question

crook's profile - activity

2017-08-25 13:51:14 -0600 commented question OpenCV crashes in production

My server just tries to decode the image bytes. Those image bytes sometime try to allocate lot of memory and crash. Since it's a production server, I need to make sure that the memory footprint of my application is not unbounded.

2017-08-23 17:49:58 -0600 received badge  Editor (source)
2017-08-23 17:46:37 -0600 asked a question OpenCV crashes in production

Hi,

I am running an application in production and I see my python process crash while performing opencv imdecode. Some of these images are bad images that usually crash the system but I need to make sure I gracefully handle this in my code and log the crash dump.

Can anyone provide suggestions on the best way to do this?

Also, I reduced the number of failures by only accepting JPEG and PNG images. I was seeing more failures with TIFF and JPEG2000s, but I would like to re-enable other image formats as well. I am in need for recommendations on the checks to make sure image decode doesn't take away all my memory or makes my service prone to DOS attacks.

Thanks, Anand