! 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 !
orage 4.8.0.1 fails to compile on !linux in tz_convert.c
Status:
CLOSED: FIXED
Component:
clock-plugin

Comments

Description Landry Breuil editbugs 2011-01-19 13:50:00 CET
Created attachment 3381 
patch against src/tz_zoneinfo_read.c

I've tried the commit http://git.xfce.org/apps/orage/commit/?id=f3dc96f59c14bb58c2ff4dd443f86d851add4f32
but it still fails to build, as the #ifdef FTW_ACTIONRETVAL doesn't include the FTW_SKIP_SUBTREE in line 1480.
moving it above made orage finally build, and tz_convert correctly parses the 1790 tz.

Crashes when trying to change timezone, as it's looking for iso3166.tab file in zoneinfo/ subdir, whereas it's in misc/ on OpenBSD (NetBSD has it in zoneinfo, FreeBSD doesn't ship iso3166.tab).

I've patched read_countries() in tz_zoneinfo_read.c to strcat 'misc/' instead of 'zoneinfo/' into tz_dir, and it works fine. 

Orage: Processed 1790 timezone files from (/usr/share/zoneinfo)
read_countries: iso3166.tab file open failed (/usr/share/zoneinfo/iso3166.tab)
        fopen: No such file or directory

With the attached patches, orage 4.8.0 finally works fine here, although i get some warnings at startup (dunno where the markup errors come from):


** (orage:23695): WARNING **: get_first_weekday: Can not find first weekday. Using default: Monday=0. If this is wrong guess. please set undocumented parameter: Ical week start day (Sunday=6)

(orage:23695): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 51 : L'élément « markup » a été fermé, mais l'élément actuellement ouvert est « b »

(orage:23695): Gtk-WARNING **: Failed to set text from markup due to error parsing markup: Erreur à la ligne 1, caractère 51 : L'élément « markup » a été fermé, mais l'élément actuellement ouvert est « b »
Comment 1 Landry Breuil editbugs 2011-01-19 13:50:31 CET
Created attachment 3382 
patch against tz_convert/tz_convert.c
Comment 2 Landry Breuil editbugs 2011-01-19 14:24:45 CET
Panel plugin also crashes when i try to change timezone in plugin properties. There's a buffer overflow in get_orage_timezones()

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 24664, thread 0x865b7800]
0x1c009fb3 in file_call (file_name=0x88b19800 "/usr/share/zoneinfo/posix/Europe/London", sb=0x88715450, flags=0, f=0xcfbd7bac) at ../src/tz_zoneinfo_read.c:429
429         tz_array.city[tz_array.count] = strdup(in_timezone_name);
(gdb) p tz_array.count
$1 = 1004


Setting tz_array_size to 2000 of course fixes it, but it's a big gross.
Comment 3 juha editbugs 2011-01-20 08:40:37 CET
Thanks! I donot have BSD test system, so fixing these is not easy.
I will look this soon.
Comment 4 juha editbugs 2011-01-20 11:48:01 CET
Setting tz_array_size to 2000 instead 1000 costs about 20kB memory, which is not a big deal.

Not sure how to fix iso3166.tab handling as it can be in several places.
Comment 5 Landry Breuil editbugs 2011-01-20 16:20:09 CET
(In reply to comment #4)
> Setting tz_array_size to 2000 instead 1000 costs about 20kB memory, which is
> not a big deal.

Yeah, best fix would be to dynamically malloc it, as your comment states :)

> Not sure how to fix iso3166.tab handling as it can be in several places.
#ifdef __OpenBSD__ would be the simplest imo, as for FreeBSD i have no idea.
Comment 6 juha editbugs 2011-01-20 19:29:16 CET
Fixed in 4.8.0.4 available in git.
Hopefully it works now.
Comment 7 juha editbugs 2011-05-31 22:36:05 CEST
Fixed in 4.8.1

Bug #7141

Reported by:
Landry Breuil
Reported on: 2011-01-19
Last modified on: 2011-05-31

People

CC List:
0 users

Version

Attachments

patch against src/tz_zoneinfo_read.c (2.57 KB, patch)
2011-01-19 13:50 CET , Landry Breuil
no flags
patch against tz_convert/tz_convert.c (3.04 KB, patch)
2011-01-19 13:50 CET , Landry Breuil
no flags

Additional information