Opened 6 years ago
Closed 3 years ago
#5165 closed defect (fixed)
Zip files with comments trip assertion on game startup
Reported by: | Teiresias | Owned by: | Stan |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 24 |
Component: | Core engine | Keywords: | |
Cc: | Patch: | Phab:D1511, Phab:D613 |
Description
Placing a .zip file with a "zip file comment" below the $0AD-HOME/binaries/data/mods/public
folder (so the pyrogenesis engine will scan it) causes a startup assertion to fire on all of my machines. On Windows, it said "(error while formatting error message)" while on Linux and FreeBSD it reports an assertion in archive_zip@500
has tripped.
The attached test.zip file trips the problem on my machines when placed e.g. in $0AD-HOME/binaries/data/mods/public/simulation/ai
, and was built using the buildzipwithcomment.sh
file inside that archive.
Note: The actual zip command was created using the zipnote
utility. The tool crashed on both Linux and FreeBSD for me, so I fetched the source from ftp://ftp.info-zip.org/pub/infozip/src/zip30.tgz and debugged into it. It seems that the fclose(x);
instruction in zipnote.c:666 is trying to close a file already closed in zipnote.c:552, and my stdlibs seem unforgiving to it. So I patched the zipnote.c
and used that to create the comment. That's why the buildzipwithcomment.sh
explicitly calls ./zipnote
(I actually encountered this problem during AI breeding as the jasmine archive is a commented zip file, and destilled it down to the test.zip)
Attachments (1)
Change History (10)
by , 6 years ago
comment:2 by , 6 years ago
Milestone: | Alpha 24 → Backlog |
---|
comment:3 by , 6 years ago
Milestone: | Backlog → Alpha 24 |
---|---|
Owner: | set to |
Patch: | → Phab:D1511 |
comment:4 by , 6 years ago
Fix has been put into Phabricator including description of problem cause and solution.
comment:5 by , 6 years ago
Updated Phabricator item. The test.zip in Phab:D1511 now has been stripped from the zipnote.c sources to reduce the file size to a minimum.
On the trac ticket, I keep the original test.zip in place since the zipnote problem is independent of 0AD and the patch inside the .zip might be of help to somebody.
(Doubled fclose(x) is undefined behavior and may have worked in the past, but modern runtimes are likely to be less forgiving).
comment:6 by , 4 years ago
Owner: | removed |
---|
comment:7 by , 3 years ago
Patch: | Phab:D1511 → Phab:D1511, Phab:D613 |
---|
I just realised this is the issue I have been experiencing every time I install a mod now...
Test archive with a comment, trips assertion archive_zip.cpp@500 and contains patched zipnote.c