Device crash - running CIQ widget

This is a vivoactive, running 2.90

The scenario is (doesn't happen all the time, but when it does, this is it)

Take va out of charger, wait for va and phone to hook up BT wise.

run widget soon after the removal from the charger, which gets GPS location (one shot), and using location, calls makeJsonRequest() to get data.

5-10 seconds later, device reboots. There is nothing in the CIQ_LOG.txt file and here is ERR_LOG.txt

1907 (vívoactive) SW ver: 290
Build Type: RELEASE
ESN: 3900590391
Battery Voltage: 4.128000V
05/24/15 10:35:29
RTL
errnum: 0x001
r0: 0x20009C98
r1: 0x00000200
r2: 0x000B8B81
r3: 0x00000000
Return Address (LR): 0x000C3791:Call Stack - PSP at 0x200099A8:
0x000C3791
0x0009D40D
0x001619F4
0x000B8B81
0x000ADA89
0x000B8B81
0x000AD51D
0x0000C000
0x000B7EB1
0x000B8B81
0x000ADDED
0x000B8B81
0x000B8B81
0x000BB865
0x000BBB9F
0x000B56FB
0x0000C000
0x0000A20B
0x000B844F
0x0000C000
HWM_usb_connected = 0x00. HWM_usb_mode = 0x01.
SMB config: cfg_start[0]=0x00, cfg_start[1]=0x02, cfg_start[2]=0x06.
page addr = 0x00057009
Uptime: 165087088


Any ideas?
  • Former Member
    Former Member
    Is this a widget you are working on?

    Does it consistently work without crashing at times other than shortly after removing the device from USB connection?

    This error indicates the memory manager has run out of space in the allocation table (hit max # of allocations, not the max size of allocations). Does your widget create a large number of small objects (or arrays/hashes)? It is possible the system is using a larger than average number of allocations after disconnecting from a computer.
  • Yes. The only times it happens is after removing it from the charger (and then, only once in a while), and runs without issue at other times. As I'm testing it, I probably run it 20 times a day. Another bit of info, is that it's usually in the charger because I'm side-loading something CIQ...

    It doesn't use very much memory at all. No arrays. the only variables are a few booleans and the lat,lon, and data pulled from the response to the makeJsonRequest().
  • Based on when this happens while running the widget, it would be about the time that the data has been received, and getting formatted for the "onReceive(data)" call. Based on the data itself, would ciq/FW be allocating a bunch of objects? That's the only way I can see a bunch of objects being created.

    Update: another thought. Could it be that running the widget right after BT is connected after coming off USB means other things are "phoning home" at the same time, such as the notification widget, checking for a sync, setting the devices time, calendar, etc, and that's why there are so many objects being used in the device itself?
  • Ok, it happened again. I've been avoiding running the widget until well after BT is connected after being removed from the charger. This is a new one.

    Was walking outside so I could get clear GPS, and as I was stepping outside, hit my goal, and the (mumble, mumble...) fireworks started. Hit the back button, and swiped to the widget, and again got a crash and about the time the data came back. from the println()'s I have in the code, it appears that after making the makeJsonRequest(), it hasn't called "onReceive()", so it again looks like it was when the CIQ VM was preparing the "data" that came back.

    Could it be that I run this too soon after a "system" event, and the Garbage Collection in the memory manager hasn't run yet?

    Here's the err_log.txt for the "fireworks" crash.
    1907 (vívoactive) SW ver: 290
    Build Type: RELEASE
    ESN: 3900590391
    Battery Voltage: 4.147000V
    05/28/15 13:59:39
    RTL
    errnum: 0x001
    r0: 0x20009C98
    r1: 0x00000200
    r2: 0x000B8B81
    r3: 0x00000000
    Return Address (LR): 0x000C3791:Call Stack - PSP at 0x200099A8:
    0x000C3791
    0x0009D40D
    0x001619F4
    0x000B8B81
    0x000ADA89
    0x000B8B81
    0x000AD51D
    0x0000C000
    0x000B7F79
    0x000B8B81
    0x000ADDED
    0x000B8B81
    0x000B8B81
    0x000BB865
    0x000BBB9F
    0x000B56FB
    0x0001240B
    0x000B844F
    0x0000C000
    0x00023F03
    HWM_usb_connected = 0x00. HWM_usb_mode = 0x01.
    SMB config: cfg_start[0]=0x00, cfg_start[1]=0x02, cfg_start[2]=0x06.
    page addr = 0x00057009
    Uptime: 158257160
  • In either case, I don't think anything in my widget should crash the device, either directly or by way if the CIQ VM.
  • Former Member
    Former Member
    Hey Jim,

    I'm trying to figure out how an app can trigger this error, and would be able to understand the situation much better if I could reproduce it. Would you be willing to send us the .prg that you are triggering this crash with? If so, you can send it to the ConnectIQ mailbox at [email][email protected][/email]

    Thanks
  • Brian - it's on the way.

    As I've said, the crash doesn't happen very often, and the only times I've seen it are right have removing it from USB or right after the fireworks.
  • Is this a widget you are working on?

    Does it consistently work without crashing at times other than shortly after removing the device from USB connection?

    This error indicates the memory manager has run out of space in the allocation table (hit max # of allocations, not the max size of allocations). Does your widget create a large number of small objects (or arrays/hashes)? It is possible the system is using a larger than average number of allocations after disconnecting from a computer.


    Could you explain that further? I'm not aware there is a max # of allocations.
  • Former Member
    Former Member
    There isn't a max number of allocations in ConnectIQ, but there is a maximum the memory manager can handle on the devices. We have discussed enforcing a limit down in ConnectIQ to prevent the error type Jim has reported, but I investigated his widget, and it is not using enough allocations to trigger this limit on its own. In general, we expect apps to run out of memory long before they reach the max allocations. We are going to continue to monitor this issue on our next device software versions which, and try to determine what is the root cause of Jim's crash.
  • Brain - as an update from me, I'm wondering if the bug is in the FW itself (2.90 on the va), as I've seen crashes a couple of times where, as soon as I remove the va from the charger (like in my crash), and try to get to "settings" (button push and swipe for me), the va has crashed. Next time I'll post or example the err_log.txt. BTW, I don't think I saw my widget crash prior to 2.90.

    Have you been able to reproduce the crash with my widget?