bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

TelephonyService.js this._currentCalls[aClientId][aCall.callIndex] is undefined when User hangs up a call

RESOLVED FIXED in Firefox OS v2.0M


Firefox OS
4 years ago
3 years ago


(Reporter: thills, Assigned: aknow)


2.1 S9 (21Nov)
Gonk (Firefox OS)
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:2.0M+, b2g-v2.0 wontfix, b2g-v2.0M fixed, b2g-v2.1 unaffected, b2g-v2.2 fixed)



(3 attachments, 1 obsolete attachment)



4 years ago
Created attachment 8511062 [details]
adb logcat of the error

Occurs on: 
Gaia-Rev        d893a9b971a0f3ee48e5a57dca516837d92cf52b
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/a5ee2769eb27
Build-ID        20141024040202
Version         36.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20141024.071213
FW-Date         Fri Oct 24 07:12:24 EDT 2014
Bootloader      L1TC00011840

Does NOT occur on:
Gaia-Rev        1daf2dadcd0d554c733661a4c0be1b82001e9da0
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/33c0181c4a25
Build-ID        20141019160202
Version         36.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  eng.cltbld.20141019.192824
FW-Date         Sun Oct 19 19:28:34 EDT 2014
Bootloader      L1TC00011840


1.  Make an call to DuT (flame-kk).
2.  Answer the Call.
3.  After a few seconds, DuT hangs up the call.

Following error in teh logs:
W/GeckoConsole(  211): [JavaScript Error: "TypeError: this._currentCalls[aClientId][aCall.callIndex] is undefined" {file: "jar:file:///system/b2g/omni.ja!/components/TelephonyService.js" line: 1138}]
W/GeckoConsole(  211): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "this._currentCalls[aClientId][aCall.callIndex] is undefined" {file: "jar:file:///system/b2g/omni.ja!/components/TelephonyService.js" line: 1138}]'[JavaScript Error: "this._currentCalls[aClientId][aCall.callIndex] is undefined" {file: "jar:file:///system/b2g/omni.ja!/components/TelephonyService.js" line: 1138}]' when calling method: [nsIGonkTelephonyService::notifyCallDisconnected]" {file: "jar:file:///system/b2g/omni.ja!/components/RadioInterfaceLayer.js" line: 1851}]


3 years ago
Assignee: nobody → szchen

Comment 1

3 years ago
Explain the root cause.


A call was removed twice. In the second time, we got undefined error because the call had been already removed in first time.

So why did we remove it twice?
We issued two GET_CURRENT_CALL (1: after hangup, 2: after CALL_STATE_CHANGE) that led to two _processCalls(). When processing the call list, we immediately computed the set of removed calls and thought that there was one call need to be removed [1]. After the async call for getting the fail cause, we started to handle the added/removed calls [2].

In the second time of _processClassifiedCalls(), the call we want to remove is already gone. However, the information of removedCalls is not updated so it tried to removed it again. => Error.

_processCalls: function(newCalls) {
    let [removed, remained, added] = this._classifyCalls(newCalls);  // [1]

    // Let's get the failCause first if there are removed calls. Otherwise, we
    // need to trigger another async request when removing call and it cause
    // the order of callDisconnected and conferenceCallStateChanged
    // unpredictable.
    if (removed.length) {
      this.getFailCauseCode((function(removed, remained, added, failCause) {
        this._processClassifiedCalls(removed, remained, added, failCause); // [2]
      }).bind(this, removed, remained, added));
    } else {
      this._processClassifiedCalls(removed, remained, added);

Comment 2

3 years ago
Created attachment 8521136 [details] [diff] [review]
Fix _processCalls
Attachment #8521136 - Flags: review?(htsai)


3 years ago
Attachment #8521136 - Flags: review?(htsai) → review+

Comment 3

3 years ago
Created attachment 8523728 [details] [diff] [review]
[final] Fix _processCalls. r=hsinyi
Attachment #8521136 - Attachment is obsolete: true
Attachment #8523728 - Flags: review+

Comment 4

3 years ago
try looks good
xpcshell-test failure is fixed and verified locally.
Last Resolved: 3 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S9 (21Nov)


3 years ago
Blocks: 1092984

Comment 7

3 years ago
Created attachment 8527518 [details] [diff] [review]
(2.0m) [final] Fix _processCalls. r=hsinyi
Attachment #8527518 - Flags: review+


3 years ago
Blocks: 1080481, 1054172
blocking-b2g: --- → 2.0M+
status-b2g-v2.0: --- → affected
status-b2g-v2.0M: --- → affected
status-b2g-v2.1: --- → affected
status-b2g-v2.2: --- → fixed

Comment 8

3 years ago
Hi Kai-Zhen,
Please help to land this patch on 2.0M. Thanks!
Flags: needinfo?(kli)
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
status-b2g-v2.0M: affected → fixed
Flags: needinfo?(kli)


3 years ago
Duplicate of this bug: 1092984


3 years ago
Duplicate of this bug: 1102139
Does this need a b2g34 approval request for v2.1?
status-b2g-v2.0: affected → wontfix
Flags: needinfo?(szchen)


3 years ago
Depends on: 1112550
I suppose we would uplift to v2.1.
ni Josh for reconfirmation.
Flags: needinfo?(jocheng)


3 years ago
Depends on: 1059649
Flags: needinfo?(szchen)

Comment 14

3 years ago
(In reply to Wesley Huang [:wesley_huang] (EPM) (NI me) from comment #13)
> I suppose we would uplift to v2.1.
> ni Josh for reconfirmation.

Oh! I found that the issue here is introduced after landing bug 1059649, which is only applied on 2.0m and master. So, for the issue, v2.1 is not affected actually.

Do we have to uplift both Bug 1059649 and this one?

Comment 15

3 years ago
Hi Steven,
I think bug 1059649 should land on 2.1, however there is side effect which is this bug. So if you decide to uplift bug 1059649, you need to also uplift this one.
Could you help to triag? Thanks!
status-b2g-v2.1: affected → unaffected
Flags: needinfo?(jocheng) → needinfo?(styang)


3 years ago
Flags: needinfo?(styang)
You need to log in before you can comment on or make changes to this bug.