Closed Bug 793831 Opened 7 years ago Closed 7 years ago

[b2g-ril] RIL crashes on desktop when trying to write to non-open socket

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: qdot, Assigned: qdot)

Details

Attachments

(1 file, 1 obsolete file)

At some point during recent gaia development, opening the Setting application causes RIL to try to write some data. On desktop B2G, since no RIL socket exists, this crashes due to not having validity checks for the socket.
Assignee: nobody → kyle
Attachment #664193 - Flags: review?(jones.chris.g)
Summary: [b2g-ril] RIL crashes on desktop when data tries to write to non-open socket → [b2g-ril] RIL crashes on desktop when trying to write to non-open socket
Comment on attachment 664193 [details] [diff] [review]
Patch 1 (v1) - Add socket validity checks to RIL IPC

>diff --git a/ipc/ril/Ril.cpp b/ipc/ril/Ril.cpp

>+void RilWriteTask::Run()
>+{
>+    if(sClient->mSocket.get() <= 0) {

< 0.  "0" is a valid fd.

r=me with that.
Attachment #664193 - Flags: review?(jones.chris.g) → review+
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #0)
> At some point during recent gaia development, opening the Setting
> application causes RIL to try to write some data.

I was going to ask what data this was, but then I discovered that it's probably

  navigator.mozMobileConnection.getCardLock('pin');

which makes perfect sense. Just posting this here in case anybody is wondering why Settings would talk to the radio.
Target Milestone: --- → mozilla18
Comment on attachment 666099 [details] [diff] [review]
Patch 1 (v2) - Add socket validity checks to RIL IPC

For some reason, evaluation of the ScopedClose without a .get() was doing weird things in the OpenSocket function. Fixed that. Now deals gracefully with socket handoff.

Also fixed an intermittent crash on MOZ_ASSERT of the IOLoop on shutdown by changing it to a task cancel and exit. Apparently our retry task doesn't die until after the IOLoop does?
Attachment #666099 - Flags: review?(jones.chris.g)
Comment on attachment 666099 [details] [diff] [review]
Patch 1 (v2) - Add socket validity checks to RIL IPC

r=me if you tested on device.  If you break RIL, I break your face ;).
Attachment #666099 - Flags: review?(jones.chris.g) → review+
https://hg.mozilla.org/mozilla-central/rev/1983304d2e60
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.