Bug 2171140 - [abrt] ibus-typing-booster: on_gsettings_value_changed(): hunspell_table.py:7038:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
Summary: [abrt] ibus-typing-booster: on_gsettings_value_changed(): hunspell_table.py:7...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus-typing-booster
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mike FABIAN
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:55bb325f294216e1e5be0a1ae11...
: 2169586 2170023 2171129 2172033 2172300 2173486 2175663 2176816 2179531 2186776 2188139 2188251 2189279 2189797 2219585 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-18 07:37 UTC by Oursique
Modified: 2024-01-22 10:13 UTC (History)
20 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-01-22 10:13:33 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (726 bytes, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details
File: cpuinfo (3.33 KB, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details
File: environ (2.11 KB, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details
File: mountinfo (3.37 KB, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details
File: namespaces (172 bytes, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details
File: open_fds (2.80 KB, text/plain)
2023-02-18 07:37 UTC, Oursique
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github mike-fabian ibus-typing-booster issues 454 0 None closed [BUG] The gsettings `changed` signal is connected too early in the `__init__()` method of typing booster. 2023-07-30 12:41:24 UTC

Description Oursique 2023-02-18 07:37:11 UTC
Version-Release number of selected component:
ibus-typing-booster-2.21.3-1.fc37

Additional info:
reporter:       libreport-2.17.4
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
crash_function: on_gsettings_value_changed
exception_type: AttributeError
executable:     /usr/share/ibus-typing-booster/engine/main.py
interpreter:    python3-3.11.1-3.fc37.x86_64
kernel:         6.1.11-200.fc37.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
hunspell_table.py:7038:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'

Traceback (most recent call last):
  File "/usr/share/ibus-typing-booster/engine/hunspell_table.py", line 7038, in on_gsettings_value_changed
    if (key in self._set_get_functions
               ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'

Local variables in innermost frame:
self: <hunspell_table.TypingBoosterEngine object at 0x7f19f751a600 (hunspell_table+TypingBoosterEngine at 0x5562b24f1130)>
_settings: <Gio.Settings object at 0x7f19f7317880 (GSettings at 0x5562b1c30a60)>
key: 'dictionary'
value: 'en_US_POSIX,fr,fr_FR'

Comment 1 Oursique 2023-02-18 07:37:14 UTC
Created attachment 1944927 [details]
File: backtrace

Comment 2 Oursique 2023-02-18 07:37:15 UTC
Created attachment 1944928 [details]
File: cpuinfo

Comment 3 Oursique 2023-02-18 07:37:16 UTC
Created attachment 1944929 [details]
File: environ

Comment 4 Oursique 2023-02-18 07:37:18 UTC
Created attachment 1944930 [details]
File: mountinfo

Comment 5 Oursique 2023-02-18 07:37:19 UTC
Created attachment 1944931 [details]
File: namespaces

Comment 6 Oursique 2023-02-18 07:37:20 UTC
Created attachment 1944932 [details]
File: open_fds

Comment 7 Mike FABIAN 2023-02-21 06:42:24 UTC
*** Bug 2171129 has been marked as a duplicate of this bug. ***

Comment 8 Mike FABIAN 2023-02-21 06:43:39 UTC
*** Bug 2170023 has been marked as a duplicate of this bug. ***

Comment 9 Mike FABIAN 2023-02-21 06:44:07 UTC
*** Bug 2169586 has been marked as a duplicate of this bug. ***

Comment 10 Diren Abeyewickreme 2023-02-21 09:13:22 UTC
*** Bug 2172033 has been marked as a duplicate of this bug. ***

Comment 11 Mike FABIAN 2023-02-21 10:14:09 UTC
Is there any procedure how to reproduce this? Looking at the dictionary settings 'en_US_POSIX,fr,fr_FR' I guess it has something to do with the on-screen-keyboard (OSK).

Comment 12 Diren Abeyewickreme 2023-02-21 16:30:02 UTC
Unfortunately not it seems, I did have the osk running at the time of the error however I could not replicate this issue. The only thing I remember before getting the report, was when I opened the search menu and started typing with my keyboard rather than the osk. It could be something else though...

Comment 13 Mike FABIAN 2023-02-21 20:30:29 UTC
I find it also very strange that the traceback complains about a missing _set_get_functions

Traceback (most recent call last):
  File "/usr/share/ibus-typing-booster/engine/hunspell_table.py", line 7038, in on_gsettings_value_changed
    if (key in self._set_get_functions
               ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'


because that exists:

mfabian@hathi:/local/mfabian/src/ibus-typing-booster ((2.21.3) $)
$ git grep self._set_get_functions
engine/hunspell_table.py:        self._set_get_functions: Dict[str, Dict[str, Any]] = {
engine/hunspell_table.py:                or setting not in self._set_get_functions
engine/hunspell_table.py:                or 'set' not in self._set_get_functions[setting]
engine/hunspell_table.py:                or 'get' not in self._set_get_functions[setting]):
engine/hunspell_table.py:            current_value = self._set_get_functions[setting]['get']()
engine/hunspell_table.py:            self._set_get_functions[setting]['set'](
engine/hunspell_table.py:            self._set_get_functions[setting]['set'](
engine/hunspell_table.py:        if (key in self._set_get_functions
engine/hunspell_table.py:            and 'set' in self._set_get_functions[key]):
engine/hunspell_table.py:            self._set_get_functions[key]['set'](value, update_gsettings=False)
lines 1-10/10 (END)

And when I trigger the call of the `on_gsettings_value_changed` function on the command line with

$ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary "'en_US_POSIX,fr,fr_FR'"
$ dconf write /org/freedesktop/ibus/engine/typing-booster/dictionary "'de_DE,it_IT,en_GB,fr_FR'"

I see that the function is called in the debug log, and not only is it called but it does what it is supposed to do, i.e. change the dictionary settings.

mfabian@hathi:~
$ tail -F ~/.local/share/ibus-typing-booster/debug.log | grep on_gsettings_value
2023-02-21 21:26:23,712 hunspell_table.py line 7037 on_gsettings_value_changed DEBUG: Settings changed: key=dictionary value=en_US_POSIX,fr,fr_FR
2023-02-21 21:26:30,395 hunspell_table.py line 7037 on_gsettings_value_changed DEBUG: Settings changed: key=dictionary value=de_DE,it_IT,en_GB,fr_FR

That function is very simple:

    def on_gsettings_value_changed(
            self, _settings: Gio.Settings, key: str) -> None:
        '''
        Called when a value in the settings has been changed.

        :param settings: The settings object
        :param key: The key of the setting which has changed
        '''
        value = itb_util.variant_to_value(self._gsettings.get_value(key))
        LOGGER.debug('Settings changed: key=%s value=%s\n', key, value)
        if (key in self._set_get_functions
            and 'set' in self._set_get_functions[key]):
            self._set_get_functions[key]['set'](value, update_gsettings=False)
            return
        LOGGER.warning('Unknown key\n')
        return

and if it failed as in the backtrace, I would not see the effect of setting the dictionaries.

Comment 14 MstrPi 2023-02-21 21:59:34 UTC
*** Bug 2172300 has been marked as a duplicate of this bug. ***

Comment 15 Mihai Lazarescu 2023-02-22 11:50:31 UTC
This has happened to me quite often and for many months now.
I filled in the steps to reproduce it in my notebook in the bug 2172442.

> Press the lock screen button (ASUS DUO).
> The screen is both locked and getting dark.
> Then press the power button to suspend to memory.
> The locked screen flashes on briefly, then starts the suspend procedure.
> It waits for a while, without progress (30s or so)
> Then it shows an error with some register dumps.
> I guess that somewhere in the two steps above happens the crash.
> Then I'm returned to the lock screen.
> I press the power button again the suspend went on regularly.
>
> Given the talks on the other similar bugs, I think there is a race condition, where ibus-typing-buster expects some module to be loaded (e.g, the on-screen keyboard, while it may take some time to be pulled up.
> BTW, I have the on-screen keyboard blocked in my Gnome session using the "Block Caribou" extension.

Comment 16 Paul Hernaus 2023-02-22 20:53:23 UTC
Similar problem has been detected:

On the Surface Go 2:
- Open Firefox
- Open new tab
- Disable the keyboad by folding it behind the display or disconnecting it
- "Click" the URL field with your finger

reporter:       libreport-2.17.4
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
crash_function: on_gsettings_value_changed
exception_type: AttributeError
executable:     /usr/share/ibus-typing-booster/engine/main.py
interpreter:    python3-3.11.1-3.fc37.x86_64
kernel:         6.1.12-200.fc37.x86_64
package:        ibus-typing-booster-2.21.3-1.fc37
reason:         hunspell_table.py:7038:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
runlevel:       N 5
type:           Python3
uid:            1000

Comment 17 robin 2023-02-22 23:10:29 UTC
Similar problem has been detected:

I don't know exactly, it appeared after I enabled the virtual keyboard and attempted to get it to show up. It did show up.

reporter:       libreport-2.17.4
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
crash_function: on_gsettings_value_changed
exception_type: AttributeError
executable:     /usr/share/ibus-typing-booster/engine/main.py
interpreter:    python3-3.11.1-3.fc37.x86_64
kernel:         6.1.12-200.fc37.x86_64
package:        ibus-typing-booster-2.21.3-1.fc37
reason:         hunspell_table.py:7038:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
runlevel:       N 5
type:           Python3
uid:            1000

Comment 18 Diren Abeyewickreme 2023-02-23 09:47:02 UTC
I think it is reproducible by using a convertible laptop. While in tablet mode and while typing with the virtual keyboard, go back to laptop mode and start typing in the keyboard. The crash report appears with no other indication of issues.

Comment 19 sierra 2023-02-27 04:54:20 UTC
*** Bug 2173486 has been marked as a duplicate of this bug. ***

Comment 20 fujiwara 2023-03-02 04:01:08 UTC
I tried to switch OSK and physical keyboard but I cannot reproduce any SEGVs.
Could you provide the reproducing steps with detail?

Comment 21 fschaupp 2023-03-18 09:38:17 UTC
*** Bug 2179531 has been marked as a duplicate of this bug. ***

Comment 22 Mike FABIAN 2023-04-11 06:43:35 UTC
(In reply to fujiwara from comment #20)
> I tried to switch OSK and physical keyboard but I cannot reproduce any SEGVs.
> Could you provide the reproducing steps with detail?

Until now, I was never able to reproduce this myself. I still cannot reproduce this. It is a complete mystery to me  how this can happen. 

See this comment: https://bugzilla.redhat.com/show_bug.cgi?id=2171140#c13

The backtrace complains about self._set_get_functions not existing, but that  definitely exists *and* works.

Comment 23 Helber Maciel Guerra 2023-04-14 12:35:23 UTC
*** Bug 2186776 has been marked as a duplicate of this bug. ***

Comment 24 Mike FABIAN 2023-04-17 16:22:35 UTC
*** Bug 2176816 has been marked as a duplicate of this bug. ***

Comment 25 Mike FABIAN 2023-04-17 16:23:14 UTC
*** Bug 2175663 has been marked as a duplicate of this bug. ***

Comment 26 Denis Smal 2023-04-22 05:14:59 UTC
Upgrade from Fedora 37 to Fedora 38


reporter:       libreport-2.17.9
runlevel:       N 5
crash_function: on_gsettings_value_changed
executable:     /usr/share/ibus-typing-booster/engine/main.py
package:        ibus-typing-booster-2.22.2-1.fc37
type:           Python3
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
reason:         hunspell_table.py:7050:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
exception_type: AttributeError
kernel:         5.17.5-300.fc36.x86_64
interpreter:    python3-3.11.3-1.fc37.x86_64
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
comment:        Upgrade from Fedora 37 to Fedora 38
uid:            1000

Comment 27 D. Hugh Redelmeier 2023-05-19 00:29:35 UTC
I didn't notice this crash so I don't know what I was doing at the time.


reporter:       libreport-2.17.10
uid:            1104
interpreter:    python3-3.11.1-3.fc37.x86_64
cgroup:         0::/user.slice/user-1104.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
package:        ibus-typing-booster-2.21.0-1.fc37
kernel:         6.1.10-200.fc37.x86_64
type:           Python3
exception_type: AttributeError
executable:     /usr/share/ibus-typing-booster/engine/main.py
comment:        I didn't notice this crash so I don't know what I was doing at the time.
reason:         hunspell_table.py:7038:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
crash_function: on_gsettings_value_changed
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
runlevel:       N 5

Comment 28 xingkunliu 2023-05-31 12:06:17 UTC
Just reboot the device and the error always shows


reporter:       libreport-2.17.9
kernel:         6.3.3-1.surface.fc38.x86_64
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
uid:            1000
reason:         hunspell_table.py:7050:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
executable:     /usr/share/ibus-typing-booster/engine/main.py
type:           Python3
package:        ibus-typing-booster-2.22.1-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: on_gsettings_value_changed
interpreter:    python3-3.11.2-1.fc38.x86_64
comment:        Just reboot the device and the error always shows

Comment 29 Mike FABIAN 2023-07-10 08:32:48 UTC
*** Bug 2188139 has been marked as a duplicate of this bug. ***

Comment 30 Mike FABIAN 2023-07-10 08:35:51 UTC
*** Bug 2188251 has been marked as a duplicate of this bug. ***

Comment 31 Mike FABIAN 2023-07-10 08:41:42 UTC
*** Bug 2189279 has been marked as a duplicate of this bug. ***

Comment 32 Mike FABIAN 2023-07-10 08:42:48 UTC
*** Bug 2189797 has been marked as a duplicate of this bug. ***

Comment 33 Mike FABIAN 2023-07-10 08:43:29 UTC
*** Bug 2219585 has been marked as a duplicate of this bug. ***

Comment 34 hiroppy 2023-07-23 19:58:16 UTC
fcitx5ã®è¨­å®ãã¡ã¤ã«ã«ibus-mozcã®è¨­å®ãè¨è¿°ãã¦ãã¾ãã¾ããã

~/.config/environment.d ãã£ã¬ã¯ããªéä¸ã«"00-fcitx5.conf"ã以ä¸ã®å容ã§ä½æã

INPUT_METHOD=ibus-mozc
GTK_IM_MODULE=ibus-mozc
QT_IM_MODULE=ibus-mozc
XMODIFIERS=@im=ibus-mozc


reporter:       libreport-2.17.11
exception_type: AttributeError
executable:     /usr/share/ibus-typing-booster/engine/main.py
package:        ibus-typing-booster-2.23.1-1.fc38
reason:         hunspell_table.py:7118:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
interpreter:    python3-3.11.4-1.fc38.x86_64
type:           Python3
runlevel:       N 5
crash_function: on_gsettings_value_changed
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
uid:            1000
kernel:         6.3.12-200.fc38.x86_64

Comment 35 Mike FABIAN 2023-07-30 08:49:19 UTC
I may have finally understood the problem.

self._gsettings.connect('changed', self.on_gsettings_value_changed)

is in line 162 of __init__() and the variable self._set_get_functions is later defined in __init__() in line 619.

So with unlucky timing the method self.on_gsettings_value_changed might be called already before self._set_get_functions is defined and then that method fails because it needs that variable.

I hope this idea is correct as I am still unable to reproduce the problem myself but this idea is probably correct.

So I think I can finally fix this.

Comment 36 Mike FABIAN 2023-07-30 12:40:55 UTC
ibus-typing-booster-2.23.2 should fix this: https://github.com/mike-fabian/ibus-typing-booster/releases/tag/2.23.2

Comment 38 Erik Nord 2023-08-02 07:41:06 UTC
Screen keyboard over gnome terminal after fresh boot


reporter:       libreport-2.17.11
kernel:         6.4.6-200.fc38.x86_64
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
uid:            1000
reason:         hunspell_table.py:7118:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
executable:     /usr/share/ibus-typing-booster/engine/main.py
type:           Python3
package:        ibus-typing-booster-2.23.1-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: on_gsettings_value_changed
interpreter:    python3-3.11.4-1.fc38.x86_64
comment:        Screen keyboard over gnome terminal after fresh boot

Comment 39 Konstantinos 2023-08-03 09:13:41 UTC
Laptop turned on from suspend by opening lid.
Could not write anything (physical keyboard disabled).
Solved by opening the laptop keyboard side completely, by turning it into a full tablet, and then remaking it into a laptop to trigger the transition from a laptop to tablet again.


reporter:       libreport-2.17.11
kernel:         6.4.6-200.fc38.x86_64
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
uid:            1000
reason:         hunspell_table.py:7118:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
executable:     /usr/share/ibus-typing-booster/engine/main.py
type:           Python3
package:        ibus-typing-booster-2.23.1-1.fc38
runlevel:       N 5
exception_type: AttributeError
crash_function: on_gsettings_value_changed
interpreter:    python3-3.11.4-1.fc38.x86_64

Comment 40 Jonathan Haas 2023-08-13 18:59:46 UTC
enabling on screen keyboard


reporter:       libreport-2.17.9
executable:     /usr/share/ibus-typing-booster/engine/main.py
exception_type: AttributeError
type:           Python3
uid:            1000
interpreter:    python3-3.11.2-1.fc38.i686
runlevel:       N 5
kernel:         6.2.9-300.fc38.x86_64
reason:         hunspell_table.py:7050:on_gsettings_value_changed:AttributeError: 'TypingBoosterEngine' object has no attribute '_set_get_functions'
comment:        enabling on screen keyboard
crash_function: on_gsettings_value_changed
cgroup:         0::/user.slice/user-1000.slice/user/session.slice/org.freedesktop.IBus.session.GNOME.service
cmdline:        /usr/bin/python3 /usr/share/ibus-typing-booster/engine/main.py --ibus
package:        ibus-typing-booster-2.22.1-1.fc38


Note You need to log in before you can comment on or make changes to this bug.