[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

            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: [hidden email]
          Reporter: [hidden email]
             Flags: maintainer-feedback?([hidden email])
          Assignee: [hidden email]

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

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

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

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

  local = g_time_zone_new_local ();
  datetime = 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"));
}
==========================================================

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=":/etc/localtime" / TZ="Europe/Moscow" no more
syscall flood happen.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

maintainer-feedback requested: [Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
Bugzilla Automation <[hidden email]> has asked freebsd-gnome mailing list
<[hidden email]> for maintainer-feedback:
Bug 240517: [PATCH] devel/glib20: syscall flood on every time*() function call
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517



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

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

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

  local = g_time_zone_new_local ();
  datetime = 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"));
}
==========================================================

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=":/etc/localtime" / TZ="Europe/Moscow" no more
syscall flood happen.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #207400|0                           |1
        is obsolete|                            |

--- Comment #1 from [hidden email] ---
Created attachment 207403
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=207403&action=edit
fix possible mem leak

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #207403|0                           |1
        is obsolete|                            |
 Attachment #207446|                            |maintainer-approval+
              Flags|                            |

--- Comment #2 from [hidden email] ---
Created attachment 207446
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=207446&action=edit
optimized version

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://gitlab.gnome.org/GN
                   |                            |OME/glib/merge_requests/110
                   |                            |5

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #207446|maintainer-approval+        |
              Flags|                            |

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #207446|0                           |1
        is obsolete|                            |
 Attachment #208785|                            |maintainer-approval?
              Flags|                            |

--- Comment #3 from [hidden email] ---
Created attachment 208785
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=208785&action=edit
patch

Back ported from master:
https://gitlab.gnome.org/GNOME/glib/commit/f343ec5f82ddb6dfc7ce209cb8d49b0d02c914db

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

--- Comment #4 from [hidden email] ---
ping

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|maintainer-feedback?(gnome@ |maintainer-feedback-
                   |FreeBSD.org)                |

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

--- Comment #5 from [hidden email] ---
maintainer timeout

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 240517] [PATCH] devel/glib20: syscall flood on every time*() function call

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240517

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Closed
         Resolution|---                         |Overcome By Events

--- Comment #6 from [hidden email] ---
In upstream, upstream in base.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-gnome
To unsubscribe, send any mail to "[hidden email]"