Summary: | timezone data startup qtcore | ||
---|---|---|---|
Product: | [Unmaintained] kdelibs | Reporter: | Sergey Korolev <korolev.sergey> |
Component: | kded | Assignee: | David Jarvie <djarvie> |
Status: | CLOSED FIXED | ||
Severity: | crash | CC: | andresbajotierra, faure, kdelibs-bugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | KDE 4.4.5 | |
Sentry Crash Report: | |||
Attachments: |
A program that emulates behavior of my buggy one.
Emulates of KTimeZoned::readZoneTab |
Description
Sergey Korolev
2010-01-30 14:28:56 UTC
Created attachment 40398 [details]
A program that emulates behavior of my buggy one.
After successful KDE boot run an attached (open.c) program as root. This currupts the "/usr/share/zoneinfo/zone.tab" file. After next reboot KDE crashes while loading description of timezones.
I tried running your program, but didn't see any kded crash the next time I logged in. ktimezoned simply reported an invalid record in zone.tab, and carried on. That was on KDE 4.3.3 on Qt 4.5.2 on Linux. I did see a crash in libical when kalarm was run, but that's a different issue since libical does its own reading of zone.tab. Now I have Linux 2.6.31-gentoo-r6 with KDE 4.3.5 and Qt 4.5.3, but the crash is still repeats. On my system I found that the problem is in use of QTextStream.readLine() (see ktimezoned.cpp:310) function while reading of corrupted timezone data (for example 3 or more gigabytes). It consumes all RAM and leads to segmentation fault (see new attached test.cpp). Created attachment 41179 [details]
Emulates of KTimeZoned::readZoneTab
Does your test program make zone.tab a very large file? From your comments, and the source, I suspect so, but when I ran it, zone.tab stayed the same size but only the first character was corrupted. Yes, it is. My program should simply create an empty large file (filled only by zeroes) and try to read it by an emulated KTimeZoned::readZoneTab function. A limit of 2000 characters is now set when reading each zone.tab line, to guard against this crash. This limit should be more than adequate for any valid zone.tab. SVN commits 1140377, 1140378. Fixed for KDE 4.4.5 and KDE 4.5.0. |