Package: transmission-gtk
Version: 4.1.1+dfsg-1~bpo13+1
Severity: normal
X-Debbugs-Cc: [email protected]

Dear Maintainer,

**transmission-gtk crashes with `unordered_map::at` when interacting with 
scheduled speed limits in preferences**

I upgraded to the backports version (4.1.1) because the trixie main package 
(4.1.0~beta2) was missing the transmission icon in the dash-to-panel GNOME 
extension. Unfortunately 4.1.1 introduces this crash.

# Steps to reproduce

1. Open transmission-gtk with active torrents
2. Open Edit > Preferences > Speed
3. Interact repeatedly with any control in the "Scheduled times" section 
(checkbox, start time, end time, day-of-week)
4. Crash occurs, sometimes after a few interactions

The crash also occurs when the scheduled time fires automatically.
This feature is especially useful where metered data includes 
differently-priced "night-owl" data.

# Expected behaviour

Scheduled speed limit controls should work without crashing.

# Actual behaviour

```
** (transmission-gtk:XXXXX): ERROR **: unhandled exception (type 
std::exception) in signal handler:
what: unordered_map::at
Trace/breakpoint trap
```

# Backtrace

Obtained via `gdb -ex "catch throw" -ex run --args transmission-gtk`, with 
debug symbols from the `trixie-backports-debug` repository:

```
#0  __cxa_throw () from libstdc++.so.6
#1  std::__throw_out_of_range(char const*) () from libstdc++.so.6
#2  std::__detail::_Map_base<...>::at (this=<key_to_action>) at 
hashtable_policy.h:399
#3  std::unordered_map<Glib::ustring, std::shared_ptr<Gio::SimpleAction>>::at 
(...)
    at unordered_map.h:1005
    #4  (anonymous namespace)::get_action (name=...) at ./gtk/Actions.cc:181
    #5  gtr_action_set_toggled (name=..., is_toggled=false) at 
./gtk/Actions.cc:198
    #6  Application::Impl::on_prefs_changed (this=..., key=...) at 
./gtk/Application.cc:1301
    #7  sigc::signal emit
    #8  Session::Impl::commit_prefs_change (...) at ./gtk/Session.cc:1148
    ```

# Notes

`Actions.cc:183` has no missing-key guard:
```
$ grep -n 'key_to_action.at\|key_to_action.find' gtk/Actions.cc
183:    return key_to_action.at(name);
```

The action is registered under a hyphenated name in `Actions.cc`, but 
`Application.cc` looks it up via the raw libtransmission quark string (which 
uses underscores):
```
$ grep -n 'alt.speed.enabled' gtk/Actions.cc gtk/Application.cc
Actions.cc:73:    "alt-speed-enabled"sv,
Application.cc:1302:    case TR_KEY_alt_speed_enabled:
Application.cc:1306:        
gtr_action_set_toggled(std::string(tr_quark_get_string_view(key)), b);
```

# Workaround

Do not use the scheduled times feature until this is fixed.

## Version information

- transmission-gtk 4.1.1+dfsg-1~bpo13+1 (Debian trixie-backports) — **affected**
- transmission-gtk 4.1.0~beta2+dfsg-3+deb13u1 (Debian trixie main) — not 
reproduced
- Both packages link against the same GTK4 4.18.6 and libglibmm-2.68
- Debian trixie (x86_64)

-- System Information:
Debian Release: 13.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.74+deb13+1-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_ZA.UTF-8, LC_CTYPE=en_ZA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_ZA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages transmission-gtk depends on:
ii  libb64-0d                1.2-5+b3
ii  libc6                    2.41-12+deb13u2
ii  libcurl4t64              8.14.1-2+deb13u2
ii  libdeflate0              1.23-2
ii  libevent-core-2.1-7t64   2.1.12-stable-10+b1
ii  libevent-extra-2.1-7t64  2.1.12-stable-10+b1
ii  libgcc-s1                14.2.0-19
ii  libglib2.0-0t64          2.84.4-3~deb13u2
ii  libglibmm-2.68-1t64      2.84.0-1
ii  libgtk-4-1               4.18.6+ds-2
ii  libgtkmm-4.0-0           4.18.0-1
ii  libminiupnpc18           2.2.8-2+b2
ii  libnatpmp1t64            20230423-1.2+b3
ii  libpangomm-2.48-1t64     2.56.1-1
ii  libpsl5t64               0.21.2-1.1+b1
ii  libsigc++-3.0-0          3.6.0-2+b1
ii  libssl3t64               3.5.5-1~deb13u1
ii  libstdc++6               14.2.0-19
ii  transmission-common      4.1.1+dfsg-1~bpo13+1

Versions of packages transmission-gtk recommends:
ii  xdg-utils  1.2.1-2

transmission-gtk suggests no packages.

-- no debconf information

Reply via email to