Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when exiting from running a ZIP file. #49012

Closed
efornara opened this issue May 23, 2021 · 2 comments · Fixed by #49013
Closed

Segmentation fault when exiting from running a ZIP file. #49012

efornara opened this issue May 23, 2021 · 2 comments · Fixed by #49013

Comments

@efornara
Copy link
Contributor

efornara commented May 23, 2021

Godot version: 3.3.1-stable

OS/device including version: Linux debian/buster, 64 bits

Issue description: Segmentation fault when exiting a game exported as a ZIP.

Steps to reproduce:

Run the official x11 export template (or the editor) with a ZIP pack:

linux_x11_64_debug --main-pack 32_2d_platformer.zip

Exit the game. You should get a segmentation fault.

I didn't get any useful backtrace from the official build:

Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x37840) [0x7f0ccdaf9840] (??:0)
[2] Godot_v3.3.1-stable_x11.64() [0xccac27] (??:0)
[3] Godot_v3.3.1-stable_x11.64() [0xccb752] (??:0)
[4] Godot_v3.3.1-stable_x11.64() [0x310d14f] (??:?)
[5] Godot_v3.3.1-stable_x11.64() [0x98e3e1] (??:0)
[6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f0ccdae609b] (??:0)
[7] Godot_v3.3.1-stable_x11.64() [0x99cb9e] (??:0)
-- END OF BACKTRACE --
Aborted

but my build of the official source (x11 platform) points to ZipArchive::~ZipArchive.

Minimal reproduction project: I tried 32_2d_platformer.zip from (the standard 2D platformer ported to GLES2) from here: https://sourceforge.net/projects/frt/files/demos/ but I suspect that any project exported as a ZIP would do.

@akien-mga
Copy link
Member

Probably related to #42337, cc @zaevi.

@zaevi
Copy link
Contributor

zaevi commented May 24, 2021

ZipArchive::~ZipArchive() {
for (int i = 0; i < packages.size(); i++) {
FileAccess *f = (FileAccess *)unzGetOpaque(packages[i].zfile);
unzClose(packages[i].zfile);
memdelete(f);
}
packages.clear();
}

Yes, after #42337 was fixed, the implementation here seems close file twice, which throws the fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants