Last Comment Bug 761796 - F/MOZ_Assert( 2060): Assertion failure: sSensorStatus[index].count == 0 || mActivate, at /Volumes/mac/moz/b2ggecko/hal/gonk/GonkSensor.cpp:210
: F/MOZ_Assert( 2060): Assertion failure: sSensorStatus[index].count == 0 || mA...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Hardware Abstraction Layer (HAL) (show other bugs)
: unspecified
: All Gonk (Firefox OS)
: -- normal (vote)
: mozilla16
Assigned To: StevenLee[:slee]
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-05 14:36 PDT by Gregor Wagner [:gwagner]
Modified: 2012-06-08 04:21 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Fixed assertion failure (1.03 KB, patch)
2012-06-06 19:06 PDT, StevenLee[:slee]
mwu.code: review+
Details | Diff | Splinter Review

Description Gregor Wagner [:gwagner] 2012-06-05 14:36:29 PDT
seen on current mc tip during startup with a debug build on the device.
Comment 1 Gregor Wagner [:gwagner] 2012-06-06 16:07:29 PDT
I added a log message. mActivate is false.
I/GonkSensor( 1835): index: 5, type: 5, mActivate: 1
I/Gecko   ( 1835): WARNING: 1 sort operation has occurred for the SQL statement '0xca9940'.  See https://developer.mozilla.org/En/Storage/Warnings details.: file /Volumes/mac/moz/iB2G/storage/src/mozStoragePrivateHelpers.cpp, line 110
I/GonkSensor( 1835): index: 1, type: 1, mActivate: 1
I/GonkSensor( 1835): index: 4, type: 4, mActivate: 1
I/wpa_supplicant( 2042): wlan0: Trying to associate with d8:c7:c8:eb:0b:b1 (SSID='Mozilla Guest' freq=2462 MHz)
I/wpa_supplicant( 2042): wlan0: Associated with d8:c7:c8:eb:0b:b1
I/wpa_supplicant( 2042): wlan0: CTRL-EVENT-CONNECTED - Connection to d8:c7:c8:eb:0b:b1 completed (auth) [id=0 id_str=]
I/Gecko   ( 1835): WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111: file /Volumes/mac/moz/iB2G/uriloader/prefetch/nsOfflineCacheUpdate.cpp, line 1071
E/lights  ( 1835): write_int: path /sys/class/backlight/panel/brightness, value 51
E/lights  ( 1835): write_int: path /sys/devices/virtual/sec/sec_touchkey/brightness, value 1
I/Gecko   ( 1835): RIL Worker: ICC_EF_MSISDN: invalid length of BCD number/SSC contents - 255
I/Gecko   ( 1835): RIL Worker: ICC_EF_MSISDN: invalid length of BCD number/SSC contents - 255
I/Gecko   ( 1835): WARNING: Unable to test style tree integrity -- no content node: file /Volumes/mac/moz/iB2G/layout/base/nsCSSFrameConstructor.cpp, line 8018
I/Gecko   ( 1835): WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111: file /Volumes/mac/moz/iB2G/uriloader/prefetch/nsOfflineCacheUpdate.cpp, line 1071
I/GonkSensor( 1835): index: 1, type: 1, mActivate: 0
F/MOZ_Assert( 1835): Assertion failure: sSensorStatus[index].count == 0 || mActivate, at /Volumes/mac/moz/iB2G/hal/gonk/GonkSensor.cpp:210
F/libc    ( 1835): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
I/DEBUG   ( 1823): debuggerd committing suicide to free the zombie!
I/DEBUG   ( 2059): debuggerd: May 18 2012 13:59:56
Comment 2 Gregor Wagner [:gwagner] 2012-06-06 16:33:33 PDT
and sSensorStatus[index].count is 1 when we assert.
What does the count field track? The number of activations?
But why do we assert on count == 0 when we disable? Is just the assertion code wrong?
Comment 3 Gregor Wagner [:gwagner] 2012-06-06 16:37:43 PDT
Michael you reviewed the code and requested a change in this assertion. I don't think that is what we want here.
Comment 4 Michael Wu [:mwu] 2012-06-06 16:56:47 PDT
(In reply to Gregor Wagner [:gwagner] from comment #3)
> Michael you reviewed the code and requested a change in this assertion. I
> don't think that is what we want here.

No, we want it. That means someone isn't balancing their enable/disable sensor calls. Number of deactivations cannot exceed the number of activations.
Comment 5 Gregor Wagner [:gwagner] 2012-06-06 17:21:03 PDT
(In reply to Michael Wu [:mwu] from comment #4)
> (In reply to Gregor Wagner [:gwagner] from comment #3)
> > Michael you reviewed the code and requested a change in this assertion. I
> > don't think that is what we want here.
> 
> No, we want it. That means someone isn't balancing their enable/disable
> sensor calls. Number of deactivations cannot exceed the number of
> activations.

I am not questioning the assert. I don't know the background of the enable/disable sensor logic but how can somebody disable a sensor?
So if we enable, we increase count.

If we disable, we should have a count > 0 and mActivate false.
Then we assert sSensorStatus[index].count == 0 || mActivate.
Comment 6 Michael Wu [:mwu] 2012-06-06 17:37:19 PDT
(In reply to Gregor Wagner [:gwagner] from comment #5)
> I am not questioning the assert. I don't know the background of the
> enable/disable sensor logic but how can somebody disable a sensor?
> So if we enable, we increase count.
> 
> If we disable, we should have a count > 0 and mActivate false.
> Then we assert sSensorStatus[index].count == 0 || mActivate.

Huh, I misread the code. You're right, that's totally wrong, it should be count > 0.

Uh, which I apparently already noticed in the review. The review was conditional on this assertion being fixed. https://bugzilla.mozilla.org/show_bug.cgi?id=734869#c18
Comment 7 StevenLee[:slee] 2012-06-06 19:06:19 PDT
Created attachment 630807 [details] [diff] [review]
Fixed assertion failure

Hi Michael,
I fixed the assertion that you requested in Bug 734869. Sorry for mindless fault.
Comment 9 Graeme McCutcheon [:graememcc] 2012-06-08 04:21:16 PDT
https://hg.mozilla.org/mozilla-central/rev/18e5d968ad10

(Merged by Ed Morley)

Note You need to log in before you can comment on or make changes to this bug.