Bug 246387 - www/chromium: Synchronization stopped working a few versions back
Summary: www/chromium: Synchronization stopped working a few versions back
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-chromium (Nobody)
Depends on:
Reported: 2020-05-11 20:07 UTC by Joseph Mingrone
Modified: 2020-06-26 08:44 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (chromium)

Adapted Patch from OpenBSD (2.04 KB, patch)
2020-06-25 03:00 UTC, Jonathan Chen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Mingrone freebsd_committer 2020-05-11 20:07:22 UTC
As reported on chromium@ [1], password synchronization (and it seems other things like tabs and extensions) stopped working a few versions back.  I'm unsure of the exact version it stopped working, since I do not often use a second browser.

[1] https://docs.freebsd.org/cgi/getmsg.cgi?fetch=0+0+/usr/local/www/mailindex/archive/2020/freebsd-chromium/20200510.freebsd-chromium
Comment 1 donaldcallen 2020-05-14 18:03:58 UTC
I am also seeing this problem and it is a serious one. Firefox does not work well on FreeBSD (or on Linux, for that matter) frequently becoming unresponsive requiring manual killing and a restart. Chromium does not exhibit these problems on my Linux systems, but I can't use it on FreeBSD because of this issue.
Comment 2 Joseph Mingrone freebsd_committer 2020-05-14 19:56:31 UTC
(In reply to donaldcallen from comment #1)

It's serious, but keep in mind that (1) Chromium is not officially supported on FreeBSD, (2) upstream has be resistant to working with us, and (3) this is all a volunteer effort.  For (1), I don't have direct information, but have heard it from other FreeBSD developers.  Our Chromium port currently has over 800 local patches and I'm told there have been attempts to upstream some, but these requests were rejected.

If you are available, we can always use more volunteers to help keep Chromium in the best shape possible.
Comment 3 donaldcallen 2020-05-14 21:10:29 UTC
Thanks for the response. I understand the problem better per your message. The good news is I'm a very experienced software guy (I wrote my first line of code in 1960, which is a really frightening thought), but Chromium is such a rat's next, I think it's unlikely I can help. But I'll have a look and if I can make any headway, I'll get back.

One thought: OpenBSD has chromium 81 available as a package and while their packages aren't as carefully scrutinized as the core system, OpenBSD stuff usually works. I can do a test install and see how well sync works. If it does, it might provide some help in getting the FreeBSD version working.
Comment 4 Joseph Mingrone freebsd_committer 2020-05-14 21:14:12 UTC
I was just looking at the OpenBSD port as well.  They have 1934 local patches!  Some may be related to adopting their Chromium to use pledge.

Any free time you can spare would be appreciated. :)


Comment 5 Jan Beich freebsd_committer 2020-05-15 01:02:58 UTC
Duplicate of bug 244185? Maybe same issue relating to API key as bug 233095.
Comment 6 Robert Nagy 2020-06-23 11:40:55 UTC
OpenBSD was suffering from the same issue.
The fix is here:

Comment 7 Jonathan Chen 2020-06-25 03:00:12 UTC
Created attachment 215923 [details]
Adapted Patch from OpenBSD

So I had a look at the OpenBSD patches and converted the 2 patches that I believed were relevant, ie: SysInfo::GetHardwareInfo() and the invocation of the GetHardwareInfo().

However, my initial testing failed to indicate that sync was working. My test-methodology involved:
 1. removing ~/.config/chromium
 2. start up chrome, enable sync with chrome-login
 3. wait for 5 minutes

Unfortunately, nothing happened.

Looking at chrome://sync-internals/ the "Transport State" was still stuck at "Configuring data types".

Maybe more patches need to be converted?
Comment 8 Robert Nagy 2020-06-25 05:39:40 UTC
You also need this bit:

diff --git a/www/chromium/patches/patch-base_system_sys_info_cc b/www/chromium/patches/patch-base_system_sys_info_cc
new file mode 100644
index 00000000000..d39d993530d
--- /dev/null
+++ b/www/chromium/patches/patch-base_system_sys_info_cc
@@ -0,0 +1,14 @@
+$OpenBSD: patch-base_system_sys_info_cc,v 1.1 2020/06/23 06:32:53 robert Exp $
+Index: base/system/sys_info.cc
+--- base/system/sys_info.cc.orig
++++ base/system/sys_info.cc
+@@ -102,7 +102,7 @@ void SysInfo::GetHardwareInfo(base::OnceCallback<void(
+ #elif defined(OS_ANDROID) || defined(OS_MACOSX)
+   base::ThreadPool::PostTaskAndReplyWithResult(
+       FROM_HERE, {}, base::BindOnce(&GetHardwareInfoSync), std::move(callback));
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_BSD)
+   base::ThreadPool::PostTaskAndReplyWithResult(
+       FROM_HERE, {base::MayBlock()}, base::BindOnce(&GetHardwareInfoSync),
+       std::move(callback));
Comment 9 Joseph Mingrone freebsd_committer 2020-06-25 12:56:23 UTC
Robert, thank you for your help on this.

Donald and Jonathan, there is a (still untested) review at https://reviews.freebsd.org/D25449 if you want to test if synchronization is working with it.
Comment 10 Joseph Mingrone freebsd_committer 2020-06-25 14:24:20 UTC
As far as I can tell, synchronization is working as it should with that update.
Comment 11 commit-hook freebsd_committer 2020-06-26 00:44:17 UTC
A commit references this bug:

Author: jrm
Date: Fri Jun 26 00:43:53 UTC 2020
New revision: 540411
URL: https://svnweb.freebsd.org/changeset/ports/540411

  www/chromium: Update to 83.0.4103.106 and fix synchronization

  PR:		244185, 246387
  Reported by:	bourne.identity@hotmail.com
  Approved by:	chromium@ (rene), cem
  Obtained from:	Robert Nagy via OpenBSD port
  MFH:		2020Q2
  Security:	https://www.vuxml.org/freebsd/6a5d15b6-b661-11ea-8015-e09467587c17.html
  Differential Revision:	https://reviews.freebsd.org/D25449

Comment 12 Joseph Mingrone freebsd_committer 2020-06-26 00:54:24 UTC
Jonathan.  Thank you for your patch, which I am just seeing now.  Synchronization seems to be working now.  If you see more problems, please re-open this bug or a new one.

Robert, thank you again for sharing what you discovered with the OpenBSD port.
Comment 13 commit-hook freebsd_committer 2020-06-26 08:44:42 UTC
A commit references this bug:

Author: jrm
Date: Fri Jun 26 08:44:33 UTC 2020
New revision: 540450
URL: https://svnweb.freebsd.org/changeset/ports/540450

  MFH: r540411

  www/chromium: Update to 83.0.4103.106 and fix synchronization

  PR:		244185, 246387
  Reported by:	bourne.identity@hotmail.com
  Approved by:	ports-secteam (implicit), chromium@ (rene), cem
  Obtained from:	Robert Nagy via OpenBSD port
  Security:	https://www.vuxml.org/freebsd/6a5d15b6-b661-11ea-8015-e09467587c17.html
  Differential Revision:	https://reviews.freebsd.org/D25449

_U  branches/2020Q2/