Bug 106272 - Calc Freezes (Not Responding) When Referencing to Another Sheet with Column/Row Freeze Enabled with input method Fcitx (Repro steps in Comment 12)
Summary: Calc Freezes (Not Responding) When Referencing to Another Sheet with Column/R...
Status: RESOLVED DUPLICATE of bug 121855
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Keywords: haveBacktrace
Depends on:
Reported: 2017-03-02 09:02 UTC by Kevin Suo
Modified: 2019-03-04 21:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

gdb backtrace (25.03 KB, text/x-log)
2017-03-02 09:02 UTC, Kevin Suo
autogen.input used for the build (911 bytes, text/plain)
2017-03-02 09:03 UTC, Kevin Suo
gdb backtrace related to last step of comment 4 (19.16 KB, text/x-log)
2017-03-05 10:00 UTC, Kevin Suo
gdb backtrace with fcitx-dbg (29.52 KB, text/x-log)
2017-03-06 09:50 UTC, Kevin Suo

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Suo 2017-03-02 09:02:26 UTC
Created attachment 131572 [details]
gdb backtrace

Steps to Reproduce:
1. New Calc;
2. Put cursor in Sheet1.B2, then freeze the columns and rows (by using the toolbar icon).
3. Insert a new Sheet2, put cursor in Sheet2.A1.
4. Type in "=", click Sheet1, click B2.

Current Behaviour:
Calc freezes (not responding) in step 4.

More Info:

The freeze appears in all my own builds after the following commit:

commit 1c3a784d38fc5986c78bab8d283c4661347baf43
Author: Justin Luth <justin_luth@sil.org>
Date:   Mon Feb 20 10:35:25 2017 +0300

    tdf#105256 gtk findfocus return only if focused

Bug exists in the version built on my home PC with Ubuntu 16.04 LTS,
and also in the version built on my VPS server located in Chicago with Ubuntu 14.04.5 LTS. The PC I used to run the soffice is Ubuntu 16.04 LTS, Simplfied Chinese (zh_CN)locale.

Bug also appears when I am using the version from the official daily dbgutil bibisect git repo.

I have indicator-keylock installed, but uninstalling indicator-keylock does not solve the problem.

The gdb backtrace is attached.
Comment 1 Kevin Suo 2017-03-02 09:03:53 UTC
Created attachment 131573 [details]
autogen.input used for the build
Comment 2 Kevin Suo 2017-03-03 02:15:48 UTC
Builds from branch libreofice-5-3 are also affected by this issue.
Comment 3 Justin L 2017-03-03 13:08:41 UTC
Unfortunately I cannot duplicate this.  (Ubuntu 16.04/12.04 x64 with March1 master, or with 54-daily-debug bibisect.)
Comment 4 Kevin Suo 2017-03-05 09:41:04 UTC
I did the following per advice from Justin:

1. I added the debug line, in vcl/unx/gtk/gtksalframe.cxx, below line 3676:

SAL_WARN_IF(xState.is(),"DEBUG","::FindFocus focused["<<(int)xState->contains(accessibility::AccessibleStateType::FOCUSED)<<"] Text.is["<<(uno::Reference<accessibility::XAccessibleEditableText>(xContext, uno::UNO_QUERY)).is()<<"] manages Descendants["<<(int)xState->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS)<<"]");

--> I get millions of endless warnings in terminal when I hit ENTER after clicking the referenced cell in Sheet1.
warn:DEBUG:27520:1:vcl/unx/gtk/gtksalframe.cxx:3771: ::FindFocus focused[0] Text.is[0] manages Descendants[0]
apparently it comes into an endless loop.

2. Revert 1c3a784d38fc5986c78bab8d283c4661347baf43.
--> no freeze anymore. No warning.

3. Revert 1c81af2c1814e8bd12701f85e09cebf5fe206647 (based on step2)
--> I get millions of same endless warnings in terminal, but it was at the time when I type in "=" in the cell in Sheet2. (i.e., one step earlier than step1 above.)

4. Revert 598e6a024163f1510d076000788b7745625f5ed5 (based on step3)
-->  I get millions of endless warnings in terminal when I hit ENTER after clicking the referenced cell in Sheet1. (i.e., same as step1)

Please advice me what to do next. Thanks.
Comment 5 Kevin Suo 2017-03-05 09:50:45 UTC
I should mention that I am using gtk2, not gtk3 (--disable-gtk3 in autogen.input)
Comment 6 Kevin Suo 2017-03-05 10:00:56 UTC
Created attachment 131641 [details]
gdb backtrace related to last step of comment 4
Comment 7 Kevin Suo 2017-03-06 09:06:40 UTC
Further tests shows that it has something to to with input method fcitx.

No freeze when I do:
$ sudo apt-get remove fcitx*
(and then reboot)

Freeze come back again when I do:
$ sudo apt-get install fcitx
(and then reboot)
this command automatically installed the following:
fcitx-config-common:amd64 (0.4.8-3, automatic),
fcitx-module-kimpanel:amd64 (1:, automatic),
fcitx-frontend-qt4:amd64 (1:, automatic),
fcitx-frontend-qt5:amd64 (1.0.5-1, automatic),
fcitx-bin:amd64 (1:, automatic),
fcitx-data:amd64 (1:, automatic),
fcitx:amd64 (1:,
fcitx-ui-classic:amd64 (1:, automatic),
fcitx-config-gtk:amd64 (0.4.8-3, automatic),
fcitx-frontend-gtk2:amd64 (1:, automatic),
fcitx-frontend-gtk3:amd64 (1:, automatic),
fcitx-module-lua:amd64 (1:, automatic),
fcitx-modules:amd64 (1:, automatic),
fcitx-frontend-all:amd64 (1:, automatic),
fcitx-module-x11:amd64 (1:, automatic),
fcitx-module-dbus:amd64 (1:, automatic)
Comment 8 Kevin Suo 2017-03-06 09:50:11 UTC
Created attachment 131666 [details]
gdb backtrace with fcitx-dbg
Comment 9 Kevin Suo 2017-03-07 10:06:22 UTC
(In reply to Kevin Suo from comment #4)

I added break point per advice from Justin and then followed the steps to reproduce. Below is the output for the moment of freeze:

(gdb) break gtksalframe.cxx:3770
Breakpoint 1 at 0x2aaac1743460: file /media/suokunlong/HD-Kevin/lo/source/branch-kevin-fix/vcl/unx/gtk/gtksalframe.cxx, line 3770.
(gdb) c
warn:DEBUG:31180:1:vcl/unx/gtk/gtksalframe.cxx:3769: ::FindFocus focused[0] Text.is[0] manages Descendants[0]

Thread 1 "soffice.bin" hit Breakpoint 1, FindFocus (xContext=...)
    at /media/suokunlong/HD-Kevin/lo/source/branch-kevin-fix/vcl/unx/gtk/gtksalframe.cxx:3771
3771        if (xState.is())
(gdb) c
warn:DEBUG:31180:1:vcl/unx/gtk/gtksalframe.cxx:3769: ::FindFocus focused[0] Text.is[0] manages Descendants[1]

Thread 1 "soffice.bin" hit Breakpoint 1, FindFocus (xContext=...)
    at /media/suokunlong/HD-Kevin/lo/source/branch-kevin-fix/vcl/unx/gtk/gtksalframe.cxx:3771
3771        if (xState.is())
(gdb) c
warn:DEBUG:31180:1:vcl/unx/gtk/gtksalframe.cxx:3769: ::FindFocus focused[0] Text.is[0] manages Descendants[0]
<all other continuing resulted the same as the above line>
Comment 10 Kevin Suo 2017-03-10 09:34:35 UTC
It's becoming interesting:
* It's broken in all versions in and before, including the oldest openoffice.org version.
* Start from, the bug behaviour does not reproduce anymore.
* The bug appear again in current master, and now also appear in release, after commit 1c3a784d38fc5986c78bab8d283c4661347baf43.

A review of the range: 066b007f5ebcc236395c7d282ba488bca6720265..2d75cf29e6d05e44c404f0547047f1da6563d380 
suggests that the following commit which was between and

commit 3af2382e6155abbb3e9e6102878bad1fa3f79373
Resolves: tdf#100903 Calc hangs when preediting Japanese with GTK plugin
(cherry picked from commit 1c81af2c1814e8bd12701f85e09cebf5fe206647)
author	Takeshi Abe <tabe@fixedpoint.jp>	2016-07-18 21:08:36 (GMT)
committer	Caolán McNamara <caolanm@redhat.com>	2016-07-20 10:11:16 (GMT)

did the unintended thing which caused the bug do disappear. However, that commit seems to be a bad one, as shown in the commit message in  1c3a784d38fc5986c78bab8d283c4661347baf43 made by Justin.

So I guess this bug should be marked as come form OpenOffice.org. Also adding Takeshi Abe in cc list.
Comment 11 Kevin Suo 2017-03-10 09:42:58 UTC
Removing "regression" from keyword list.
Comment 12 Kevin Suo 2017-03-11 14:07:20 UTC
To reproduce:

1. Use ubuntu 16.04 lts. This bug does not reproduce in ubuntu 16.10.
If you do not have 16.04 lts installed, then you may boot into ubuntu 16.04 LTS from an ISO in grub. any other boot method may also work. 

2. In system settings - Language Support - keyboard input method, choose fcitx. Logout and re-login (If using the iso, the username is ubuntu and password is BLANK).

3. Install libreoffice release build (using dpkg -i method), or the most recent daily build.

4. Try to reproduce the bug: 
1) Freeze column and rows in cell B2;
2) Type in = in cell A1 of sheet2, click sheet1, click B2. hit ENTER.

It reproduces in the default en ui.
Comment 13 Francois 2017-08-17 13:01:50 UTC

I don't even need cross sheet references to make it crash.

If I create the following spreadsheet:

Ni Hao;Guten Tag

Then freeze the first row, any attempt to reference the top row from other rows (or other rows from the top row) freezes Calc. To be more precise, it freezes at selection time, not commit time. Here is the sequence:

1- Create the four cells suggested here (or anything else)
2- Freeze first row
3- go to an empty cell below top row
4- hit F2
5- Type "=" to start a formula
6- use the arrows to get to the top row 
7- The freeze happens the moment the selection "touches" the top row, i.e.


If I type the address of the cell instead (ex: "=B1"), then it works fine.

Locking after entering the formula works fine.

OS: Ubuntu 14.04.5

Build ID: 1:5.4.0~rc3-0ubuntu0.14.04.1~lo2
CPU threads: 12; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-CA (en_CA.UTF-8); Calc: group

This is a big problem for me, so I am more than willing to help fix it ! Here's my email: francois.trahan@gmail.com
Comment 14 Francois 2017-08-17 13:04:53 UTC
Oh, by the way, I am also using fcitx (
Comment 15 Kevin Suo 2017-10-08 14:33:12 UTC
This is already confirmed in comment 13. Set to NEW.
Comment 16 Kevin Suo 2018-09-30 02:30:50 UTC
Still reproducible in
Build ID:0c292870b25a325b5ed35f6b45599d2ea4458e77
CPU 线程:4; 操作系统:Linux 4.15; UI 渲染:默认; VCL: gtk2; 
区域语言:zh-CN (zh_CN.UTF-8); Calc: group
Comment 17 Caolán McNamara 2018-12-04 13:07:12 UTC

*** This bug has been marked as a duplicate of bug 121855 ***