ofono can crash if SIM card has not yet been activated

Bug #1215724 reported by Paul Larson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ofono (Ubuntu)
Invalid
Medium
Brendan Donegan

Bug Description

Image: 20130822.1
Device: Nexus 4

Almost all the automated test runs in the lab failed on the above image, and there was a lot of noise in the logs from Networkmanager and ofono. Right after boot, it started with:
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <info> (/ril_0): device state change: prepare -> failed (reason 'modem-no-carrier') [40 120 25]
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <info> Marking connection '/310410594672924/context1' invalid.
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <warn> Activation (/ril_0) failed for connection '/310410594672924/context1'
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <info> Activation (/ril_0) Stage 1 of 5 (Device Prepare) complete.
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <info> (/ril_0): device state change: failed -> disconnected (reason 'none') [120 30 0]
Aug 23 02:22:46 ubuntu-phablet NetworkManager[1250]: <info> (/ril_0): deactivating device (reason 'none') [0]
Aug 23 02:22:51 ubuntu-phablet NetworkManager[1250]: <info> (wlan0): IP6 addrconf timed out or failed.
Aug 23 02:22:51 ubuntu-phablet NetworkManager[1250]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Aug 23 02:22:51 ubuntu-phablet NetworkManager[1250]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Aug 23 02:22:51 ubuntu-phablet NetworkManager[1250]: <info> Activation (wlan0) Stage 4 of 5 (IPv6 Configure Timeout) complete.

...and went downhill from there pretty fast. The full logs can be found at:
https://jenkins.qa.ubuntu.com/job/saucy-touch-mako-smoke-mediaplayer-app-autopilot/66/consoleFull

These errors did not occur in previous runs.

I don't think this device has a sim card in it, but I'm also trying at home in a device that does to see if I can reproduce. It's also worth mentioning that I did *not* see these errors on the galaxy nexus runs in the lab

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

this probably means that autoprovisioning + enabling gprs is finally working

Revision history for this message
Tony Espy (awe) wrote :

@Paul

Why are we running system tests on a device without a SIM?

Looking at the logs, indeed there's a hard-loop with ofonod exiting due to lack of SIM and re-starting.

We still haven't implemented emergency mode, which will fix this scenario. Emergency mode allows the phone to be used to for calls to a restricted set of emergency numbers if no SIM is present, if a user doesn't remember the phone PIN/pattern to unlock, or the SIM is locked.

So in my opinion, the Status should be lowered, and the bug assigned to me. I will re-word the description as well.

Revision history for this message
Tony Espy (awe) wrote :

@Paul

OK, let's pretend I didn't write that first comment and start over.

This time I've gone through the jenkins test report in much closer detail, as well as downloaded the referenced .crash file. Unfortunately, the backtrace isn't very useful, just that a segfault occurred in a call to strlen().

As the build used was 20130822.1, the version of ofono is 1.12-0ubuntu7.

1. From the jenkins log output, the unit under test did have a SIM card. Otherwise the message "No SIM card present." would have been logged.

2. Furthermore, this looks like a case of ofonod crashing, after a failure occurs trying to read the SIM PIN state. The core ofono SIM code calls rilmodem's query_passwd_state() function, which only returns a failure if the current passwd_state is INVALID.

3. It turns out, there was indeed a SIM card, however it had not yet been activated!!

So, I'm going to try and force the crash by hard-coding the passwd_state to INVALID to see if I can trigger the crash.

I'm also lowering the priority to High and will edit the bug title.

Changed in touch-preview-images:
importance: Critical → High
status: New → Confirmed
assignee: nobody → Tony Espy (awe)
summary: - Lots of ofono and network manager errors on nexus4
+ ofono can crash if SIM card has not yet been activated
Tony Espy (awe)
Changed in touch-preview-images:
status: Confirmed → Incomplete
assignee: Tony Espy (awe) → Paul Larson (pwlars)
Revision history for this message
Tony Espy (awe) wrote :

@Paul

As mentioned in the previous comment, I created a test version of ofono which always returns a failure on query_passwd_state() calls to the sim_driver. Unfortunately this doesn't trigger a crash like the originally bug report.

So, I've re-assigned the bug back to Paul and changed the Status to Incomplete, as I can't reproduce the bug.

If you could please attach details about the how I can get my hands on a partially activated SIM card like the one used on the device, then I can try again to reproduce the problem. Feel free to re-assign the bug back to me once you've added the requested information.

Revision history for this message
Tony Espy (awe) wrote :

Note, the related branch is hard-coded to fail the query_passwd() call, however as mentioned above, running this code didn't result in a crash.

Revision history for this message
Paul Larson (pwlars) wrote :

@Tony, I talked to Rick Fowler in the lab, and he has an unactivated sim card, just like the one used when this bug was noticed, that he can lend you for reproducing this.

Changed in ofono (Ubuntu):
importance: Undecided → High
assignee: nobody → Paul Larson (pwlars)
no longer affects: touch-preview-images
Paul Larson (pwlars)
Changed in ofono (Ubuntu):
assignee: Paul Larson (pwlars) → Tony Espy (awe)
Revision history for this message
Tony Espy (awe) wrote :

I just changed the Status of this bug to Incomplete again. I cannot reproduce this bug as described...

Changed in ofono (Ubuntu):
status: New → Incomplete
Changed in ofono (Ubuntu):
importance: High → Medium
Revision history for this message
Paul Larson (pwlars) wrote :

@Tony - don't forget that Rick Fowler should still have a straighttalk sim that is not activated if you want to try it for any of these bugs

tags: added: qa-daily-testing rtm14
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

Assigning to brendan, he has some simcards coming in the mail to test

Changed in ofono (Ubuntu):
assignee: Tony Espy (awe) → Brendan Donegan (brendan-donegan)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

Brendan could not reproduce this with unactivated simcards, marking bug as invalid

tags: removed: qa-daily-testing rtm14
Changed in ofono (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.