-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
server/headless: pure virtual method called with --gdnative-generate-json-api #36582
Comments
Could be caused by #36367 but it does really look like that from the stack trace. The PR removes driver/dummy/audio_driver_dummy.h which isn't being used anywhere. The stack trace points to servers/audio/audio_driver_dummy.h instead |
@IronicallySerious that PR is not in 3.2-stable, so it's something else. |
There is a AudioDriverDummy declared in static initialization as part of AudioDriverManager in servers/audio_server.h: The init function is called from:
The destructor is called from:
Hence, this pure virtual function call is a use-after-free caused by the thread continuing to run during the C++ static destruction phase. Because I am able to avert this crash with the following workaround:
However, I do not wish to submit this as a PR, as this goes against the existing style for servers, where deallocation of resources is done inside ::finish() rather than the destructor. It is also generally frowned upon to do cleanup of static objects in the destructor because the order is unspecified and may differ across machines or platforms. |
There's already code in godot/servers/audio_server.cpp Lines 1072 to 1076 in ac44657
So not sure while it's not called/not sufficient here. |
Seems the destructor of AudioDriverDummy is beeing called before this. As @lyuma it's being destroyed when static objects are deleted Maybe dummy_driver is should be an singleton and non static? |
I made dummy_driver a static pointer to have control of his destruction |
Can anyone still reproduce this bug in Godot 3.2.3 or any later release? |
@KoBeWi Yes, I'm on a custom build |
Looks like also reported more recently in #43953 |
Just tested @kuruk-mm's fix and while it does fix the virtual function crash the command does not seem to generate anything. Instead it simply runs godot. Output: ./bin/godot_server.osx.opt.debug.64 --gdnative-generate-json-api api.json
Godot Engine v3.2.4.beta.custom_build.1f5bf8551 - https://godotengine.org
Running outside of a directory with a project file produces this:
Is Edit: Seems |
This still seems to be a problem for Godot versions We discovered the issue during CI pipelines based on GitHub Actions, which use the headless version of Godot. The pure virtual method call occurs only sporadically, but this makes each CI run non-deterministic. |
This was fixed by #48081. |
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
833: Feature flag for custom Godot version r=Bromeon a=Bromeon Enables the use of custom Godot builds in a straightforward way. This includes older versions such as Godot 3.2, for which `api.json` is no longer shipped along. Previous process (see also [book](https://godot-rust.github.io/book/advanced-guides/custom-godot.html)): * create a local copy of godot-rust * Run `godot --gdnative-generate-json-api` * replace `api.json` inside `gdnative-binding` New process: * enable feature `custom-godot` * make sure `godot` executable is in path **OR** set `GODOT_BIN` env var * done This supersedes the previous `bindings` feature, which is now removed. I also added CI support for previous Godot version 3.3.1, so far only for integration tests. Originally I wanted to use Godot 3.2 (the oldest supported version), however godotengine/godot#36582 prevented headless versions from generating `api.json` reliably without crashing. This has been fixed for versions >= 3.3.1. There is still testing to be done; feedback is always appreciated! 🙂 Closes #640. Thanks for the great ideas in that issue. Co-authored-by: Jan Haller <bromeon@gmail.com>
Godot version:
3.2-stable
OS/device including version:
Linux
$ lsb_release -r
Release: 18.04
$ uname -a
Linux server 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Issue description:
Running a platform=server build with --gdnative-generate-json-api results in a "pure virtual method called" segfault in AudioDriverDummy::thread_func()
GDB stacktrace:
Steps to reproduce:
Minimal reproduction project:
N/A
The text was updated successfully, but these errors were encountered: