Closed Bug 1088690 Opened 10 years ago Closed 10 years ago

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

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

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

RESOLVED FIXED
2.1 S9 (21Nov)
blocking-b2g 2.0M+
Tracking Status
b2g-v2.0 --- wontfix
b2g-v2.0M --- fixed
b2g-v2.1 --- unaffected
b2g-v2.2 --- fixed

People

(Reporter: thills, Assigned: aknow)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file adb logcat of the error (deleted) —
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 STR: 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}]
Assignee: nobody → szchen
Explain the root cause. http://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/ril_worker.js?from=ril_worker.js&case=true#4031 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); } },
Attached patch Fix _processCalls (obsolete) (deleted) — Splinter Review
Attachment #8521136 - Flags: review?(htsai)
Attachment #8521136 - Flags: review?(htsai) → review+
Attachment #8521136 - Attachment is obsolete: true
Attachment #8523728 - Flags: review+
try looks good https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=8a608dc5aebe xpcshell-test failure is fixed and verified locally.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S9 (21Nov)
Blocks: Woodduck
blocking-b2g: --- → 2.0M+
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
Does this need a b2g34 approval request for v2.1?
Flags: needinfo?(szchen)
I suppose we would uplift to v2.1. ni Josh for reconfirmation.
Flags: needinfo?(jocheng)
Depends on: 1059649
Flags: needinfo?(szchen)
(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?
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!
Flags: needinfo?(jocheng) → needinfo?(styang)
Flags: needinfo?(styang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: