Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945386 - mate-base/mate-menus-1.28.0: x11-misc/mozo segfault when editing menu entries
Summary: mate-base/mate-menus-1.28.0: x11-misc/mozo segfault when editing menu entries
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: immolo
URL: https://github.com/mate-desktop/mate-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-30 00:36 UTC by Thibaud CANALE
Modified: 2024-12-02 20:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_945386.txt,8.75 KB, text/plain)
2024-11-30 00:36 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud CANALE 2024-11-30 00:36:13 UTC
Created attachment 912746 [details]
emerge --info

When editing menu or entries, sometimes the menu editing tool Mozo crash with segmentation fault.
Based on the core dump, it happens inside the function matemenu_tree_item_ref in file `libmenu/matemenu-tree.c` of library mate-base/mate-menus. Here some backtrace:
```
Core was generated by `/usr/bin/python3.12 -OOt /usr/lib/python-exec/python3.12/mozo'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  matemenu_tree_item_ref (itemp=0x0) at matemenu-tree.c:1813
1813      g_atomic_int_inc (&item->refcount);
[Current thread is 1 (Thread 0x66d3d5037740 (LWP 23119))]

(gdb) thread apply all bt full
../..
Thread 1 (Thread 0x66d3d5037740 (LWP 23119)):                                                                                           
#0  matemenu_tree_item_ref (itemp=0x0) at matemenu-tree.c:1813                                                                                  item = 0x0                                                                                                                      
#1  0x000066d3d2f2a367 in matemenu_tree_get_root_directory (tree=<optimized out>) at matemenu-tree.c:895                                
#2  0x000066d3d47133f6 in ffi_call_unix64 () at /usr/src/debug/dev-libs/libffi-3.4.6-r2/libffi-3.4.6/src/x86/unix64.S:104
```

The current function:
```c
/**
 * matemenu_tree_item_ref:
 * @item: a #MateMenuTreeItem
 * 
 * Returns: (transfer full): The same @item, or %NULL if @item is not a valid #MateMenuTreeItem
 */
gpointer
matemenu_tree_item_ref (gpointer itemp)
{
  MateMenuTreeItem* item = (MateMenuTreeItem*) itemp;
  g_return_val_if_fail(item != NULL, NULL);
  g_return_val_if_fail(item->refcount > 0, NULL);

  g_atomic_int_inc (&item->refcount);

  return item;
}
```

It looks like the Glib macros are not working as expected.
https://docs.gtk.org/glib/func.return_val_if_fail.html (no description provided)
https://docs.gtk.org/glib/warnings.html


The list of packages (compiled with debug symbols for backtracking)
mate-base/mate-menus-1.28.0
x11-misc/mozo-1.28.0
dev-libs/glib-2.78.6
dev-python/pygobject-3.46.0-r1
dev-libs/libffi-3.4.6-r2