elementary / elementary/wingpanel

Memory corruption

Open
#373 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vala
Stars
144
Forks
53
Avg merge
13h 44m
Merged PRs (30d)
22

Description

## What Happened

Due to nixos/nixpkgs#101527 I occasionally have to `kill` wingpanel to have it pick up newly installed apps. It restarted fine, but when I tried to actually open the applications list, it crashed.

There is `realloc(): invalid next size` in the journal and when I tried to start it manually in the terminal right after that, I got `free(): invalid next size (fast)`, so there is _some_ sort of memory corruption going on.

And `gnome-session` does not attempt to restart it any longer.

## Expected Behavior

There are two problems here:

1. The underlying crash. It is not the first this happens to me, I would say it actually happens quite often, but it is only now that I actually looked into it.
2. The fact that `gnome-session` gives up trying to restart it. `wingpanel` does not crash immediately when it starts, it only crashes when I try to actually open the application list, so the fact that `gnome-session` only tries once may be some sort of misconfiguration in the desktop file.

## Steps to Reproduce

1. (Maybe?) Install some new .desktop files
2. Kill wingpanel with SIGTERM
3. Wait for it to restart and try to open the application list

After it crashed like this for the first time `gnome-session` gave up trying to restart it immediately, so I launched it form the terminal myself an it crashed again. Then I tried again, and it worked fine, so this is not particularly deterministic.

### Logs

Journal:

```text
Feb 07 17:18:43 kirXps gnome-session-binary[1799]: WARNING: Application 'io.elementary.wingpanel.desktop' killed by signal 15
Feb 07 17:18:43 kirXps .wingpanel-wrap[8869]: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-2ePpf5HZQa: Connection refused
Feb 07 17:18:44 kirXps .gala-wrapped[1976]: invalid cast from 'CoglTexture2D' to '(null)'
Feb 07 17:18:49 kirXps .wingpanel-wrap[8869]: DBusService.vala:64: Service registration suceeded
Feb 07 17:18:49 kirXps io.elementary.wingpanel.desktop[8869]: realloc(): invalid next size
Feb 07 17:18:49 kirXps gnome-session[1799]: gnome-session-binary[1799]: WARNING: Application 'io.elementary.wingpanel.desktop' killed by signal 6
Feb 07 17:18:49 kirXps gnome-session[1799]: gnome-session-binary[1799]: WARNING: App 'io.elementary.wingpanel.desktop' respawning too quickly
Feb 07 17:18:49 kirXps gnome-session[1799]: gnome-session-binary[1799]: WARNING: Error on restarting session managed app: Component 'io.elementary.wingpanel.desktop' crashing too quickly
Feb 07 17:18:49 kirXps gnome-session-binary[1799]: WARNING: Application 'io.elementary.wingpanel.desktop' killed by signal 6
Feb 07 17:18:49 kirXps gnome-session-binary[1799]: WARNING: App 'io.elementary.wingpanel.desktop' respawning too quickly
Feb 07 17:18:49 kirXps gnome-session-binary[1799]: WARNING: Error on restarting session managed app: Component 'io.elementary.wingpanel.desktop' crashing too quickly
Feb 07 17:18:50 kirXps systemd-coredump[8904]: Process 8869 (.wingpanel-wrap) of user 1000 dumped core.
```

Backtrace from the coredump:

```text
(gdb) bt
#0 0x00007fac312e5ffa in raise () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#1 0x00007fac312d0528 in abort () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#2 0x00007fac31327828 in __libc_message () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#3 0x00007fac3132e98a in malloc_printerr () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#4 0x00007fac3133297c in _int_realloc () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#5 0x00007fac31333a87 in realloc () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
#6 0x00007fac321130c8 in g_realloc () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#7 0x00007fac320f9f0d in realloc_arrays () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#8 0x00007fac320fa25a in g_hash_table_resize () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#9 0x00007fac320fa825 in g_hash_table_insert_node () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#10 0x00007fac320fab56 in g_hash_table_insert_internal () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#11 0x00007fac32131151 in g_string_chunk_insert_const () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#12 0x00007fac2f09388a in zeitgeist_subject_set_mimetype () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#13 0x00007fac2f09e608 in zeitgeist_db_reader_get_subject_from_row () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#14 0x00007fac2f09e879 in zeitgeist_db_reader_get_events () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#15 0x00007fac2f0a1938 in zeitgeist_db_reader_find_events () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#16 0x00007fac2f0813b6 in ____lambda11__gthread_func () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#17 0x00007fac2f082763 in ____lambda10__gfunc () from /nix/store/a4ya53x8mgjlnskxpksjn10nfqj1aw49-zeitgeist-1.0.2-lib/lib/libzeitgeist-2.0.so.0
#18 0x00007fac32136c34 in g_thread_pool_thread_proxy () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#19 0x00007fac321363cd in g_thread_proxy () from /nix/store/4x2sd5i73qacv1940yc6dg94izahpqrz-glib-2.64.5/lib/libglib-2.0.so.0
#20 0x00007fac31219ead in start_thread () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libpthread.so.0
#21 0x00007fac313a5caf in clone () from /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6
```

## Platform Information

* NixOS 20.09 (`8e78c2cfbae`)
* wingpanel-2.3.2

cc @worldofpeace (in case this is somehow NixOS-specific and you saw something like this)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.