Cannot import contacts from sim card ( ofono crash )

Bug #1486004 reported by vallee
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
John McAleely
address-book-app (Ubuntu)
Incomplete
Undecided
Unassigned
ofono (Ubuntu)
Fix Released
High
Alfonso Sanchez-Beato

Bug Description

I open a new bug as asked from this bug (last comment #14) : https://bugs.launchpad.net/ubuntu/+source/address-book-app/+bug/1331346?comments=all

I've got a meizu mx4 ubuntu phone, but i cannot import contacts from the sim card, it makes some wierd messages but never stop, and no contact is imported.

As asked in the previous bug repport, the /var/log/syslog file attached and the output :
Warning: Permanently added '[127.0.0.1]:10000' (RSA) to the list of known hosts.
Welcome to Ubuntu 15.04 (GNU/Linux 3.10.35+ armv7l)

 * Documentation: https://help.ubuntu.com/
Last login: Mon Jul 20 17:05:07 2015 from localhost.localdomain
phablet@ubuntu-phablet:~$ /usr/share/ofono/scripts/test-phonebook /ril_0
Traceback (most recent call last):
  File "/usr/share/ofono/scripts/test-phonebook", line 23, in <module>
    print(phonebook.Import(timeout=100))
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
phablet@ubuntu-phablet:~$ /usr/share/ofono/scripts/test-phonebook /ril_1
Traceback (most recent call last):
  File "/usr/share/ofono/scripts/test-phonebook", line 23, in <module>
    print(phonebook.Import(timeout=100))
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Method "Import" with signature "" on interface "org.ofono.Phonebook" doesn't exist

phablet@ubuntu-phablet:~$

Revision history for this message
vallee (jeanpaul-vallee1) wrote :
Tony Espy (awe)
Changed in ofono (Ubuntu):
status: New → Incomplete
Revision history for this message
Tony Espy (awe) wrote :

@vallee

A couple questions for you...

1. Can you please attach the output of the command 'system-image-cli -i' ( run on the phone )?

2. Have you made your phone writeable and installed any other software using apt?

3. Can you give us a rough estimate of how many contacts you have stored on your SIM?

4. From looking at the syslog you attached, it looks like ofonod is crashing. Can you check if there's a .crash file in /var/crash for ofonod and attach it to this bug please?

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

@vallee

One more request...

1. adb into the phone

2. become root ( sudo -i )

3. Run the command 'stop ofono'

4. Run the command 'script ofono.out'

5. Run the attached script, this will run ofono in the foreground and output a bunch of debug output

6. Re-run the 'test-phonebook' script ( /usr/share/ofono/scripts/test-phonebook )

7. Ctrl-C to terminate ofono

8. Ctrl-D to stop the script command

9. Grab the ofono.out command from the phone and attach to this bug please

Revision history for this message
vallee (jeanpaul-vallee1) wrote :
Download full text (3.8 KiB)

forget previous result, I tried again (sorry):

>>1. adb into the phone
>>2. become root ( sudo -i )
>>3. Run the command 'stop ofono'
>>4. Run the command 'script ofono.out'
>>5. Run the attached script, this will run ofono in the foreground and output a bunch of debug output
>>6. Re-run the 'test-phonebook' script ( /usr/share/ofono/scripts/test-phonebook )
>>7. Ctrl-C to terminate ofono
>>8. Ctrl-D to stop the script command
>>9. Grab the ofono.out command from the phone and attach to this bug please

In the first terminal :

root@ubuntu-phablet:~# cd /home/phablet/Documents/
root@ubuntu-phablet:/home/phablet/Documents# stop ofono
stop: Unknown instance:
root@ubuntu-phablet:/home/phablet/Documents# script ofono.out
Script started, file is ofono.out
root@ubuntu-phablet:/home/phablet/Documents# ./debug-ofono.sh
Script started, file is ofonod.out ----->here i used the second terminal
root@ubuntu-phablet:/home/phablet/Documents# ^C
root@ubuntu-phablet:/home/phablet/Documents# exit
Script done, file is ofonod.out
ofonod[9934]: oFono version 1.12
ofonod[9934]: Excluding udev hardware detection
ofonod[9934]: Excluding Sim Access Profile Plugins
ofonod[9934]: Excluding Hands-Free Profile Plugins
ofonod[9934]: Excluding Provisioning Plugin
ofonod[9934]: src/phonebook.c:ofono_phonebook_driver_register() driver: 0xfe74c, name: atmodem
ofonod[9934]: src/phonebook.c:ofono_phonebook_driver_register() driver: 0xfdca0, name: isimodem
ofonod[9934]: src/phonebook.c:ofono_phonebook_driver_register() driver: 0xfdc28, name: rilmodem
ofonod[9934]: RILDEV detected modem type mtk, 1 SIM slot(s)
ofonod[9934]: radio_state_changed, /dev/socket/rild, state: SIM_READY
ofonod[9934]: Physical slot 0 in socket /dev/socket/rild
ofonod[9934]: [slot 0] CONNECTED
ofonod[9934]: SMS History Probe for modem: 0x716848
ofonod[9934]: Network time: Registered inteface org.ofono.NetworkTime, path /ril_0
ofonod[9934]: mtk_radio_state_changed, slot 0: state: SIM_NOT_READY md->ofono_online: 1
ofonod[9934]: mtk_radio_state_changed, slot 0: state: SIM_READY md->ofono_online: 1
ofonod[9934]: Requested file structure differs from SIM: 6fb7
ofonod[9934]: Registered handle for channel 13: 0x1000f
ofonod[9934]: Registered handle for channel 1: 0x10010

and the output of the second terminal

root@ubuntu-phablet:/home/phablet/Documents# /usr/share/ofono/scripts/test-phonebook
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    's', (bus_name,), **keywords)
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.ofono': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/ofono/scripts/test-phonebook", line 11, in <module>
    manager = dbus.Interface(bus.get_object('org.ofono', '/'),
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241,...

Read more...

Revision history for this message
vallee (jeanpaul-vallee1) wrote :

>>1. Can you please attach the output of the command 'system-image-cli -i' ( run on the phone )?

phablet@ubuntu-phablet:~$ system-image-cli -i
current build number: 3
device name: arale
channel: ubuntu-touch/stable/meizu.en
last update: 2015-07-20 15:12:43
version version: 3
version ubuntu: 20150720
version device: 20150709-8965e37
version custom: 20150716-819-8-42
phablet@ubuntu-phablet:~$

>>2. Have you made your phone writeable and installed any other software using apt?

Developper mode enabled
I ran 2 or 3 of the ubuntu-sdk apps on the phone

>>3. Can you give us a rough estimate of how many contacts you have stored on your SIM?

May be 30 (I think of managing the micro sim card in order to put it back in my old phone (standard sim), i will answer precisely if i succeed...)

>>4. From looking at the syslog you attached, it looks like ofonod is crashing. Can you check if there's a .crash file in /var/crash for ofonod and attach it to this bug please?

cf. attached files.

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

@vallee

Thanks for your update. I look at the crash file(s) later this afternoon.

As for the test script, I blew it and uploaded a busted script ( which had an internal script call, which is why you saw no output ). I've attached a new copy that should work. You should also see immediate output from the script when you run it.

A couple of other comments...

1. Before re-testing, restart the phone so that you're starting from a fresh system state.

2. Before you stop ofono, please try the command ( as root ) 'status ofono', and run it a couple of times to confirm:

  - that ofono is indeed running ( if it's not, this is a bigger problem )

 - that it's not continually crashing ( ie. the process ID doesn't change every time you run the status command )

3. The rest of the steps should be the same, and you should be able to run everything but the 'test-phonebook' command in one terminal instance.

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

The version of ofono that is included with the stable image #3 on the MX4 is: 1.12.bzr6900+15.04.20150702.3-0ubuntu1. I've attached the -dbg package in case someone wants to re-view the raw crash file.

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

I'm also attaching the crash file after the backtrace has been created ( after installing the -dbg package and viewing the crash with apport-cli ).

Here's the stack trace which occurs in the rilmodem phonebook atom:

#0 read_record_cb (ok=<optimized out>, total_length=<optimized out>, record=<optimized out>, data=0xf92130 "", record_length=2, userdata=0xf933e0) at d
rivers/rilmodem/phonebook.c:679
         ref = 0xf94130
         file_info = <optimized out>
         cbd = 0xf933e0
         pb = <optimized out>
         pbd = <optimized out>
         ref = <optimized out>
         rec = 0xf8fde0
         __func__ = "read_record_cb"
         __FUNCTION__ = "read_record_cb"
 #1 0x000b7e1e in sim_fs_op_read_record_cb (error=<optimized out>, sdata=0xf92130 "", length=2, data=0xf83ff0) at src/simfs.c:352
         fs = 0xf83ff0
         op = <optimized out>
         cb = 0x34c2d <read_record_cb>
 #2 0x000316d0 in ril_file_io_cb (message=<optimized out>, user_data=0xf91f50) at drivers/rilmodem/sim.c:283
         cbd = 0xf91f50
         cb = 0xb7df1 <sim_fs_op_read_record_cb>
         sd = 0xf75cb0
         error = {type = OFONO_ERROR_TYPE_NO_ERROR, error = 0}
         reply = 0xf93bf0
 #3 0x000239b8 in handle_response (message=0xf93b30, p=0xf823c0) at gril/gril.c:387
         count = <optimized out>
         i = <optimized out>
         len = <optimized out>
         req = 0xf91640
         found = 1
         id = <optimized out>
 #4 dispatch (message=0xf93b30, p=<optimized out>) at gril/gril.c:548
         data_len = <optimized out>
         unsolicited_field = <optimized out>
         id_num_field = <optimized out>
         bufp = <optimized out>
         datap = <optimized out>

Changed in ofono (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → High
summary: - Cannot import contacts from sim card
+ Cannot import contacts from sim card ( ofono crash )
Tony Espy (awe)
Changed in address-book-app (Ubuntu):
status: New → Incomplete
Revision history for this message
Michael Mess (michael-michaelmess) wrote :

Happens reproducable on my BQ Aquaris 4.5 with Ubuntu 15.04 (r25).
I have updated today (04.09.2015) but despite of the release Notes (https://wiki.ubuntu.com/Touch/ReleaseNotes/OTA-6) saying that contacts can now be imported, it does not work. :-(

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

I had been working on bug #1492388, and then I came across this bug, which seems to be the same :-)

The crash seems to happens when a record in EFpbr does not contain any files types to read. This branch should fix the issue:

https://github.com/rilmodem/ofono/pull/201

I have attached a binary ofonod in case somebody wants to give it a try. To use it, download and follow these instructions:

$ adb push ofonod /tmp/
$ adb shell
$ sudo su
# stop ofono
# chmod +x /tmp/ofonod

Then, execute as follows:

For BQ phones
# OFONO_RIL_DEVICE=mtk OFONO_RIL_NUM_SIM_SLOTS=2 /tmp/ofonod -nd -P stktest,provision,sap,udev,dun,smart,hfp

For MX4:
# OFONO_RIL_DEVICE=mtk /tmp/ofonod -nd -P stktest,provision,sap,udev,dun,smart,hfp

For mako:
# /tmp/ofonod -nd -P stktest,provision,sap,udev,dun,smart,hfp

Finally try to import your contacts from the contacts-app. Please attach the output of ofonod execution if that does still not work. As a bonus, if importing worked you will not need to wait for the next OTA with the proper fix, as you will already have the contacts imported.

Changed in ofono (Ubuntu):
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
status: Confirmed → In Progress
Changed in ofono (Ubuntu):
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
importance: Undecided → High
milestone: none → ww40-2015
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ofono - 1.17.bzr6904+15.10.20150928.1-0ubuntu1

---------------
ofono (1.17.bzr6904+15.10.20150928.1-0ubuntu1) wily; urgency=medium

  [ Alfonso Sanchez-Beato (email Canonical) ]
  * Update to upstream release 1.17
  * Do not assert when the radio is unavailable (LP: #1490991)
  * Fix crash when importing phonebook (LP: #1486004)
  * Check only destination port when receiving push (LP: #1490673)
  * Fix crash when retrying to close context (LP: #1492483)

  [ CI Train Bot ]
  * No-change rebuild.

 -- Alfonso Sanchez-Beato <email address hidden> Mon, 28 Sep 2015 09:27:18 +0000

Changed in ofono (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Revision history for this message
Csernátoni Csaba (csaba-csernatoni) wrote :

Seems to have been fixed in OTA-7...? Today, when I tried to import from SIM again, it still gave me the "Error reading SIM card" message first. THEN I went back to Contacts. and chose the import again - and this time it happened! So... there is still SOMETHING wrong with it...

Revision history for this message
Carla (carla-cabrera) wrote :

Hi there!

Contacts cannot be imported from SIM card after OTA-8. Verified with several Aquaris E4.5 and E5 Ubuntu Ed units, the option appears in light grey and cannot be selected.

Please, reopen the bug report. Thank you!

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thank you Carla. It looks like a different issue. I filed bug 1522010

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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