Camera crashes the device when not releasing resource while reporting it's released, also when acquiring resource while it's not free yet

asked 2014-02-04 22:07:41 +0300

Artem gravatar image
  1. Acquire LED using correct resource policy. Don't do autorelease so start using LED whenever it's acquired and release whenever it's needed for higher priority app
  2. Start camera app and start switching between camera and background (thus acquiring and releasing LED by high priority camera)
  3. After few switches whole device reboots, crash logger doesn't log any crashes

App log analysis shows that crashes happens in two situations: when App starts initing LED (camera released LED) and when you switch to Camera and App has not received the the resource deallocation request yet.

Leads me to hypothesis that: 1. Camera app isn't actually waiting for resource allocation and blindly inits everything 2. Camera app reports it released resources while it is still using them

Why that manages crash the whole device is a deeper story.

You can download the reproduction code at https://www.dropbox.com/s/vrz53f85brtgvkl/2014-feb-jolla-led-crasher.zip . It is slightly modified version of https://github.com/sailfishapps/ThrowawayDemos/tree/master/Working/GSTTorch2

P.S.
Sure, it is possible that it is actually app that managed to crash the device, but:
1. It is unlikely, this demo example is real small and simple
2. It still must not be able to crash the device

edit retag flag offensive close delete

Comments

    silly question... did you submit a bug?
      until then (release / fix) i just noticed that i don't reproduce the issue (w/ Camera app)
        why?
          i set the option for the flash to OFF thus the camera doesn't claim it...
            (good job for the flash light, btw! :) )

misterc ( 2014-02-19 20:27:33 +0300 )edit

Issue is fixed in a.. wrong way by now. Camera does not crash anymore, but something doesn't release resource either :/ A new instance of app (and nemo permissions plugin underneath) is able to acquire resource, but the original permissions requester is never able to acquire the permission anymore. Not sure how to proceed with it :/

Artem ( 2014-03-18 22:41:17 +0300 )edit

I also still managed to crash device by requesting/releasing LED resource and switching to-from Camera app. But it happened only once and without a clear reproduction sequence.

Artem ( 2014-03-22 19:10:32 +0300 )edit