From kde-core-devel Sun Nov 17 15:29:54 2002 From: Nicolas Goutte Date: Sun, 17 Nov 2002 15:29:54 +0000 To: kde-core-devel Subject: Re: Zip problems (Re: (no subject)) X-MARC-Message: https://marc.info/?l=kde-core-devel&m=103754712517637 I have found another problem. The fix is to change a memcpy by a qmemmove. However, I do not understand= why=20 it would be necessary in that case. (Gcc 3.2 bug?) If someone wants to understand the problem, I have left my kdDebugs (in=20 kdelibs/kio/kio/kzip.cpp in place before commiting. So please test and please find out if KZip has other problems than the tw= o=20 ones that I have found since yesterday. (For me, KWord works again.) Have a nice day/evening/night! On Sunday 17 November 2002 00:13, Nicolas Goutte wrote: > (In short: kdelibs/kio/kio/kzip.cpp has a bug that make KOffice unable = to > save anything correctly.) > > As this problem seems not over at all, here are my observations. > > The file saved by KWord is corrupted. Unzip does not recognised the fil= e as > a ZIP file. However "zip -FF" can recover the file it seems (for those = who > have lost their texts.) > > The problem that I have noticed is that the first entry of the central > directory is corrupted. Such an entry should start with the bytes 'P', = 'K', > 1, 2. However the first entry has not this sequence. > > I suppose that the sequence is overwritten by something. I have not fou= nd > out what. > > (Nevertheless, while browsing the code, I have found a bug for > stored/uncompressed files in the ZIP.) > > Have a nice day/evening/night! > > On Thursday 14 November 2002 19:17, David Faure wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On Thursday 14 November 2002 14:31, ismail donmez wrote: > > > On Thursday 14 November 2002 13:07, David Faure wrote: > > > > On Thursday 14 November 2002 08:10, Percy Leonhardt > > > > > > wrote: > > > > > On Monday 11 November 2002 08:52, ismail donmez > > > > > > wrote: > > > > > > KZip: WARNING Unrecognized header at offset > > > > > > and > > > > > > > > > it shows "Invalid file . Maindoc.xml not found" > > > > > > in gui > > > > > > > > > and exits when I press ok. > > > > > > > > > > There was no answer to this mail on the koffice > > > > > > list so I thought I > > > > > > > > forward it to koffice-devel. The bug happens with > > > > > > all OpenOffice files > > > > > > > > and thus makes it impossible to code on the > > > > > > importfilters... at least > > > > > > > > when you want to test them. > > > > > > > > I am not able to reproduce this problem, at least > > > > > > with the ascii import > > > > > > > filter. I tried debugging this with another person > > > > > > having the problem, and > > > > > > > all we got to, was that the problem is when writing > > > > > > (after using > > > > > > > koconverter, unzip says the .kwd file isn't a valid > > > > > > Zip file). > > > > > > > Can you reproduce this bug when importing a .txt > > > > > > file too? Can you confirm > > > > > > > that if you use koconverter, the .kwd is an invalid > > > >ZIP? > > > > > > Ok here what I tested more on my machine : > > > > Yeah I can reproduce it too, now, with a .sxw file. > > The bug is in Holger Schr=F6der's last commit to kzip.cpp (which was = a > > rather big change). I'm trying to debug it, but it's a bit hard, with= out > > knowing the ZIP file format at all. > > > > $ ./kziptest list /k/mytext.sxw > > Read from offset : 0 > > P > > K > > \x03 > > \x04 > > compressed file size=3D0 (looks wrong!) > > filenamelength=3D11 (which is ok for "contents.xml") > > extra field length=3D0 > > skip=3D11 > > dev->at()=3D41 > > offset=3D41 > > Read from offset : 41 > > \xad > > V > > \xdb > > n > > KZip: WARNING: Invalid ZIP file. Unrecognized header at offset 41 > > > > I tried changing the offset where the compressed file size is read, b= ut I > > get 0 in all cases.... > > > > But unzip manages to find the data.... > > Length Method Size Ratio Date Time CRC-32 Name > > - -------- ------ ------- ----- ---- ---- ------ ---- > > 2593 Defl:N 895 66% 03-06-02 19:12 29e00009 content.xml > > [...] > > > > Strange, I can't find 2593 nor 895 with khexedit (??) > > Holger - help! > > > > - -- > > David FAURE, david@mandrakesoft.com, faure@kde.org > > http://people.mandrakesoft.com/~david/ > > Contributing to: http://www.konqueror.org/, http://www.koffice.org/ > > Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/ > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.0.7 (GNU/Linux) > > > > iD8DBQE90+ii72KcVAmwbhARAvAhAJ0Vz7XkA8OwBj9zJjgD6lEcd5ty+gCgg/OQ > > +FmwydeDK8PSpUL+PL5uAWI=3D > > =3D+S+S > > -----END PGP SIGNATURE----- > > > > _______________________________________________ > > koffice-devel mailing list > > koffice-devel@mail.kde.org > > http://mail.kde.org/mailman/listinfo/koffice-devel > > _______________________________________________ > koffice-devel mailing list > koffice-devel@mail.kde.org > http://mail.kde.org/mailman/listinfo/koffice-devel