-
Notifications
You must be signed in to change notification settings - Fork 479
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
multicore-sys-monitor@ccadeptic23 using old Network Manager library causing crashes #1616
Comments
I guess the following would work (although I am not a JS programmer and have no way to test this on non-Fedora systems without lots of effort). I haven't tested this code at all, but I think the concept is solid. Replace the two Network Manager imports with the following:
Then |
Thanks for pointing this out to me. I was assuming the new NM typelib was a new library since it has different namespaces - I'm guessing there isn't a way to load the old typelib on the same system. In your example you have the right idea. |
But the variables that are |
I won't be able to PR this for at least a week, but if you're able to test on Mint 18.3 in a VM, feel free to open a PR. |
So I tried these changes in my fork: coderforlife@0dec5ee It works in Fedora but causes Cinnamon in Mint 18.3 to freeze. Looking at the
In When I look in the Do you have any other ideas on guessing which one should be used? |
Well, one quick way I found was to run |
Okay, my latest attempt actually works for both Fedora and Mint! coderforlife@602e8a1 It uses a small bash script to detect if On the Mint system (in a VirtualBox) it takes 30-60 ms for the plugin to start which seems fast enough (seeing that the entire AppletManager takes ~500ms). However on my Fedora system (run on bare-metal) it takes a whopping 700 ms to start (out of 1144 ms which means that all the other plugins are starting faster while this one is significantly slower). My guess is that this is because it is running as a bash script which is then sourcing my If you have ideas how to suppress that I think this would be ready for a pull-request. |
My guess was wrong, even after clearing out my |
The newest version has times down to 200ms on my Fedora system and 60ms on Linux Mint in a VirtualBox. The high time required for mine is likely due to the much larger number of disks and CPUs needed to examine during first startup, however at least it is way down from the 0.5-1 seconds. |
Ah yeah, its about 200ms for me as well on my 14 core workstation. It loads fine in an 18.3 VM. I was testing before you opened the PR, and noticed the new NM GI binding works fine on Ubuntu 18.04 bionic as well, but it doesn't crash on the older one. I wonder why that occurs on Fedora, maybe they removed the old version altogether. I can merge your PR, thanks for looking into this! |
Applet: multicore-sys-monitor@ccadeptic23
Applet Version: v1.8.2, 2018-01-30
Cinnamon Version: 3.6.7
Distribution: Fedora 27
Notify author of applet
@jaszhix
Issue
On recent Fedora distributions the NetworkManager has been changed from "glib" to "libnm". Since the libnm version is loaded for other purposes, loading the glib version causes Cinnamon to crash. This applet is currently setup to load the old, glib, version causing Cinnamon to crash as long as either of the two old typelibs are loaded (
NMClient
orNetworkManager
).The new library just uses the NM typelib. Updating the following 3 fixes in DataSources.js fix the entire applet:
const NMClient = imports.gi.NMClient
andconst NetworkManager = imports.gi.NetworkManager
toconst NM = imports.gi.NM;
this.nmClient = NMClient.Client.new();
tothis.nmClient = NM.Client.new(null);
NetworkManager.DeviceState.CONNECTED
toNM.DeviceState.ACTIVATED
Steps to reproduce
Using Cinnamon spin of Fedora 27 add the multicore-sys-monitor applet.
Other information
I am not doing this as a pull request since there is still one major issue to fix: this change is likely to break systems still using the glib NetworkManager and I am unsure how to address this. One important thing to note is that
NetworkManager
(and maybeNMClient
) are ever imported (even if not used) the entire Cinnamon will be brought down. I am unsure if trying to importNM
on older system will cause any problems. If not, then trying to use it may be the way to check (like howGTop
is checked for in applet.js).The text was updated successfully, but these errors were encountered: