Bug 156560 - Assertion failure on clicking to edit an RTL header (debug)
Summary: Assertion failure on clicking to edit an RTL header (debug)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Hossein
URL:
Whiteboard: target:24.2.0
Keywords: haveBacktrace
Depends on:
Blocks: RTL-CTL Crash-Assert
  Show dependency treegraph
 
Reported: 2023-08-01 06:38 UTC by Hossein
Modified: 2023-08-03 10:15 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
ODT file containing a right to left header (10.66 KB, application/vnd.oasis.opendocument.text)
2023-08-01 06:38 UTC, Hossein
Details
Backtrace (5.71 KB, text/plain)
2023-08-01 06:44 UTC, Hossein
Details
Minimal file that causes crash (33.67 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-08-03 09:04 UTC, Hossein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hossein 2023-08-01 06:38:36 UTC
Created attachment 188689 [details]
ODT file containing a right to left header

Description:
While trying to edit the RTL header, clicking on the header sometimes leads to assertion failure.

Steps to Reproduce:
1. Open the attached .odt file
2. Go to page 2
3. Click on the header

Actual Results:
Error message: "abort() has been called".

Assertion failed: pPageBody && "presumably this is impossible", file C:/cygwin64/home/user/lode/dev/core/sw/source/core/layout/paintfrm.cxx, line 7086

Expected Results:
No crash

Reproducible: Always


User Profile Reset: No

Additional Info:
This only happens in a debug build:
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 316215486b2fb255f4deea073e4d43671c4325c1
CPU threads: 20; OS: Windows 10.0 Build 22621; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: CL threaded

Please note that the rendering of the rtl (right to left) header and the text and image inside it is incorrect.
Comment 1 Hossein 2023-08-01 06:44:29 UTC
Created attachment 188690 [details]
Backtrace

Backtrace, created using Visual Studio 2022:

swlo.dll!SwPageFrame::GetSubsidiaryLinesPolygons(const SwViewShell & rViewShell) Line 7082
	at sw\source\core\layout\paintfrm.cxx(7082)
swlo.dll!SwPageFrame::AddSubsidiaryLinesBounds(const SwViewShell & rViewShell, std::vector<tools::Rectangle,std::allocator<tools::Rectangle>> & rRects) Line 7132
	at sw\source\core\layout\paintfrm.cxx(7132)
swlo.dll!SwViewShell::InvalidatePageAndHFSubsidiaryLines() Line 140
	at sw\source\core\view\viewsh.cxx(140)
swlo.dll!SwViewShell::ToggleHeaderFooterEdit() Line 130
	at sw\source\core\view\viewsh.cxx(130)
swlo.dll!SwFEShell::ToggleHeaderFooterEdit() Line 1329
	at sw\source\core\frmedt\fews.cxx(1329)
swlo.dll!SwEditWin::MouseButtonDown(const MouseEvent & _rMEvt) Line 3017
	at sw\source\uibase\docvw\edtwin.cxx(3017)
vcllo.dll!ImplHandleMouseEvent(const VclPtr<vcl::Window> & xWindow, NotifyEventType nSVEvent, bool bMouseLeave, __int64 nX, __int64 nY, unsigned __int64 nMsgTime, unsigned short nCode, MouseEventModifiers nMode) Line 709
	at vcl\source\window\winproc.cxx(709)
vcllo.dll!ImplHandleSalMouseButtonDown(vcl::Window * pWindow, const SalMouseEvent * pEvent) Line 2340
	at vcl\source\window\winproc.cxx(2340)
vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2691
	at vcl\source\window\winproc.cxx(2691)
vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 310
	at vcl\inc\salframe.hxx(310)
vclplug_winlo.dll!ImplHandleMouseMsg(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 3292
	at vcl\win\window\salframe.cxx(3292)
vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5688
	at vcl\win\window\salframe.cxx(5688)
vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 6043
	at vcl\win\window\salframe.cxx(6043)
Comment 2 Hossein 2023-08-03 09:04:31 UTC
Created attachment 188739 [details]
Minimal file that causes crash

The structure of one of the headers (header4.xml) in the attachment is like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:hdr ...>
  <w:p ...>
    <w:pPr>
      <w:pStyle w:val="Header"/>
      <w:bidi w:val="0"/>
    </w:pPr>
  </w:p>
</w:hdr>

It contains an extra <w:bidi> tag compared to other headers.
Comment 3 Commit Notification 2023-08-03 09:41:57 UTC
Hossein committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a99a63287f96290f5641a4216432f7b637402ea6

tdf#156560 Fix assertion failure editing RTL header

It will be available in 24.2.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.