! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Panel hangs when opening clock plugin settings on Gentoo
Status:
RESOLVED: INVALID
Product:
Xfce4-panel

Comments

Description Maxim Mikityanskiy 2015-02-01 23:54:15 CET
Created attachment 5895 
Backtrace of infinite descending into /usr/share/zoneinfo/posix/posix/posix/posix/...

On Gentoo, there is a symlink:

/usr/share/zoneinfo/posix -> .

It makes clock_plugin_configure_zoneinfo_model_insert() to infinitely descend into /usr/share/zoneinfo/posix/posix/posix/posix/... (the attached backtrace shows this process at its very beginning).

I don't know why it doesn't crash because of stack overflow, but it doesn't crash, it just hangs for some long time, then continues working.

I suggest either using some mechanism to determine symlink loops or just applying attached quick-and-dirty patch that makes clock plugin completely ignore symlinks to directories.
Comment 1 Maxim Mikityanskiy 2015-02-01 23:54:51 CET
Created attachment 5896 
Quick-and-dirty fix
Comment 2 Steve Dodier-Lazaro editbugs 2015-02-08 18:44:40 CET
Could we please have input from other distros?

Is it normal that Gentoo uses a symlink and is it something we should expect? If so, what would the correct behaviour be?

On ArchLinux, posix is a directory.
Comment 3 Maxim Mikityanskiy 2015-02-08 18:49:16 CET
(In reply to Steve Dodier-Lazaro from comment #2)
> Could we please have input from other distros?
> 
> Is it normal that Gentoo uses a symlink and is it something we should
> expect? If so, what would the correct behaviour be?
> 
> On ArchLinux, posix is a directory.

Gentoo bug reported here: https://bugs.gentoo.org/show_bug.cgi?id=538484

On Ubuntu, posix is also a directory containing symlinks to files in /usr/share/zoneinfo.

I haven't seen any distribution that has /usr/share/zoneinfo/posix -> . symlink like Gentoo.
Comment 4 Steve Dodier-Lazaro editbugs 2015-02-08 19:31:14 CET
Thanks Maxim.

I don't think that preventing symlinks is the proper way to solve this issue, as it appears only a specific symlink causes a problem.

I haven't looked at the source code yet, but could you please describe what you expect the Clock plugin to do exactly, in your case? i.e. how can it find the proper configuration files for Gentoo users?
Comment 5 Maxim Mikityanskiy 2015-02-08 23:03:11 CET
(In reply to Steve Dodier-Lazaro from comment #4)
> Thanks Maxim.
> 
> I don't think that preventing symlinks is the proper way to solve this
> issue, as it appears only a specific symlink causes a problem.

Of course, it's just a quick-and-dirty quirk for Gentoo that just drops /usr/share/zoneinfo/posix subdir.

> I haven't looked at the source code yet, but could you please describe what
> you expect the Clock plugin to do exactly, in your case? i.e. how can it
> find the proper configuration files for Gentoo users?

The best option will be if clock plugin behaved identically on Gentoo and other distributions. It should correctly display timezones from /usr/share/zoneinfo, /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right directories. The ways it could be done:

1. Ugly way. Just don't permit to enter /usr/share/zoneinfo/posix/posix and /usr/share/zoneinfo/right/right. Should fix things on Gentoo, but it's rather ugly hack.

2. Fixing Gentoo way. Gentoo is really cheating, its /usr/share/zoneinfo/posix -> . symlink breaks things, so we could report it and try to make Gentoo use the same approach the other distributions do.

3. Systemd way. There is a command "timedatectl list-timezones" that lists available timezones. What it does is reading and parsing /usr/share/zoneinfo/zone.tab file (and manually appends UTC timezone). We could implement the same thing. Disadvantages of this approach:
  - /usr/share/zoneinfo/zone.tab is marked as deprecated in its header. Maybe /usr/share/zoneinfo/zone1970.tab could be replacement? Anyway, I'm not sure.
  - "timedatectl list-timezones" does not list timezones in posix and right directories. Unfortunately /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right don't contain zone.tab (well, on Gentoo with its symlinking, zone.tab could be found under one of these directories). Maybe we could just prepend "posix/" and "right/" to all timezones we found?

4. Any other solutions?
Comment 6 Simon Steinbeiss editbugs 2015-02-09 08:53:59 CET
Hm, if Gentoo is the only distro that has this issue, then why add a workaround in xfce4-terminal upstream?
Imho this would either qualify as a distro-patch or you get Gentoo devs to fix that (option 2).
Comment 7 Maxim Mikityanskiy 2015-02-10 19:13:23 CET
(In reply to Simon Steinbeiss from comment #6)
> Hm, if Gentoo is the only distro that has this issue, then why add a
> workaround in xfce4-terminal upstream?
> Imho this would either qualify as a distro-patch or you get Gentoo devs to
> fix that (option 2).

I've made a comment on existing Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=486532#c8
Comment 8 Michał Górny 2015-04-15 09:50:14 CEST
The Gentoo maintainer has just 'fixed' the issue via removing 'posix' symlink completely with the following explanation:

 * Support for accessing posix/ and right/ directly has been dropped to match
 * upstream.  There is no need to set TZ=posix/xxx as it is the same as TZ=xxx.
 * For TZ=right/, you can use TZ=../zoneinfo-leaps/xxx instead.  See this post
 * for details: https://mm.icann.org/pipermail/tz/2015-February/022024.html

Any suggestions how to proceed now?
Comment 9 Simon Steinbeiss editbugs 2019-07-31 22:39:42 CEST
@Michał: So the result is you get no timezone info at all in Gentoo..?
Comment 10 Michał Górny 2019-08-01 06:07:25 CEST
No but I suppose TZ=posix/... won't work anymore (→ people have to drop posix/ prefix).
Comment 11 Simon Steinbeiss editbugs 2019-08-01 07:11:37 CEST
Ok, I'll close this report as "doesn't apply anymore".

Bug #11495

Reported by:
Maxim Mikityanskiy
Reported on: 2015-02-01
Last modified on: 2019-08-01

People

Assignee:
Nick Schermer
CC List:
4 users

Version

Version:
Unspecified

Attachments

Additional information