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
SDL2 version crashes on start with "arguments to dbus_connection_unref() were incorrect" #91
Comments
|
Are you sure that going back to version 0.2.3 works? On same system, you are not running as root, same mupen64plus etc.? |
|
Going back to 0.2.3 does work on the same system in the same conditions. The only difference is that it was packaged 6 months ago - I'll try building 0.2.3 anew with the same setup as 0.2.4 and see how it goes. |
|
Rebuilt 0.2.3 and tried it, it still works fine. The log is quite similar, so the missing Glide64mk2 is another issue as it does not prevent startup (I might need to fix my mupen64plus package?): |
|
python2 vs python3 issue maybe? Check also version of dbus-python, I have no idea what else can be a issue. Try to start it as root, then it should print a warning that it can't connect to dbus session, so it should not try to use it. |
|
It does work as root since the DBus session is not used indeed. I build m64py with python3 and have dbus-python 1.2.4. |
|
For the reference, my spec file: It did not change significantly since 0.2.3, apart from adding python3-sdl2 as dependency (PySDL2). |
|
I'll see if I can bisect the issue. |
|
This is a part of code that use dbus on Linux to enable/disable screensaver https://github.com/mupen64plus/mupen64plus-ui-python/blob/master/src/m64py/screensaver.py#L24 . Nothing changed there for 2 years. |
|
A bisect gave 68e6f39 as first bad commit. Maybe 0.2.3 used to default to SDL1 on my system? IIUC it has some autodetect logic, right? |
|
I confirm that 0.2.3 gives the same error when started with Libraries:
|
|
SDL2 internaly use dbus on Linux but doesn't link to libdbus, instead it loads libdbus-1.so.3 https://hg.libsdl.org/SDL/file/e854440318d2/src/core/linux/SDL_dbus.c , so you can check that. |
|
And now, without SDL1, frontend can just call https://wiki.libsdl.org/SDL_DisableScreenSaver , no need for screensaver.py at all. |
|
I am getting the same problem in Fedora 25 |
|
Doesn't look like exactly the same error. You have this |
|
Can you try to comment in screensaver.py everything related to dbus? Just to confirm who is throwing that error, python-dbus or SDL2->dbus. |
|
Sorry that was just becuse I didn't have libmupen64plus.so in the right spot, I fixed that. I commented out everything in the dbus error still happened |
|
"hello" was printed to the screen, so I know that code executed |
|
Ok, thanks. So if m64py doesn't touch dbus anymore then it must be SDL2 fault. Please also remove import dbus line, just to be sure. I have SDL2 version 2.0.5 and dbus 1.10.14 and it works ok. |
|
The import line was removed for my first test. I'll do some more testing and see if I can figure out a solution |
|
I'm on Fedora 25, I also have SDL2 2.0.5, but the dbus version is 1.11.8 (PySDL2 installed from pip, so I assume it's the latest version). EDIT: I filed a bug with SDL2 https://bugzilla.libsdl.org/show_bug.cgi?id=3580, maybe they will be able to fix it |
|
I haven't really tracked down what is causing this, but I get this same message in Ubuntu 16.04. Although in Fedora 25, m64py closes instantly, in Ubuntu 16.04 m64py stays open and it works, but I get a ton of these dbus error messages in the terminal while it's running |
|
Using Manjaro with the same problem. |
|
I have the same problem on Manjaro as well. As an exercise I attempted to dig into it a little, but I admit that I am swimming in deep water and have yet to discover the cause (I am learning a lot though!) However, in troubleshooting I did discover a workaround. If you rebuild/reinstall dbus and make sure the following options are passed to configure, the error goes away: --disable-asserts I don't know how much this information is worth, or what the possible consequences are of setting these options, but it's working for me currently. I don't really know what to do next but if anyone has any suggestions, or would like me to test something etc., I would be glad to help. |
|
That is some clue. On Gentoo dbus is always built with --disable-asserts --disable-checks , so I never had that problem. Question is if this something that is enabled/forced on some distros since recently or they had that before and only now something (PySDL, PyQt, SDL) is triggering it. |
They had it before. At least in Mageia nothing changed packaging-wise for dbus, and given the number of reports from other distros, it can't be a coincidence, so the issue is triggered by one of the new dependencies in 0.2.4 IMO. |
|
There are no new dependencies in 0.2.4, PySDL2 is just unbundled from m64py source and must be installed now. I also tried with old PySDL2 sources on Fedora that were bundled and it doesn't help. |
|
I know, but as I diagnosed above already, before 0.2.4 the issue only happened when forcing the use of SDL2. I'd make an educated guess that all users of distros reporting 0.2.4 as not working were using the SDL1 flavour previously. So by "new dependency", I mean the fact that as per 0.2.4 everybody is using SDL2, while previously the autodetect was most of the time landing on SDL1. So the issue needs to be investigated around SDL2, PySDL2 or related dependencies: #91 (comment) To be clearer, the issue did not start with the unbundling of SDL2. It started with the removal of the SDL1 alternative. |
|
I just recompiled my system dbus without --disable-asserts --disable-checks (modified ebuild) and it still works. Can someone try to remove SDL2 system lib and compile a new one from hg or latest tarball? |
|
Any update for the average user? |
|
Hey, I haven't tried mupen64, but I'm one of the SDL developers, and we're trying to get a reproduction case for this issue. Can anyone seeing this get a backtrace from the error so we can see where this happens? We aren't sure if it's an SDL bug, an incompatibility between D-Bus versions, bad luck, etc. |
|
Hi, I just tried to get backtrace in Fedora but nothing is reported. This only happens in python frontend, with PySDL2 bindings. Simple test like this one https://stackoverflow.com/questions/41452558/d-bus-related-runtime-crash-when-trying-to-open-sdl2-window where someone experienced same error works though. On Ubuntu it just print errors, but doesn't crash, on Fedora and Arch it crashes and on Gentoo it just works (even after recompiling dbus without --disable-asserts --disable-checks). |
|
@rcgordon For the record, I don't really know this all plays together (dbus, SDL, etc.). On Manjaro in order to enable backtraces, I have to rebuild dbus with --enable-asserts, and this is what I get when launching m64py. Let me know if I can help in any way. |
|
The last line of Python code that gets executed before the crash: mainwindow_ui.py(29): self.menubar = QtWidgets.QMenuBar(MainWindow)The problem can be circumvented by compiling Qt without dbus support ( |
|
same problem in manjaro |
|
Experiencing the same issue on Debian Sid. |
|
fwiw, we fixed a similar D-Bus thing in SDL, so upgrading to SDL 2.0.8 might help, but @zadeluca's callstack suggest this isn't an SDL issue at all. |
|
I am currently using 2.0.8... so I'm guessing @zadeluca is right. |
|
Just tried V 0.2.5 and I stumbled upon this. I found a workaround, which is to run m64py as: You'll still get the message but the app will start and work fine as far as I can tell. Hope it helps :). |
|
@SukkoPera Can you try to set ENV in the main m64py file, before try/except block that imports Just add one line in file and test: |
|
@gen2brain Yep, that works just as well! |
I just updated Mageia's m64py package to the new version 0.2.4, after packaging PySDL2 0.9.5. On startup I get a DBus-related error and it crashes.
Going back to version 0.2.3 works fine.
The text was updated successfully, but these errors were encountered: