Bug 172188 - Crash when switching para direction in editeng
Summary: Crash when switching para direction in editeng
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
26.8.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:26.8.0
Keywords: bisected, haveBacktrace, regression
Depends on:
Blocks: RTL
  Show dependency treegraph
 
Reported: 2026-05-21 02:08 UTC by Jonathan Clark
Modified: 2026-05-21 17:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Clark 2026-05-21 02:08:11 UTC
Description:
Writer crashes due to the following assertion when changing paragraph directions inside text boxes:

> soffice.bin: core/include/svl/poolitem.hxx:709: const T& SfxPoolItem::StaticWhichCast(TypedWhichId<T>) const [with T = SfxBoolItem]: Assertion `nId == m_nWhich' failed.

Steps to Reproduce:
1. Open a new Writer document
2. Create a text box (Insert -> Text Box, then drag a box)
3. Type some text
4. Press the Right-to-Left button on the toolbar

Actual Results:
Writer crashes due to an assertion

Expected Results:
Writer should not crash


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 4f1d95b0cc85e0b05c0b97c90f7d5df2d4272b76
CPU threads: 32; OS: Linux 6.17; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 1 Jonathan Clark 2026-05-21 02:11:13 UTC
This is a regression. I bisected a development build to the following commit:

> c0b0a18f5c82ff0ea6ceff1c2e3c1fcab9496681 is the first bad commit
> commit c0b0a18f5c82ff0ea6ceff1c2e3c1fcab9496681
> Author: Julien Nabet <serval2412@yahoo.fr>
> Date:   Mon Apr 27 18:19:08 2026 +0200
> 
>     Related tdf#140226: use StaticWhichCast in ww8graf+drwtxtex (sw)
>    
>     Change-Id: I869f707b40f57c91994dc68545a8154ea8c70e10
>     Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204472
>     Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
>     Tested-by: Jenkins

Could you have a look please, Julien?
Comment 2 Julien Nabet 2026-05-21 07:34:08 UTC
Thank you Jonathan for having put me in cc.
I'm building from scratch and will try to retrieve a backtrace.
Comment 3 Julien Nabet 2026-05-21 08:33:35 UTC
Ok re reading the patch, I think I understand why it fails.
Comment 4 Julien Nabet 2026-05-21 10:09:05 UTC
Patch on gerrit here:
https://gerrit.libreoffice.org/c/core/+/205476
Comment 5 Julien Nabet 2026-05-21 10:09:25 UTC
bt:
#4  0x00007f4a81630424 in __assert_fail_base
    (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=<optimized out>, function=0x7f49f524a32f "const T &SfxPoolItem::StaticWhichCast(TypedWhichId<T>) const [T = SfxBoolItem]")
    at ./assert/assert.c:118
#5  0x00007f49f68d4bec in SfxPoolItem::StaticWhichCast<SfxBoolItem> (this=0x55560bdf62a0, nId=...) at include/svl/poolitem.hxx:707
#6  0x00007f49f7369c40 in SwDrawTextShell::Execute (this=0x55560be10ee0, rReq=...) at /home/julien/lo/libreoffice/sw/source/uibase/shells/drwtxtex.cxx:620
Comment 6 Commit Notification 2026-05-21 15:34:24 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/100fcb9ca39e6de4cb9b2e86c2deac5069440cd0

tdf#172188: Crash when switching para direction in editeng

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Julien Nabet 2026-05-21 15:35:22 UTC
I let you verify and reopen this tracker if you still reproduce this with a build containing the patch.
Comment 8 Jonathan Clark 2026-05-21 16:24:52 UTC
Looks good! Thanks for fixing this so quickly.

Verified with a development build:

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: b15e1dcaa8d233717569662834f8c4351edf0e69
CPU threads: 32; OS: Linux 6.17; UI render: default; VCL: kf5 (cairo+wayland)
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded
Comment 9 Julien Nabet 2026-05-21 16:58:19 UTC
(In reply to Jonathan Clark from comment #8)
> Looks good! Thanks for fixing this so quickly.
> ...
You're welcome (and sorry for this regression).
Comment 10 Jonathan Clark 2026-05-21 17:02:41 UTC
(In reply to Julien Nabet from comment #9)
> (In reply to Jonathan Clark from comment #8)
> > Looks good! Thanks for fixing this so quickly.
> > ...
> You're welcome (and sorry for this regression).

No need to apologize. These things happen.