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 after exporting .pck with non-server binary #34433

Closed
shintiger opened this issue Dec 18, 2019 · 10 comments · Fixed by #35113
Closed

Segmentation fault after exporting .pck with non-server binary #34433

shintiger opened this issue Dec 18, 2019 · 10 comments · Fixed by #35113
Assignees
Milestone

Comments

@shintiger
Copy link

Godot version:
3.1.2-stable (custom build with module spine)

OS/device including version:
macOS

Issue description:

output:
savepack: begin: Packing steps: 102
....
savepack: end
Segmentation fault: 11

I got the .pck at the end, but when put it next to binary(platform=server) got the error:
Error: Could not load game data at path '.'. Is the .pck file missing?

Steps to reproduce:
godot --path <path_to_project> --export "Linux/X11" data.pck

Minimal reproduction project:
export_presets:

[preset.4]

name="Linux/X11"
platform="Linux/X11"
runnable=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

[preset.4.options]

texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/64_bits=true
custom_template/release=""
custom_template/debug=""

@shintiger
Copy link
Author

shintiger commented Dec 20, 2019

full output

savepack: begin: Packing steps: 102
	savepack: step 2: Storing File: res://Lobby.gdc
	savepack: step 6: Storing File: res://Lobby.tscn
	savepack: step 10: Storing File: res://Main.gdc
	savepack: step 15: Storing File: res://Main.tscn
	savepack: step 19: Storing File: res://.import/1024x1024.png-8886b36c0e514183090c6599e7cde11b.stex
	savepack: step 19: Storing File: res://assets/icon/1024x1024.png.import
	savepack: step 23: Storing File: res://.import/1024x768.png-285875537c6f24a0c374e1db4d87ea4c.stex
	savepack: step 23: Storing File: res://assets/icon/1024x768.png.import
	savepack: step 28: Storing File: res://.import/120x120.png-1c7749a83a7cf5f7f4152603e1f9e2f8.stex
	savepack: step 28: Storing File: res://assets/icon/120x120.png.import
	savepack: step 32: Storing File: res://.import/2048x1536.jpg-3e753d671bafad70319bbb71e06c0987.stex
	savepack: step 32: Storing File: res://assets/icon/2048x1536.jpg.import
	savepack: step 36: Storing File: res://.import/2048x1536.png-e51d8dfe2d392f8b4efc2e6bcd8d3738.stex
	savepack: step 36: Storing File: res://assets/icon/2048x1536.png.import
	savepack: step 41: Storing File: res://.import/2208x1242.png-6d627c7017ab0cedeef5cd1f51e6620b.stex
	savepack: step 41: Storing File: res://assets/icon/2208x1242.png.import
	savepack: step 45: Storing File: res://.import/2436x1125.png-cd95145f351af18422e9f9a408d16eb0.stex
	savepack: step 45: Storing File: res://assets/icon/2436x1125.png.import
	savepack: step 49: Storing File: res://.import/76x76.png-afd4bebd1717846034bc2199d8400f3a.stex
	savepack: step 49: Storing File: res://assets/icon/76x76.png.import
	savepack: step 54: Storing File: res://.import/icon.png-a4526fa92b2aba1f7632c2adbeba4a08.stex
	savepack: step 54: Storing File: res://assets/icon/icon.png.import
	savepack: step 58: Storing File: res://assets/spineboy/spineboy.atlas
	savepack: step 62: Storing File: res://assets/spineboy/spineboy.json
	savepack: step 67: Storing File: res://.import/spineboy.png-436dbd6da2b707b6828ede17b7871f43.stex
	savepack: step 67: Storing File: res://assets/spineboy/spineboy.png.import
	savepack: step 71: Storing File: res://client/Control2.gdc
	savepack: step 75: Storing File: res://client/Control2.tscn
	savepack: step 80: Storing File: res://client/Main2.tscn
	savepack: step 84: Storing File: res://client/Player.gdc
	savepack: step 88: Storing File: res://default_env.tres
	savepack: step 93: Storing File: res://server/server.gdc
	savepack: step 97: Storing File: res://server/server.tscn
	savepack: step 102: Storing File: res://Lobby.gd.remap
	savepack: step 102: Storing File: res://Main.gd.remap
	savepack: step 102: Storing File: res://client/Control2.gd.remap
	savepack: step 102: Storing File: res://client/Player.gd.remap
	savepack: step 102: Storing File: res://server/server.gd.remap
	savepack: step 102: Storing File: res://assets/icon/icon.png
	savepack: step 102: Storing File: res://project.binary
savepack: end
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] 1   libsystem_platform.dylib            0x00007fff7dab3b5d _sigtramp + 29
[2] 2   ???                                 0x000000010f421080 0x0 + 4550955136
[3] EditorResourcePreview::_generate_preview(Ref<ImageTexture>&, Ref<ImageTexture>&, EditorResourcePreview::QueueItem const&, String const&) (in godot.osx.opt.tools.64) (reference.h:112)
[4] EditorResourcePreview::_thread() (in godot.osx.opt.tools.64) (reference.h:207)
[5] ThreadPosix::thread_callback(void*) (in godot.osx.opt.tools.64) (thread_posix.cpp:76)
[6] 6   libsystem_pthread.dylib             0x00007fff7dabc2eb _pthread_body + 126
[7] 7   libsystem_pthread.dylib             0x00007fff7dabf249 _pthread_start + 66
[8] 8   libsystem_pthread.dylib             0x00007fff7dabb40d thread_start + 13
-- END OF BACKTRACE --

@akien-mga
Copy link
Member

Note: You can use:

```
code
```

markup for preformatted text, instead of using quote (>) markup.

@akien-mga
Copy link
Member

akien-mga commented Dec 20, 2019

I can't reproduce the issue on Linux with https://downloads.tuxfamily.org/godotengine/3.1.2/Godot_v3.1.2-stable_x11.64.zip nor https://downloads.tuxfamily.org/godotengine/3.1.2/Godot_v3.1.2-stable_linux_headless.64.zip

Using:

~/Projects/godot/stable/3.1/Godot_v3.1.2-stable_linux_headless.64 --path ../bring-out-your-dead/ --export "Linux/X11" data.pck

I do get an error message though at the end that could be related to your issue:

ERROR: ~List: Condition ' _first != __null ' is true.
   At: ./core/self_list.h:111.
ERROR: cleanup: There are still MemoryPool allocs in use at exit!
   At: core/pool_vector.cpp:70.

I got the .pck at the end, but when put it next to binary(platform=server) got the error:
Error: Could not load game data at path '.'. Is the .pck file missing?

Your pck file should have the same basename as the binary you use to run it if you want it to be auto-loaded. Alternatively you can pass --main-pack data.pck to the command line.

@akien-mga akien-mga added this to the 3.1 milestone Dec 20, 2019
@akien-mga
Copy link
Member

akien-mga commented Dec 20, 2019

Do you reproduce the issue with 3.1.2-stable without custom module (official build)?
What about and 3.1.1-stable and 3.2 beta 4?

@akien-mga akien-mga self-assigned this Dec 20, 2019
@akien-mga
Copy link
Member

Might be related to #34148.

@shintiger
Copy link
Author

You take me there, I got it works with print("Hello world") now but remain some points.

  1. I miss the --main-pack option/exact same basename, because everywhere show me data.pck is the convention.
  2. Error stack only appear when presets didn't defined
  3. savepack: end >> Segmentation fault: 11 is still exists, is there potential problem?
  4. p=server version will produce error if I use some spine (unofficial) object on the scene, I guess this should related to spine module

@akien-mga
Copy link
Member

  1. I miss the --main-pack option/exact same basename, because everywhere show me data.pck is the convention.

That was before Godot 3.0, since Godot 3.0 the .pck is supposed to have the same basename as the binary that runs it.

  1. Error stack only appear when presets didn't defined

What do you mean exactly?

  1. savepack: end >> Segmentation fault: 11 is still exists, is there potential problem?

Yes, that's what this bug report should be about. Could you test with the various versions I mentioned at #34433 (comment) to see if they all have the same segmentation fault, or if it's specific to 3.1.2 or the spline module?

  1. p=server version will produce error if I use some spine (unofficial) object on the scene, I guess this should related to spine module

That's probably related to the Spine module yes.

@shintiger
Copy link
Author

What do you mean exactly?

I have the Program crashed with signal 11 and backtrace when given --export "not defined preset" only, when I export with right presets, it give Segmentation fault: 11 and end process immediately.

Yes, that's what this bug report should be about. Could you test with the various versions I mentioned at #34433 (comment) to see if they all have the same segmentation fault, or if it's specific to 3.1.2 or the spline module?

https://godotengine.org/download/osx
I have tried with standard 3.1.2 above, got simular error with my project

savepack: begin: Packing steps: 102
	savepack: step 2: Storing File: res://Lobby.gdc
	savepack: step 6: Storing File: res://Lobby.tscn
	savepack: step 11: Storing File: res://Main.gdc
	savepack: step 16: Storing File: res://Main.tscn
	savepack: step 21: Storing File: res://.import/1024x1024.png-8886b36c0e514183090c6599e7cde11b.stex
	savepack: step 21: Storing File: res://assets/icon/1024x1024.png.import
	savepack: step 25: Storing File: res://.import/1024x768.png-285875537c6f24a0c374e1db4d87ea4c.stex
	savepack: step 25: Storing File: res://assets/icon/1024x768.png.import
	savepack: step 30: Storing File: res://.import/120x120.png-1c7749a83a7cf5f7f4152603e1f9e2f8.stex
	savepack: step 30: Storing File: res://assets/icon/120x120.png.import
	savepack: step 35: Storing File: res://.import/2048x1536.jpg-3e753d671bafad70319bbb71e06c0987.stex
	savepack: step 35: Storing File: res://assets/icon/2048x1536.jpg.import
	savepack: step 40: Storing File: res://.import/2048x1536.png-e51d8dfe2d392f8b4efc2e6bcd8d3738.stex
	savepack: step 40: Storing File: res://assets/icon/2048x1536.png.import
	savepack: step 44: Storing File: res://.import/2208x1242.png-6d627c7017ab0cedeef5cd1f51e6620b.stex
	savepack: step 44: Storing File: res://assets/icon/2208x1242.png.import
	savepack: step 49: Storing File: res://.import/2436x1125.png-cd95145f351af18422e9f9a408d16eb0.stex
	savepack: step 49: Storing File: res://assets/icon/2436x1125.png.import
	savepack: step 54: Storing File: res://.import/76x76.png-afd4bebd1717846034bc2199d8400f3a.stex
	savepack: step 54: Storing File: res://assets/icon/76x76.png.import
	savepack: step 59: Storing File: res://.import/icon.png-a4526fa92b2aba1f7632c2adbeba4a08.stex
	savepack: step 59: Storing File: res://assets/icon/icon.png.import
	savepack: step 63: Storing File: res://.import/spineboy.png-436dbd6da2b707b6828ede17b7871f43.stex
	savepack: step 63: Storing File: res://assets/spineboy/spineboy.png.import
	savepack: step 68: Storing File: res://client/Control2.gdc
	savepack: step 73: Storing File: res://client/Control2.tscn
	savepack: step 78: Storing File: res://client/Main2.tscn
	savepack: step 82: Storing File: res://client/Player.gdc
	savepack: step 87: Storing File: res://default_env.tres
	savepack: step 92: Storing File: res://server/server.gdc
	savepack: step 97: Storing File: res://server/server.tscn
	savepack: step 102: Storing File: res://Lobby.gd.remap
	savepack: step 102: Storing File: res://Main.gd.remap
	savepack: step 102: Storing File: res://client/Control2.gd.remap
	savepack: step 102: Storing File: res://client/Player.gd.remap
	savepack: step 102: Storing File: res://server/server.gd.remap
	savepack: step 102: Storing File: res://assets/icon/icon.png
	savepack: step 102: Storing File: res://project.binary
savepack: end
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] 1   libsystem_platform.dylib            0x00007fff7dab3b5d _sigtramp + 29
[2] 2   ???                                 0x0000000000000100 0x0 + 256
[3] EditorResourcePreview::_generate_preview(Ref<ImageTexture>&, Ref<ImageTexture>&, EditorResourcePreview::QueueItem const&, String const&) (in Godot) + 1610
[4] EditorResourcePreview::_thread() (in Godot) + 3083
[5] ThreadPosix::thread_callback(void*) (in Godot) + 85
[6] 6   libsystem_pthread.dylib             0x00007fff7dabc2eb _pthread_body + 126
[7] 7   libsystem_pthread.dylib             0x00007fff7dabf249 _pthread_start + 66
[8] 8   libsystem_pthread.dylib             0x00007fff7dabb40d thread_start + 13
-- END OF BACKTRACE --
Abort trap: 6

I attached the project
godot.zip

@akien-mga
Copy link
Member

akien-mga commented Dec 20, 2019

I attached the project
godot.zip

That was it, I can reproduce the crash with this project on Linux with the current master branch (48edf63):

Thread 12 "godot-git" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc1ca4700 (LWP 3448)]
0x00000000014f2b58 in Object::get_class_name (this=0x0) at ./core/object.h:646
646                     if (!_class_ptr) {
(gdb) bt
#0  0x00000000014f2b58 in Object::get_class_name (this=0x0) at ./core/object.h:646
#1  0x0000000002afec7d in Control::get_icon (this=0x0, p_name=..., p_type=...) at scene/gui/control.cpp:822
#2  0x00000000021d8500 in EditorResourcePreview::_generate_preview (this=0x6fc9eb0, r_texture=..., r_small_texture=..., p_item=..., cache_base=...) at editor/editor_resource_preview.cpp:171
#3  0x00000000021d9612 in EditorResourcePreview::_thread (this=0x6fc9eb0) at editor/editor_resource_preview.cpp:270
#4  0x00000000021d7c1a in EditorResourcePreview::_thread_func (ud=0x6fc9eb0) at editor/editor_resource_preview.cpp:107
#5  0x0000000001f10529 in ThreadPosix::thread_callback (userdata=0xae19c90) at drivers/unix/thread_posix.cpp:74
#6  0x00007ffff7c4604c in start_thread () from /lib64/libpthread.so.0
#7  0x00007ffff788e58f in clone () from /lib64/libc.so.6

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Dec 20, 2019
@shintiger
Copy link
Author

Is there workaround to avoid crash with 3.1.2-stable?

@akien-mga akien-mga changed the title segmentation fault after build pck Segmentation fault after exporting .pck with non-server binary Jan 14, 2020
akien-mga added a commit to akien-mga/godot that referenced this issue Jan 14, 2020
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