/usr/lib/arm-linux-gnueabihf/indicator-datetime/indicator-datetime-service:5:reset_timer:unity::indicator::datetime::LiveClock::Impl::on_timerfd_cond:g_main_dispatch:g_main_context_dispatch:g_main_context_iterate

Bug #1424966 reported by errors.ubuntu.com bug bridge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Unassigned
indicator-datetime (Ubuntu)
Fix Released
Critical
Charles Kerr
indicator-datetime (Ubuntu RTM)
Fix Released
Undecided
Unassigned

Bug Description

It happened randomly but several time on RTM/krillin. According to errors.u.c it started with 13.10.0+15.04.20150213.1-0ubuntu1 on vivid and 13.10.0+15.04.20150213~rtm-0ubuntu1 on RTM.

  [ Charles Kerr ]
  * change the WallClock to detect time changes from
    TFD_TIMER_CANCEL_ON_SET, e.g. when ntp<-->manual is toggled

The Ubuntu Error Tracker has been receiving reports about a problem regarding indicator-datetime. This problem was most recently seen with version 13.10.0+15.04.20150213.1-0ubuntu1, the problem page at https://errors.ubuntu.com/problem/3b8aefe51ab8eae0b64a89605ae01d5433da3000 contains more details.

current build number: 242
device name: krillin
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed
last update: 2015-02-23 08:07:23
version version: 242
version ubuntu: 20150223
version device: 20150216-fe747ac
version custom: 20150216-561-29-186

Trace:
https://errors.ubuntu.com/bucket/?id=/usr/lib/arm-linux-gnueabihf/indicator-datetime/indicator-datetime-service%3A5%3Areset_timer%3Aunity%3A%3Aindicator%3A%3Adatetime%3A%3ALiveClock%3A%3AImpl%3A%3Aon_timerfd_cond%3Ag_main_dispatch%3Ag_main_context_dispatch%3Ag_main_context_iterate

Related branches

description: updated
description: updated
Changed in indicator-datetime (Ubuntu):
importance: Undecided → High
description: updated
Changed in indicator-datetime (Ubuntu):
importance: High → Critical
Charles Kerr (charlesk)
Changed in indicator-datetime (Ubuntu):
assignee: nobody → Charles Kerr (charlesk)
status: New → In Progress
Revision history for this message
Charles Kerr (charlesk) wrote :

Confirmed, this is related to the TFD_TIMER_CANCEL_ON_SET change. Looks like timerfd_settime() is failing and setting errno to ECANCELED. This isn't listed as a possible error in the manpage but now that we're hitting ECANCELED a web search turns up the condition pretty quickly.

The ability to return ECANCELED was added was added for this use case:

<http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=99ee5315dac6211e972fa3f23bcc9a0343ff58c4>

> Some applications must be aware of clock realtime being set
> backward. A simple example is a clock applet which arms a timer for
> the next minute display. If clock realtime is set backward then the
> applet displays a stale time for the amount of time which the clock
> was set backwards. Due to that applications poll the time because we
> don't have an interface.
>
> Extend the timerfd interface by adding a flag which puts the timer
> onto a different internal realtime clock. All timers on this clock are
> expired whenever the clock was set.
>
> The timerfd core records the monotonic offset when the timer is
> created. When the timer is armed, then the current offset is compared
> to the previous recorded offset. When it has changed, then
> timerfd_settime returns -ECANCELED. When a timer is read the offset is
> compared and if it changed -ECANCELED returned to user space. Periodic
> timers are not rearmed in the cancelation case.
> http://www.spinics.net/lists/linux-tip-commits/msg11814.html

Likely solution: in indicator-datetime/src/clock-live.cpp, move the timerfd_create() call from LiveClock::Impl::Impl() to LiveClock::Impl::reset_timer(), also adding a test to close() the previous timer if it's not -1.

I will be able to start on this in ~10 hours when my jury duty is done for the day. If this bug is deemed as supercritical, please feel free to reclaim the ticket and fix it before then.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

consider for ota crash fix

Changed in canonical-devices-system-image:
milestone: none → ww13-ota
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-datetime - 13.10.0+15.04.20150301.1-0ubuntu1

---------------
indicator-datetime (13.10.0+15.04.20150301.1-0ubuntu1) vivid; urgency=medium

  [ CI Train Bot ]
  * New rebuild forced.

  [ Charles Kerr ]
  * create a new timerfd each time we need to call timerfd_settime().
    (LP: #1424966)
 -- CI Train Bot <email address hidden> Sun, 01 Mar 2015 06:08:10 +0000

Changed in indicator-datetime (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-datetime - 13.10.0+15.04.20150226~rtm-0ubuntu1

---------------
indicator-datetime (13.10.0+15.04.20150226~rtm-0ubuntu1) 14.09; urgency=medium

  [ Charles Kerr ]
  * Avoid ECANCELED errors in calls to timerfd_settime() (LP: #1424966)
 -- CI Train Bot <email address hidden> Thu, 26 Feb 2015 05:29:29 +0000

Changed in indicator-datetime (Ubuntu RTM):
status: New → Fix Released
Changed in canonical-devices-system-image:
status: New → Fix Released
importance: Undecided → Critical
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.