mate-desktop / mate-system-monitor

Process viewer and system resource monitor for MATE
https://mate-desktop.org
GNU General Public License v2.0
45 stars 27 forks source link

Coredump (SIGSEGFUALT) on OpenIndiana #263

Closed Toasterson closed 8 months ago

Toasterson commented 8 months ago

Hello mate devs.

On OpenIndiana we currently have a bug with mate-system-monitor

We can reproduce this on multiple machines and it prevents mate-system-monitor from starting.

Expected behaviour

System Monitor starting

Actual behaviour

Segfault and coredump with the following details:

Console:

(<unknown>:2575): Gtk-WARNING **: 07:49:00.635: Theme parsing error: gtk-widgets.css:6:28: The style property GtkRange:slider-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): Gtk-WARNING **: 07:49:00.635: Theme parsing error: gtk-widgets.css:7:28: The style property GtkRange:stepper-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): Gtk-WARNING **: 07:49:00.635: Theme parsing error: gtk-widgets.css:8:31: The style property GtkRange:stepper-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): Gtk-WARNING **: 07:49:00.635: Theme parsing error: gtk-widgets.css:9:29: The style property GtkRange:trough-border is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): Gtk-WARNING **: 07:49:00.636: Theme parsing error: gtk-widgets.css:10:37: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): Gtk-WARNING **: 07:49:00.636: Theme parsing error: gtk-widgets.css:14:32: The style property GtkRange:slider-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(<unknown>:2575): CRITICAL **: 07:49:00.733:
unhandled exception (type Glib::Error) in signal handler:
domain: g-io-error-quark
code : 0
what : Unable to find default local file monitor type
Segmentation Fault (core dumped)

mdb (gdb equivalent)

$ mdb -e '::status' core
debugging core file of mate-system-mon (64-bit) from t400
file: /usr/bin/mate-system-monitor
initial argv: mate-system-monitor
threading model: native threads
status: process terminated by SIGSEGV (Segmentation Fault), addr=8258
$ mdb -e '::stack' core | c++filt 
ProcmanApp::on_command_line(Glib::RefPtr<Gio::ApplicationCommandLine> const&)+0x10b()
libgiomm-2.4.so.1.3.0`Gio::Application_Class::command_line_callback(_GApplication*, _GApplicationCommandLine*)+0x169()
libgio-2.0.so.0.7400.7`_g_cclosure_marshal_INT__OBJECTv+0x70()
libgobject-2.0.so.0.7400.7`_g_closure_invoke_va+0xd0()
libgobject-2.0.so.0.7400.7`g_signal_emit_valist+0x2a5()
libgobject-2.0.so.0.7400.7`g_signal_emit+0x7d()
libgio-2.0.so.0.7400.7`g_application_call_command_line+0xa3()
libgio-2.0.so.0.7400.7`g_application_real_local_command_line+0x221()
libgiomm-2.4.so.1.3.0`Gio::Application::local_command_line_vfunc(char**&, int&)+0x51()
libgiomm-2.4.so.1.3.0`Gio::Application_Class::local_command_line_vfunc_callback(_GApplication*, char***, int*)+0xfb()
libgio-2.0.so.0.7400.7`g_application_run+0xf3()
main+0x5e()
_start_crt+0x87()
_start+0x18()
$

Steps to reproduce the behaviour

Start Mate-system-monitor

MATE general version

1.26

Package version

pkg:/desktop/system-monitor/mate-system-monitor@1.26.0

Linux Distribution

OpenIndiana (SunOS descendant and illumos distribution) on the heritage line of OpenIndiana

Link to bugreport of your Distribution (requirement)

https://www.illumos.org/issues/16409

Additional Info

If any filesystem polling mechanisms got removed since mate 1.21 this could be the issue since we do have epoll and inotify but maybe the build disables it. I can't track it down to the exact cause so any hints on how to narrow this bug to a subsystem or something missing would be appreciated.

cwendling commented 8 months ago

Unable to find default local file monitor type

This is GIO, probably because it lacks the right extension.

The system monitory bug is that it doesn't handle that gracefully, and lets the exception slip. But is it expected your GIO doesn't have file monitoring support? I'm afraid there might be a lot of apps out there that don't properly handle this edge case :)

Toasterson commented 8 months ago

Ah, thanks thats a good pointer.

I can't find a eventport(https://illumos.org/man/3C/port_create) implementation and our inotify implementation is only available in a fork of the kernel and not the main branch. So yes it seems for files we are expected to not have file monitor.

cwendling commented 8 months ago

That's probably something you'd want to come around to fix.

Anyway, you can try this minimal (untested) patch that should prevent the crash, although it'd probably be better to show that monitoring wont work in addition to not enable it.

diff --git a/src/procman-app.cpp b/src/procman-app.cpp
index 7724a4c..b4c6742 100644
--- a/src/procman-app.cpp
+++ b/src/procman-app.cpp
@@ -27,7 +27,14 @@ init_volume_monitor(ProcData *procdata)
     using namespace Gio;
     using namespace Glib;

-    RefPtr<VolumeMonitor> monitor = VolumeMonitor::get();
+    RefPtr<VolumeMonitor> monitor;
+
+    try {
+        monitor = VolumeMonitor::get();
+    } catch (const Glib::Error& ex) {
+        g_warning("Failed to setup mount point monitor: %s", ex.what().c_str());
+        return;
+    }

     monitor->signal_mount_added().connect(sigc::ptr_fun(&mount_changed));
     monitor->signal_mount_changed().connect(sigc::ptr_fun(&mount_changed));
Toasterson commented 8 months ago

We recently integrated a PR to add Event port support to glib via gaming. I'll have to check with glib what the support status of gaming is but for now it work :) Thanks for all the pointers and help.