-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Crash when using along other GDExtensions #127
Comments
I managed to get a backtrace using gdb.
Here is one I compiled myself
Edit2: I'll try again to compile webrtc-native and see if that changes anything. Maybe it's really a glibc related issue. |
I've also been running into this issue, on Arch. Compiling it myself hasn't fixed it, I still get a bad cast error whenever initializing a WebRTCPeerConnection. Have you had any other luck? |
Not yet, but it's good to know that other people have the same issue. I'm planning on booting a live USB (maybe ubuntu, just to check another distro) and see what happens. I tried rolling back several packages (including the kernel itself). No luck. I did not try however to rollback glibc (didn't want to break stuff...). So maybe that is. I'll investigate further. For now I am happy that it's not some freak issue on my end but might be related to something Arch. |
Just tested Manjaro KDE Plasma (23.0.4) from a live USB. Same symptoms, same crash. Trying Ubuntu 22.04.3 now. Just for reference but I think we can rule that one out now: So next layer up seems to be plog or libdatachannel... I just don't understand why it would suddenly not work anymore... |
Okay, I made some progress. Using Godot 4.1.3(.stable.offical) does NOT crash on Linux. I'll try some beta builds and RCs to see when the problems started. Edit: The story is a bit different now. All official builds from godotengine.org work. 4.1.3 up until 4.2.1 stable. Inluding all Dev and Beta builds work without isues. But, from 4.2 onwards, the Arch Build is labelled "4.1.3.stable.arch_linux", instead of "stable.official". These .arch_linux builds, as well as my self-compiled version (on an arch based distro) crashes.... @Na-r can you try the official builds? You can download them from godotengine.org. Something seems to be up with the repositories version. Edit2: So short recap, these work:
These do NOT work for me:
|
Dang, I've only used official builds so far and have been getting the crashes. I'm going to try testing it on a self-compiled version now. I'll leave the backtrace of my latest attempt here, but it seems to be identical to what you were having on the arch repo versions.
Edit: Still getting the same crash at |
So it's not that... just to check: What Kernel are you on? What GLIBC Version? ( As stated above, GLIBC is 2.38 and Kernel is 6.6.7-4 (though I tried others before, there has been a patch yesterday(?) or a a few days ago). Edit: Come to think of it: While trying 4.1 I had to downgrade the project (and then upgrade when testing 4.2 versions again). Maybe that changed something? My git shows no real change in the project.godot file however... Edit2: Resetting my project ( |
@Na-r wild guess... but what other GDExtensions are you using? It seems removing WWise (https://github.com/alessandrofama/wwise-godot-integration) fixes the crash for me This doesn't make any sense since the demo project also crashed for me... I don't see any real pattern here Edit: Especially since it worked before... but removing the WWise addon gets the WebRTC Connection going again... What's especially weird, pasting in the addon but not enabling it, still leads to a crash... Feels like a Godot GDExtension Problem Edit: More insight thanks to a discussion on the german godot discord (thanks whiteshampoo). This in and of itself is weird and unexpected, but further I don't understand how that would cause WebRTC do crash... |
GLIBC: Whelp, that seems to be it. I'm using a VOIP GDExtension I wrote, and disabling it makes the WebRTC not fail anymore. This definitely seems to be the issue. It looks like it's a core GDExtension bug though, since there really shouldn't be crosstalk between these extensions from what I understand. |
Yes. I'm currently debugging an issue with the wwise plugin where it gets called even when disabled... I wonder if this and the general issue here are related to the somewhat new hot-reload feature... Edit: I believe I got my issue (WWise Autoload being created) figured out. But for the issue at hand (multiple GDExtensions having problems), I still want to create a test-case. I wonder if it has to do with the order of GDExtension (i.e. if webrtc is loaded before voip or after (or wwise respectively)). But I don't think it makes a difference. It's weird that wwise works without issues though, so maybe just the webrtc extension has issues... |
Confirmed an issue even when using a minimal GDExtension (using the official tutorial). WebRTC connection crashes the game... So it seems to be an issue with Linux + multiple GDExtensions. |
A new insight when only using the WebRTC-Native GDExtension: it works when using my own compiled version of godot (4.2.1-stable tag) or the official godotengine.org build. It does NOT work when using the arch repository provided build... I'm starting to wonder if its actually a Godot Core GDExtension issue or something only affecting the webrtc native gdextension |
I have confirmed the crash, using the released WebRTC plugin and the test extension in godot-cpp. One thing I noticed is that if I change the load order in
to:
i.e. I make the the WebRTC extension load first. Then it seems to work fine. I've noticed the same thing happens in Godot |
I've traced it to this: diff --git a/SConstruct b/SConstruct
index 6e9e094..80febb0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -126,7 +126,7 @@ if env["platform"] == "linux":
LINKFLAGS=[
"-Wl,--no-undefined",
"-static-libgcc",
- "-static-libstdc++",
+ #"-static-libstdc++",
]
)
# And add some linux dependencies. i.e. the |
Interesting, changing the order might be the reason why it first worked for me (WebRTC + Wwise) but suddenly (after some git push/pull using a a windows client) the order might have changed, resulting in the issue. |
Attaching a MRP that shows the crash (includes the webrtc library and the godot-cpp library). |
Do you think it is an Godot Core issue or an WebRTC GDExtension issue? From what I can see this is where the GDExtension gets loaded: And here is the corresponding implementation: On the top of this file are some definitions on how to load these libraries: And according to this post on StackOverflow depending on the settings used some functions could override others? I'll try to compile godot with some other settings later today, to see if that changes anything. |
I mentioned this to @Faless on Rocket Chat already, but this is likely the same issue as godot-jolt/godot-jolt#373. Basically, compiling with The way I resolved this was by providing LD with a version script, through the
|
So if I understand that correctly, the
Edit: Or is this the reverse situtation? |
Without having actually tried it, I get the impression that this wouldn't fix the problem, since it's not really an ordering problem and more of a problem with the symbols being available to other libraries in the first place. With that said, when looking at the other
It sounds like adding EDIT: Maybe |
For me, but that is just a feeling, the "neither" corresponds to Again, later today I'll try to build godot with different flags to see what happens. |
Okay, I tried several variations of RTLD_DEEPBIND, RTLD_GLOBAL, RTLD_LOCAL etc. The default (on my custom Godot build) seems to be 0xA (RTLD_LOCAL | RTLD_DEEPBIND | RTLD_NOW). Which seems reasonable and what I would think would be the correct settings. Apart from only exporting the I also thought about just loading the entry_symbol and ignoring all other symbols from the library, but there doesn't seem to be something like this. It's either all exported symbols or nothing. Correct me if I am wrong, not super experienced with this stuff. |
Just dumping some more interesting findings: A lenghty explanation of what happens when linking libraries with same symbols: https://stackoverflow.com/questions/22004131/is-there-symbol-conflict-when-loading-two-shared-libraries-with-a-same-symbol A possible solution is also provided: https://stackoverflow.com/a/70673863 (linking to https://gcc.gnu.org/wiki/Visibility)
Of course assuming this is the root problem here and I am not too deep into trying to fix stuff in the wrong place :) |
Running into this issue as well with WebRTC + GodotSteam (see the mention just above this comment). Somewhat interestingly, I am only getting the crash when initializing the WebRTCPeerConnection with a stun server. Changing the load order as per Faless' comment did also prevent the crash. It's a good workaround, albeit in the long run users shouldn't need to manually touch |
@Sch1nken As noted in your quote there, I believe @Faless has already verified that the version script method that I used for Godot Jolt fixes the issue for this extension as well, so that's at least one confirmed fix. It would be nice if there was some way of fixing this from the Godot side of things though. |
Reopening until we release the updated version. |
Note that after releasing I've now released v1.0.5, and updated (again) the asset library entries (which will need some time to be approved). |
Have you actually verified that this crash occurs on Windows? I was under the impression that this problem had to do with Linux' dynamic linker rather than |
That's a very good point, I was lazy 😅 , and I only verified the crash from Linux using I will check on native Windows too. |
Iirc native windows was fine. I temporarily moved to a windows machine to continue development when I first had the issue. |
Godot version
4.2.stable.arch_linux
Plugin version
1.0.3
System information
Manjaro Laptop, AMD 4800H APU
Issue description
Heya, this is a short in the dark since the underlying issue is not fully understood yet (and there are other candidates for this issue, I'm currently investigating and just wanted to see if someone else has a similiar issue).
So since one or two days ago I've had this issue where both my game instances (here: server and client) can't establish a connection over webrtc but instead they silently crash (windows close, no error message). The only thing I get in the terminal is:
which could be anything (or rather anywhere) since there is no stack-trace.
Everything worked fine only ~48hours ago. Coincidentally, I did a system upgrade around the time it stopped working (pretty sure some package has some issues). The current manjaro update DOES have some issues (a lot of people reporting issues in their forums), but for me it's been smooth sailing apart from this one Godot WebRTC problem.
Quick overview:
I am strongly suspecting an issue with a system package or something similiar, BUT every other single game or app is working fine. I've tried a bunch, no issues there. This is why I'm reaching out to check if someone else has similiar issues.
I'm using my own project (with two instances), but the provided minimal example show the same behaviour. I already tried redownloading the libs and replacing them in the project.
Other devices in my LAN work without issues (those are windows though). So I don't think it's some weird NAT issue or similiar.
Steps to reproduce
Minimal reproduction project
https://github.com/godotengine/godot-demo-projects/tree/master/networking/webrtc_signaling
Either with an external server or a local one ("in-game"). Doesn't really matter.
The text was updated successfully, but these errors were encountered: