[5.0.0.43] System time continues to get updated automatically even though automatic updates are switched off

REPRODUCIBILITY: 100%
OS VERSION: 5.0.0.43
HARDWARE: Jolla C2
UI LANGUAGE: English
REGRESSION: May be

DESCRIPTION:

Turning off automatic time updates doesn’t prevent the system time from getting automatically updated in the background.

PRECONDITIONS:

System is up, Wi-Fi connection is on. No SIM card.

STEPS TO REPRODUCE:

  1. In Settings => System => Time and date turn automatic updates on
  2. Switch WiFi off and back on, wait for it to get connected
  3. Switch automatic time updates off, change the system time (just the time, not the time zone). The time is changed.
  4. Wait 10-20 minutes
  5. Observe to time getting changed back to the actual local time

EXPECTED RESULT:

Manually set time keeps ticking.

ACTUAL RESULT:

The time appears to keep getting updated automatically despite automatic update being switched off in the system settings.

MODIFICATIONS:

None, it’s more or less a pristine system with a few harbour apps installed.

ADDITIONAL INFORMATION:

Tested it myself 10 minutes ago and the time doesn’t automatically switch to my local time.

You probably didn’t wait long enough. I tried it again and this time it took significantly longer than 5 minutes. It’s basically the next time when connman’s ntp time synchronizer kicks it:

  1. at 14:49:30 I switched off automatic time update and moved the time one hour ahead to 15:49:30
  2. almost 15 minutes later this appears in the connman log:
16:03:57.868 src/ntp.c: decode_msg() flags      : 0x24
16:03:57.868 src/ntp.c: decode_msg() stratum    : 3
16:03:57.869 src/ntp.c: decode_msg() poll       : 1024.000000 seconds (10)
16:03:57.869 src/ntp.c: decode_msg() precision  : 0.000000 seconds (-25)
16:03:57.870 src/ntp.c: decode_msg() root delay : 0 seconds (fraction 25344)
16:03:57.870 src/ntp.c: decode_msg() root disp. : 0 seconds (fraction 16896)
16:03:57.870 src/ntp.c: decode_msg() reference  : 0x973164c2
16:03:57.871 src/ntp.c: decode_msg() org=3945679437.849114 rec=3945675869.476004 xmt=3945675869.476082 dst=3945679437.867783
16:03:57.871 src/ntp.c: decode_msg() offset=-3568.382406 delay=0.018590
16:03:57.872 src/ntp.c: decode_msg() Timeserver 95.216.138.141, next sync in 1024 seconds
16:03:57.872 ntp: adjust (jump): -3568.382406 sec
15:04:29.493 src/ntp.c: decode_msg() interval/delta/delay/drift 1024.000000s/-3568.382s/0.019s/+0ppm
15:04:29.494 src/timeserver.c: ntp_callback() success 1

and the time got reset.The transmit delay is apparently fetched from the incoming ntp packet (without any validation or bounds checking) meaning that it’s pretty much unpredictable. In my case it happens to be 1024 seconds (17 minutes 4 seconds).

As in your error message, I waited 10 minutes and it didn’t change

So after over an hour the time was not changed or updated

ok, I looked closer at what’s going on. When I switch connman receives net.connman.Clock.TimeUpdates dbus call (from timed I guess). That calls __connman_timeserver_sync() but it doesn’t do anything because service and ts_service point to the same service:

351		if (service == ts_service)
(gdb) bt
#0  __connman_timeserver_sync (default_service=default_service@entry=0x0) at src/timeserver.c:351
#1  0x000000000046b230 in set_property (conn=<optimized out>, msg=0x2e2a6c40, data=<optimized out>) at src/clock.c:287
#2  0x00000000004cde7c in process_message (connection=0x2e1b8810, message=0x2e2a6c40, method=0x4f3ca8 <clock_methods+40>, iface_user_data=0x0) at gdbus/object.c:269
#3  0x0000007681b602ec in _dbus_object_tree_dispatch_and_unlock () from /usr/lib64/libdbus-1.so.3
#4  0x0000007681b4fefc in dbus_connection_dispatch () from /usr/lib64/libdbus-1.so.3
#5  0x00000000004ca9e0 in message_dispatch (data=0x2e1b8810) at gdbus/mainloop.c:80
#6  message_dispatch (data=0x2e1b8810) at gdbus/mainloop.c:67
#7  0x0000007681bfb3c4 in g_main_dispatch (context=context@entry=0x2e1b78a0) at ../glib/gmain.c:3476
#8  0x0000007681bfe648 in g_main_context_dispatch_unlocked (context=0x2e1b78a0) at ../glib/gmain.c:4284
#9  g_main_context_iterate_unlocked (context=0x2e1b78a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4349
#10 0x0000007681bff0b0 in g_main_loop_run (loop=0x2e18f520) at ../glib/gmain.c:4551
#11 0x0000000000418810 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1214

its list of timeservers is empty and yet ntp client is running and keeps synchronizing the local time with the ntp server. How it’s gotten into this state I don’t know. Switching between the services gets around that if (service == ts_service) condition and things get back to normal. I’ll reduce the reproducibility estimate to, say 20%.

1 Like

Actually, switching the default service doesn’t quite help. It does help to apply the last Automatic update change but the next change hits the same if (service == ts_service) condition and doesn’t get applied until the default service changes again. That’s 100% reproducible.

1 Like