You are not logged in.

#1 2024-05-10 20:41:43

insciwetrust
Member
Registered: 2019-10-19
Posts: 88

[SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

I am running xfce4 on Arch. Mousepad (the text editor) suddenly stopped launching today (possibly after an update). When I try to run it from the terminal, the segmentation fault error is displayed. Surprisingly, I can still launch it using sudo.

Last edited by insciwetrust (2024-05-15 19:40:41)


No gods, no masters!

Offline

#2 2024-05-10 20:52:51

mesaprotector
Member
Registered: 2024-03-03
Posts: 172

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

You can see how recently you updated mousepad by using "pacman -Qi mousepad", but it could easily be a library mousepad pulls in that has the bug. It's not surprising that running it with sudo works, because a segmentation fault happens when a program tries to access memory it isn't able to access.

Does this happen with only mousepad, or also any other XFCE applications?

Offline

#3 2024-05-10 22:09:48

insciwetrust
Member
Registered: 2019-10-19
Posts: 88

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

mesaprotector wrote:

You can see how recently you updated mousepad by using "pacman -Qi mousepad", but it could easily be a library mousepad pulls in that has the bug. It's not surprising that running it with sudo works, because a segmentation fault happens when a program tries to access memory it isn't able to access.

Does this happen with only mousepad, or also any other XFCE applications?

Yeah, I don't think that the reason is a Mousepad update either. I checked, and my current build is from 1 May. I did install 2-3 GB worth of updates today though, so you may be right in your second theory.

It only affects Mousepad - other XFCE applications work all right.


No gods, no masters!

Offline

#4 2024-05-10 22:11:32

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Please post the backtrace with debug symbols from the core dump.

Offline

#5 2024-05-11 13:27:15

8bitredstone
Member
Registered: 2024-05-11
Posts: 13

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

I am also having the same issue (only launches with sudo) after a recent update, although only on my computer that has an Nvidia/Intel graphics GPU.
(GPU: NVIDIA GeForce GTX 1650 + GPU: Intel HD Graphics 530)

gdb reports the following:
Thread 1 "mousepad" received signal SIGSEGV, Segmentation fault.
0x00007ffff7de7dc7 in g_menu_exporter_menu_free (menu=0x0) at ../glib/gio/gmenuexporter.c:121
Downloading source file /usr/src/debug/glib2/build/../glib/gio/gmenuexporter.c
121       g_menu_exporter_group_remove_menu (menu->group, menu->id);

Last edited by 8bitredstone (2024-05-11 13:52:26)

Offline

#6 2024-05-11 13:31:10

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 100
Website

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Please provide full backtrace.

Offline

#7 2024-05-11 13:43:46

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Was glib2 in the recent update?  From pacman.log what version was it updated from and to?  Looks similar to https://gitlab.archlinux.org/archlinux/ … -/issues/5

Offline

#8 2024-05-11 13:52:15

8bitredstone
Member
Registered: 2024-05-11
Posts: 13

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

lambdarch wrote:

Please provide full backtrace.

Full traceback
https://pastebin.com/muxTWuPn

Offline

#9 2024-05-11 14:05:31

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 100
Website

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Looks like it's related to vala-panel-appmenu?
Does rebuilding this package help?
See also https://gitlab.com/vala-panel-project/v … issues/387

Offline

#10 2024-05-11 15:15:31

8bitredstone
Member
Registered: 2024-05-11
Posts: 13

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

lambdarch wrote:

Looks like it's related to vala-panel-appmenu?
Does rebuilding this package help?
See also https://gitlab.com/vala-panel-project/v … issues/387

I uninstalled that package and still get the same issue. Even still shows up in gdb?
not sure if it's uninstalling properly

I ran "yay -Rns vala-panel-appmenu-xfce"

Offline

#11 2024-05-11 15:46:27

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 100
Website

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

I'm not sure what's going on, I doubt it's coming directly from mousepad anyway (which I maintain). The crash reported in https://gitlab.archlinux.org/archlinux/ … -/issues/5 does indeed seem to have the same cause, so let's wait and see what comes of it (unless someone has an idea...)

Offline

#12 2024-05-11 16:20:21

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

There was no response to

loqs wrote:

Was glib2 in the recent update?  From pacman.log what version was it updated from and to?

So this is a guess but If you downgrade glib2 to 2.80.0-3 can you still reproduce the issue?
or glib2 2.80.0-4 https://bbs.archlinux.org/viewtopic.php … 5#p2170635

Last edited by loqs (2024-05-11 16:26:08)

Offline

#13 2024-05-11 16:31:54

lambdarch
Member
From: France
Registered: 2021-01-10
Posts: 100
Website

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

8bitredstone wrote:

I uninstalled that package and still get the same issue. Even still shows up in gdb?

Just to be sure: did you also remove the plugin from the panel?

Offline

#14 2024-05-11 20:29:14

seth
Member
Registered: 2012-09-03
Posts: 65,143

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

I uninstalled that package and still get the same issue.

#0  0x00007ffff7de7dc7 in g_menu_exporter_menu_free (menu=0x0) at ../glib/gio/gmenuexporter.c:121
#1  0x00007ffff7dedd99 in g_menu_exporter_free (user_data=0x555556125740) at ../glib/gio/gmenuexporter.c:714
        exporter = 0x555556125740
#2  0x00007ffff7e0ea0a in g_dbus_connection_register_object (connection=0x7fffe00059e0 [GDBusConnection], object_path=<optimized out>, interface_info=<optimized out>, vtable=<optimized out>, user_data=0x555556125740, user_data_free_func=0x7ffff7dedd80 <g_menu_exporter_free>, error=0x0) at ../glib/gio/gdbusconnection.c:5809
        eo = <optimized out>
        ei = <optimized out>
        ret = 0
        __func__ = "g_dbus_connection_register_object"
#3  0x00007ffff7dee595 in g_dbus_connection_export_menu_model (connection=connection@entry=0x7fffe00059e0 [GDBusConnection], object_path=0x5555561dbef0 "/org/xfce/mousepad/menus/menubar", menu=0x5555561e5670 [GMenu], error=error@entry=0x0) at ../glib/gio/gmenuexporter.c:72
        vtable = {method_call = 0x7ffff7dee1a0 <g_menu_exporter_method_call>, get_property = 0x0, set_property = 0x0, padding = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
        exporter = 0x555556125740
        id = <optimized out>
#4  0x00007ffff31d184d in gtk_x11_window_get_window_data (window=0x555555766ed0 [MousepadWindow]) at ../vala-panel-appmenu-24.02/subprojects/appmenu-gtk-module/src/platform.c:192
        object_path = 0x555556121870 "/org/appmenu/gtk/window/0"
        old_unity_object_path = 0x0
        old_action_group = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        session = 0x7fffe00059e0 [GDBusConnection]
        old_unique_bus_name = 0x5555561ed060 ":1.256"
        old_menubar_object_path = 0x5555561dbef0 "/org/xfce/mousepad/menus/menubar"
        old_menu_model = <optimized out>
        window_id = <optimized out>
        window_data = 0x5555561e08d0
        window_data = <optimized out>
        __func__ = {<optimized out> <repeats 31 times>}
        _g_boolean_var_15 = <optimized out>
        __inst = <optimized out>
        __t = <optimized out>
        __r = <optimized out>
        window_id = <optimized out>
        session = <optimized out>
        object_path = <optimized out>
        old_unique_bus_name = <optimized out>
        old_unity_object_path = <optimized out>
        old_menubar_object_path = <optimized out>
        old_action_group = <optimized out>
        old_menu_model = <optimized out>

The trace in https://gitlab.archlinux.org/archlinux/packaging/packages/handbrake/-/issues/5 has the same

#0  0x00007ffff7cb9dc7 in g_menu_exporter_menu_free (menu=0x0) at ../glib/gio/gmenuexporter.c:121
#1  0x00007ffff7cbfd99 in g_menu_exporter_free (user_data=0x55555b7819c0) at ../glib/gio/gmenuexporter.c:714
        exporter = 0x55555b7819c0
#2  0x00007ffff7ce0a0a in g_dbus_connection_register_object (connection=0x555559d699f0 [GDBusConnection], object_path=<optimized out>, interface_info=<optimized out>, vtable=<optimized out>, user_data=0x55555b7819c0, user_data_free_func=0x7ffff7cbfd80 <g_menu_exporter_free>, error=0x0) at ../glib/gio/gdbusconnection.c:5809
        eo = <optimized out>
        ei = <optimized out>
        ret = 0
        __func__ = "g_dbus_connection_register_object"
#3  0x00007ffff7cc0595 in g_dbus_connection_export_menu_model (connection=connection@entry=0x555559d699f0 [GDBusConnection], object_path=0x55555b566200 "/fr/handbrake/ghb/menus/menubar", menu=0x55555b7864e0 [GMenu], error=error@entry=0x0) at ../glib/gio/gmenuexporter.c:72
        vtable = {method_call = 0x7ffff7cc01a0 <g_menu_exporter_method_call>, get_property = 0x0, set_property = 0x0, padding = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
        exporter = 0x55555b7819c0
        id = <optimized out>
#4  0x00007ffff21fa84d in gtk_x11_window_get_window_data (window=0x55555a0380f0 [GtkApplicationWindow]) at ../vala-panel-appmenu-24.02/subprojects/appmenu-gtk-module/src/platform.c:192
        object_path = 0x55555b782660 "/org/appmenu/gtk/window/0"
        old_unity_object_path = 0x0
        old_action_group = <optimized out>
        session = 0x555559d699f0 [GDBusConnection]
        old_unique_bus_name = 0x55555b786490 ":1.844"
        old_menubar_object_path = 0x55555b566200 "/fr/handbrake/ghb/menus/menubar"
        old_menu_model = <optimized out>
        window_id = <optimized out>
        window_data = 0x55555b781650
        window_data = <optimized out>
        __func__ = {<optimized out> <repeats 31 times>}
        _g_boolean_var_15 = <optimized out>
        __inst = <optimized out>
        __t = <optimized out>
        __r = <optimized out>
        window_id = <optimized out>
        session = <optimized out>
        object_path = <optimized out>
        old_unique_bus_name = <optimized out>
        old_unity_object_path = <optimized out>
        old_menubar_object_path = <optimized out>
        old_action_group = <optimized out>
        old_menu_model = <optimized out>
#5  gtk_window_get_window_data (window=0x55555a0380f0 [GtkApplicationWindow]) at ../vala-panel-appmenu-24.02/subprojects/appmenu-gtk-module/src/datastructs.c:159
        window_data = <optimized out>
        __func__ = "gtk_window_get_window_data"

pattern but also goes through vala-panel-appmenu which might come from https://archlinux.org/packages/extra/x8 … tk-module/ ?

pacman -Qs appmenu

Offline

#15 2024-05-12 06:52:29

8bitredstone
Member
Registered: 2024-05-11
Posts: 13

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

I downgraded glib2 from 2.80.2-1 to 2.80.0-4 and it fixed the issue

So it is clearly an issue with glib2

it also fixed an issue I was having with changing xfwm themes crashing my session, and causing pinta to fail opening

Offline

#16 2024-05-12 07:00:10

seth
Member
Registered: 2012-09-03
Posts: 65,143

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

https://gitlab.com/vala-panel-project/v … platform.c hasn't been touched in 5 years.

It calls g_dbus_connection_export_menu_model from glib/gio/gmenuexporter.c and that

g_menu_exporter_menu_free (menu=0x0) at ../glib/gio/gmenuexporter.c

looks like it's trying to free a nullptr in https://github.com/GNOME/glib/blob/86dd … ter.c#L119 from https://github.com/GNOME/glib/blob/86dd … ter.c#L714 which is then deref'd what gets you a segfault

This happens because https://github.com/GNOME/glib/blob/86dd … ter.c#L798 fails


The change propbaly is in https://github.com/GNOME/glib/commits/m … nnection.c and that exposes bad memory management in gmenuexporter.c but would in and by itself rather lead to a functional failure.

Do you have a host for the appmenu (global menubar)?

Edit: copied markdown from my gitlab comment wink

Last edited by seth (2024-05-12 07:04:12)

Offline

#17 2024-05-12 13:03:43

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Can you reproduce the issue with either of the two patched glib2 packages:
Revert https://github.com/GNOME/glib/commit/74 … ee4a6bd91b
https://drive.google.com/file/d/156RPb0 … sp=sharing glib2-2.80.2-1.1-x86_64.pkg.tar.zst

Patched with:

diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c
index 909780cb2..59eae7dbb 100644
--- a/gio/gmenuexporter.c
+++ b/gio/gmenuexporter.c
@@ -710,6 +710,8 @@ static void
 g_menu_exporter_free (gpointer user_data)
 {
   GMenuExporter *exporter = user_data;
+  if (!exporter)
+    return
 
   g_menu_exporter_menu_free (exporter->root);
   g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);

https://drive.google.com/file/d/1nyrUNL … sp=sharing glib2-2.80.2-1.2-x86_64.pkg.tar.zst

Last edited by loqs (2024-05-12 13:03:57)

Offline

#18 2024-05-12 13:24:17

seth
Member
Registered: 2012-09-03
Posts: 65,143

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

exporter was previously allocated and will likely en up being not actually a nullptr but just full of 0x0 - in that case the function would have to test "if (!exporter->id) return;"

Offline

#19 2024-05-12 13:30:53

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

../glib/gio/gmenuexporter.c: In function ‘g_menu_exporter_free’:
../glib/gio/gmenuexporter.c:713:16: error: ‘GMenuExporter’ {aka ‘struct _GMenuExporter’} has no member named ‘id’
  713 |   if (!exporter->id) return;

Offline

#20 2024-05-12 14:03:05

seth
Member
Registered: 2012-09-03
Posts: 65,143

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Ah, f*** that's "GMenuExporterMenu" - "exporter->connection" should be a safe bet as it's referenced to the dbus connection afterwards.

For more cleanup

static void
g_menu_exporter_free (gpointer user_data)
{
  GMenuExporter *exporter = user_data;
  if (exporter->connection) {
    g_menu_exporter_menu_free (exporter->root);
    g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);
    g_hash_table_unref (exporter->remotes);
    g_hash_table_unref (exporter->groups);
    g_object_unref (exporter->connection);
    g_free (exporter->object_path);
  }
  g_slice_free (GMenuExporter, exporter);
}

and then what's liekly been a workaround for the now fixed cleanup the "g_slice_free (GMenuExporter, exporter);" in

  if (id == 0)
    {
//      g_slice_free (GMenuExporter, exporter);
      return 0;
    }

can be removed.

Offline

#21 2024-05-12 14:19:47

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

glib2 2.80.2 patched with:

diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c
index 909780cb2..150e44985 100644
--- a/gio/gmenuexporter.c
+++ b/gio/gmenuexporter.c
@@ -710,14 +710,14 @@ static void
 g_menu_exporter_free (gpointer user_data)
 {
   GMenuExporter *exporter = user_data;
-
-  g_menu_exporter_menu_free (exporter->root);
-  g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);
-  g_hash_table_unref (exporter->remotes);
-  g_hash_table_unref (exporter->groups);
-  g_object_unref (exporter->connection);
-  g_free (exporter->object_path);
-
+  if (exporter->connection) {
+    g_menu_exporter_menu_free (exporter->root);
+    g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);
+    g_hash_table_unref (exporter->remotes);
+    g_hash_table_unref (exporter->groups);
+    g_object_unref (exporter->connection);
+    g_free (exporter->object_path);
+  }
   g_slice_free (GMenuExporter, exporter);
 }
 
@@ -800,7 +800,6 @@ g_dbus_connection_export_menu_model (GDBusConnection  *connection,
 
   if (id == 0)
     {
-      g_slice_free (GMenuExporter, exporter);
       return 0;
     }
 

https://drive.google.com/file/d/1B655FL … sp=sharing glib2-2.80.2-1.3-x86_64.pkg.tar.zst

Offline

#22 2024-05-12 16:41:18

dichead
Member
Registered: 2003-05-29
Posts: 12

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

This worked for me, Thanks.

loqs wrote:

glib2 2.80.2 patched with:

diff --git a/gio/gmenuexporter.c b/gio/gmenuexporter.c
index 909780cb2..150e44985 100644
--- a/gio/gmenuexporter.c
+++ b/gio/gmenuexporter.c
@@ -710,14 +710,14 @@ static void
 g_menu_exporter_free (gpointer user_data)
 {
   GMenuExporter *exporter = user_data;
-
-  g_menu_exporter_menu_free (exporter->root);
-  g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);
-  g_hash_table_unref (exporter->remotes);
-  g_hash_table_unref (exporter->groups);
-  g_object_unref (exporter->connection);
-  g_free (exporter->object_path);
-
+  if (exporter->connection) {
+    g_menu_exporter_menu_free (exporter->root);
+    g_clear_pointer (&exporter->peer_remote, g_menu_exporter_remote_free);
+    g_hash_table_unref (exporter->remotes);
+    g_hash_table_unref (exporter->groups);
+    g_object_unref (exporter->connection);
+    g_free (exporter->object_path);
+  }
   g_slice_free (GMenuExporter, exporter);
 }
 
@@ -800,7 +800,6 @@ g_dbus_connection_export_menu_model (GDBusConnection  *connection,
 
   if (id == 0)
     {
-      g_slice_free (GMenuExporter, exporter);
       return 0;
     }
 

https://drive.google.com/file/d/1B655FL … sp=sharing glib2-2.80.2-1.3-x86_64.pkg.tar.zst

Offline

#23 2024-05-12 18:00:44

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

@seth should someone now report the issue on https://gitlab.gnome.org/GNOME/glib/-/issues?

Offline

#24 2024-05-12 19:56:55

seth
Member
Registered: 2012-09-03
Posts: 65,143

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

One of the affected users, interested in continued use of the feature most certainly should.

Offline

#25 2024-05-15 00:58:15

loqs
Member
Registered: 2014-03-06
Posts: 18,465

Re: [SOLVED] Mousepad Returns "Segmentation fault (core dumped)"

Upstream bug report https://gitlab.gnome.org/GNOME/glib/-/issues/3366
Edit:
glib2 2.80.2 with proposed upstream fix https://gitlab.gnome.org/GNOME/glib/-/m … uests/4073 applied:
https://drive.google.com/file/d/1qjvcCG … sp=sharing glib2-2.80.2-1.4-x86_64.pkg.tar.zst

Last edited by loqs (2024-05-15 12:03:35)

Offline

Board footer

Powered by FluxBB