[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Andrej Mitrovic changed: What|Removed |Added Status|REOPENED|RESOLVED Version|D1 & D2 |D2 Resolution||FIXED --- Comment #16 from Andrej Mitrovic 2014-02-16 12:07:26 PST --- Marking as D2 only since Phobos D1 bugs will not be fixed. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #15 from github-bugzi...@puremagic.com 2014-02-16 12:02:03 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/1a3f9ab273dd6280cb9b4eda4a0da50d8c89fa88 fix Issue 1832 - rebuilding ZipArchive looses data - Already need to set compressedData slice when reading the directory index not only during expand. https://github.com/D-Programming-Language/phobos/commit/4bdd5f2c6ada5bc0ed37214f0e9d017f50ca8a83 Merge pull request #1870 from MartinNowak/fix1832 fix Issue 1832 - rebuilding ZipArchive looses data -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Andrej Mitrovic changed: What|Removed |Added Status|RESOLVED|REOPENED CC||andrej.mitrov...@gmail.com Resolution|FIXED | --- Comment #14 from Andrej Mitrovic 2014-02-16 05:56:28 PST --- New pull: https://github.com/D-Programming-Language/phobos/pull/1870 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #13 from Martin Krejcirik 2014-01-12 21:59:44 CET --- Was this really fixed ? I still get zero length data (code from comment #0) mk@bid:~/work/bugs$ unzip -lv ziptest1.zip Archive: ziptest1.zip Length MethodSize CmprDateTime CRC-32 Name -- --- -- - 4 Stored4 0% 1980-00-00 00:00 9d0d9845 ziptest.bin --- ------ 44 0%1 file mk@bid:~/work/bugs$ unzip -lv ziptest2.zip Archive: ziptest2.zip Length MethodSize CmprDateTime CRC-32 Name -- --- -- - 4 Stored0 100% 1980-00-00 00:00 ziptest.bin --- ------ 40 100%1 file -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Martin Nowak changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #12 from Martin Nowak 2014-01-12 12:11:55 PST --- (In reply to comment #11) > I think it's not so easy to fix this "cross-archive" member management. The regression was fixed with https://github.com/D-Programming-Language/phobos/pull/1775. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #11 from Andrea Fontana 2013-12-06 12:54:09 PST --- I think it's not so easy to fix this "cross-archive" member management. Consider for example expand() function. It uses data[] from ZipArchive, but uses offset from ArchiveMember, that was created from another data[]. BTW it's not the same bug as the original one, I guess. My vote goes for a full replacement of std.zip -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #10 from Andrea Fontana 2013-12-06 01:22:46 PST --- (In reply to comment #9) > (In reply to comment #8) > > This is another bug. m1 is owned by a1. m1._compressedData refers to data > > inside a1. So you're mixing data from two different objects/archives. I > > don't > > think it's a good idea. When you build a2, it tries to read compressed data > > from a2 data, but it should read from a1. > > > I see. > > > There's a simply workaround, but again, there's a problem on library > > design. If > > m1 is just compressed, we can read content it has inside _compressedData, if > > any. It filled it before with right reference to a1 data. This solve your > > bug, > > but probalby don't solve the mixing problem and of course it's not an > > elegant > > solution! > > > I think m1._compressedData is simply a slice to (constant) GC memory which was > allocated when reading a1. So here shouldn't be any problem to copy this data > into a new zip archive. Yes it is. But we're going to use data compressed/stored in/owned by another archive. That seems a mistake to me. I know we can do it, of course. Tonight I'll fix it then. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #9 from Martin Nowak 2013-12-06 01:07:58 PST --- (In reply to comment #8) > This is another bug. m1 is owned by a1. m1._compressedData refers to data > inside a1. So you're mixing data from two different objects/archives. I don't > think it's a good idea. When you build a2, it tries to read compressed data > from a2 data, but it should read from a1. > I see. > There's a simply workaround, but again, there's a problem on library design. > If > m1 is just compressed, we can read content it has inside _compressedData, if > any. It filled it before with right reference to a1 data. This solve your bug, > but probalby don't solve the mixing problem and of course it's not an elegant > solution! > I think m1._compressedData is simply a slice to (constant) GC memory which was allocated when reading a1. So here shouldn't be any problem to copy this data into a new zip archive. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #8 from Andrea Fontana 2013-12-06 00:47:18 PST --- This is another bug. m1 is owned by a1. m1._compressedData refers to data inside a1. So you're mixing data from two different objects/archives. I don't think it's a good idea. When you build a2, it tries to read compressed data from a2 data, but it should read from a1. There's a simply workaround, but again, there's a problem on library design. If m1 is just compressed, we can read content it has inside _compressedData, if any. It filled it before with right reference to a1 data. This solve your bug, but probalby don't solve the mixing problem and of course it's not an elegant solution! (In reply to comment #7) > I now get a segfault for the following code. > > import std.zip; > > void main() > { > auto a1 = new ZipArchive(); > auto m1 = new ArchiveMember(); > m1.expandedData = new ubyte[](10); > a1.addMember(m1); > a1.build(); > auto a2 = new ZipArchive(); > a2.addMember(m1); > a2.build(); // segfaults > } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Martin Nowak changed: What|Removed |Added Status|RESOLVED|REOPENED CC||c...@dawg.eu Resolution|FIXED | Severity|critical|regression --- Comment #7 from Martin Nowak 2013-12-05 20:46:34 PST --- I now get a segfault for the following code. import std.zip; void main() { auto a1 = new ZipArchive(); auto m1 = new ArchiveMember(); m1.expandedData = new ubyte[](10); a1.addMember(m1); a1.build(); auto a2 = new ZipArchive(); a2.addMember(m1); a2.build(); // segfaults } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #6 from Walter Bright 2013-11-24 15:52:09 PST --- Resolved for D2, not for D1. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #5 from github-bugzi...@puremagic.com 2013-11-21 20:04:42 PST --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/95af4e3c8c78020109af75c98ed5478c1b813ba7 Fixed phobos bug 1832 https://github.com/D-Programming-Language/phobos/commit/289c10521ae8f4c36cf00cbf71dac8ae9265809e Merge pull request #1697 from trikko/master Issue 1832 - reading/writing an archive causes data loss; std.zip horribly broken -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #4 from Andrea Fontana 2013-11-17 00:53:12 PST --- (In reply to comment #3) > Please redo your patch as a pull request at > https://github.com/D-Programming-Language/. Thanks! https://github.com/D-Programming-Language/phobos/pull/1697 -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 Andrei Alexandrescu changed: What|Removed |Added CC||and...@erdani.com --- Comment #3 from Andrei Alexandrescu 2013-11-16 16:58:10 PST --- Please redo your patch as a pull request at https://github.com/D-Programming-Language/. Thanks! -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 1832] reading/writing an archive causes data loss; std.zip horribly broken
https://d.puremagic.com/issues/show_bug.cgi?id=1832 --- Comment #2 from Andrea Fontana 2013-11-16 15:54:04 PST --- Created an attachment (id=1290) My patch as explained in bug's comment See previous comment -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---