Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2019 22:54:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call
Message-ID:  <bug-240517-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240517

            Bug ID: 240517
           Summary: [PATCH] devel/glib20: syscall flood on every time*()
                    function call
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: gnome@FreeBSD.org
          Reporter: rozhuk.im@gmail.com
             Flags: maintainer-feedback?(gnome@FreeBSD.org)
          Assignee: gnome@FreeBSD.org

Created attachment 207400
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D207400&action=
=3Dedit
tzcache patch

truss show that GTK app do many times:
...
27100: openat(AT_FDCWD,"/etc/localtime",O_RDONLY,00) =3D 114 (0x72)
27100: fstat(114,{ mode=3D-r--r--r-- ,inode=3D1845941,size=3D1518,blksize=
=3D32768 }) =3D
0 (0x0)
27100: mmap(0x0,1518,PROT_READ,MAP_PRIVATE,114,0x0) =3D 34458873856 (0x805e=
8b000)
27100: close(114)                                =3D 0 (0x0)
27100: munmap(0x805e8b000,1518)                  =3D 0 (0x0)
...

I found article:
https://blog.packagecloud.io/eng/2017/02/21/set-environment-variable-save-t=
housands-of-system-calls/
and try to set:
env TZ=3D":/etc/localtime" truss -fD geany
or
env TZ=3D"Europe/Moscow" truss -fD geany
without success.

I discovered that glib time zone cache is does not work properly:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
GDateTime *
g_date_time_new_from_unix_local (gint64 t)
{
  GDateTime *datetime;
  GTimeZone *local;

  local =3D g_time_zone_new_local ();
  datetime =3D g_date_time_new_from_unix (local, t);
  g_time_zone_unref (local);

  return datetime;
}

GTimeZone *
g_time_zone_new_local (void)
{
  return g_time_zone_new (getenv ("TZ"));
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D

g_time_zone_new() load and add time zone to cache if arg is not NULL.
g_time_zone_unref() - remove time zone from cache.
As you can see time zone in most cases removed from cache after short time.

Patch add_ref() for time zone "getenv ("TZ")" and "UTC", all other calls
g_time_zone_new() leave without changes.
After apply patch and set TZ=3D":/etc/localtime" / TZ=3D"Europe/Moscow" no =
more
syscall flood happen.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240517-7788>