"Error: Array Out Of Bounds Error. Details: failed inside handle_image_callback" directly after makeImageRequest

I am working on an widget that retrieves png images from a website.For the Edge 1030, I retrieve images of the size 240x260 with MakeImageRequest. The disksize of these images is between 5 to 10k.

Problem:
This was working fine, for 3 months, until last week. Nothing have been changed in the source code. Nothing has been changed in my configuration (mobile (Iphone 6 with IOS 12.3), Edge 1030 with FW 7.3).
Other users of my widget are not experiencing these problems. They are using different devices: Edge 520, 520Plus, 1000 and 1030.

Debug info:
When debugging, CIQ_LOG.YML shows the following error: 'Error: Array Out Of Bounds Error. Details: failed inside handle_image_callback".
There are no details in the "Stack" section of the CIQ_LOG.YML.
The crash always appears right after the call makeImageRequest has been done. Even if I remove/disable all other code in my widget, the app keeps crashing with the same error.
The free memory during execution of the widget is 480k, and the peak does not exceed 800k.

When I decrease the size of images (e.g. 200x200) the app works fine, and keeps running fine.

Questions:
I would be great if you could help with answering the following questions:
1) Is there a limitation for the size of images that can be retrieved with MakeImageRequest?
2) Is there a limitation of the data transfer over BLE?
3) What does that error "failed inside handle_image_callback" exactly mean?
4) What should I do to get more details in the stack section of the CIQ_LOG.YML? I have "release" build un-checked in the build for device wizard.

I cannot find anything on the forums or website that could help me further on the above questions.
I really hope you could help me out on this. In case you need more information or details, please let me know.

  • I get the same error with images downloading via wifi. The watch crashes in sync mode. Error Log:

    Error: Array Out Of Bounds Error
    Details: failed inside handle_image_callback
    Time: 2021-01-25T16:09:01Z
    Part-Number: 006-B3226-00
    Firmware-Version: '5.10'
    Language-Code: deu
    ConnectIQ-Version: 3.2.3
    Filename: xxx
    Appname: xxx
    Stack:

    its downloading regular jpegs and pngs that are smaller than the max width and max height stated in the imagerequest. Could that be the issue?

  • Update: Same crash occurs with images bigger than screen size.

  • It could be image type that's the issue.  What are you using?  When an image is received, it's actually converted to something CIQ can use - a bitmap.

  • Hi Jim, thank you for your reply.

    I used pngs and jpegs. With some it didn't work, with some it did. I now tried a bitmap too, that did work - well at least the download. But all images that can be downloaded (in sync mode) are only drawn partially on the screen afterwards - about 2/3 of the image stays black.

    Does anyone have an idea why that happens? The problem only pops up when the image request is made via wifi / sync mode.

  • What happens with BLE?  I recall that in some cases, the image is actually passed through a garmin server to offload conversions.

  • I used BLE before and as far as I remember that worked fine. Interestingly, animations, that I also load via wifi, don't work either. Both (images and animations) work fine on the simulator. The problem only occurs on the real device. Is there anything I may need to think of when using wifi downloads on the real watch?

  • There was an issue a while back (it could still be in bug reports) where there was something off with images over wifi where they got a blue tint,  This could be similar.  The "Array Out Of Bounds Error" could be happing when the image is being converted over wifi or something as it is happening in "handle_image_callback" and not app code..

    Is there a bug report for this?

  • Hmpf.. okay. Can you say if this kind of error would typically occur on any device with this CIQ version or possibly only on the venu?

    I only created a bug report regarding the animations crashing on the real device: https://forums.garmin.com/developer/connect-iq/i/bug-reports/crash-when-playing-animation

    There is none for the image request.

  • That's really a question for the Garmin folks.  If you didn't you may want to include a simple sample to demonstrate the error, so they can try it and see the error first hand.