Bug 151187 - Crash when exporting ODS file with Persian text to PDF
Summary: Crash when exporting ODS file with Persian text to PDF
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks: 151184
  Show dependency treegraph
 
Reported: 2022-09-26 12:04 UTC by Hossein
Modified: 2022-09-27 20:15 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 Hossein 2022-09-26 12:04:02 UTC
Description:
While working on tdf#151184, I noticed that exporting the sample ODS file with Persian text (attachment 182676 [details]) leads to a crash.

Steps to Reproduce:
1. Open attachment 182676 [details], which is an ODS file
2. Export to PDF

Actual Results:
Crash

Expected Results:
Not crashing

Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 92166dba58980fddb234cd7069694cbbca69a8f7
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Timur 2022-09-26 13:07:10 UTC
Not with 7.5+ Build ID: bb47ffbc9d36e83695aa0d01767d3f83533c04e0 VCL: x11 or gtk3
So please try with new profile.
Comment 2 Timur 2022-09-26 13:32:35 UTC
If still crashes with new profile, please share PDF export setting.
Comment 3 ⁨خالد حسني⁩ 2022-09-26 15:18:28 UTC
Reproduced, you need to install the Vezir font (from bug 151184).

CC Caolán, I think he was working on this code lately.

Traceback:

    frame #0: 0x00007ff81eed800e libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007ff81ef0e1ff libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007ff81ee59d24 libsystem_c.dylib`abort + 123
    frame #3: 0x00007ff81ee590cb libsystem_c.dylib`__assert_rtn + 314
  * frame #4: 0x00000001160c954f libvcllo.dylib`ImplSubPixelToLogic(bCheck=true, n=1661.4015748031495, nDPI=720, nMapNum=1, nMapDenom=2540) at map.cxx:290:5
    frame #5: 0x00000001160c92fc libvcllo.dylib`OutputDevice::SubPixelToLogic(this=0x000000013041e000, rDevicePt=0x0000000191cd8310, bCheck=true) const at map.cxx:1189:18
    frame #6: 0x000000011631d53f libvcllo.dylib`vcl::PDFWriterImpl::drawHorizontalGlyphs(this=0x000000013041e000, rGlyphs=size=22, rLine=0x00007ff7bfef3ab8, rAlignOffset=0x00007ff7bfef3880, bFirst=true, fAngle=0, fXScale=1, fSkew=0, nFontHeight=353, nPixelFontHeight=100) at pdfwriter_impl.cxx:6377:23
    frame #7: 0x000000011631b729 libvcllo.dylib`vcl::PDFWriterImpl::drawLayout(this=0x000000013041e000, rLayout=0x0000600003b3da40, rText=0x0000600002776000, bTextLines=true, bCheckSubPixelToLogic=true) at pdfwriter_impl.cxx:6750:17
    frame #8: 0x000000011631fd40 libvcllo.dylib`vcl::PDFWriterImpl::drawTextArray(this=0x000000013041e000, rPos=0x0000600002775ff0, rText=0x0000600002776000, pDXArray=span<const int> @ 0x00007ff7bfef3bf0, pKashidaArray=(data_ = 0x0000000000000000, size_ = 0), nIndex=0, nLen=22) at pdfwriter_impl.cxx:6962:9
    frame #9: 0x00000001162c11ff libvcllo.dylib`vcl::PDFWriter::DrawTextArray(this=0x00007ff7bfef6438, rStartPt=0x0000600002775ff0, rStr=0x0000600002776000, pDXAry=span<const int> @ 0x00007ff7bfef3c88, pKashidaAry=(data_ = 0x0000000000000000, size_ = 0), nIndex=0, nLen=22) at pdfwriter.cxx:89:22
    frame #10: 0x00000001162c75b0 libvcllo.dylib`vcl::PDFWriterImpl::playMetafile(this=0x000000013041e000, i_rMtf=0x00007ff7bfef56a0, i_pOutDevData=0x00007ff7bfef63a8, i_rContext=0x00007ff7bfef56f8, pDummyVDev=0x0000000191cd6060) at pdfwriter_impl2.cxx:816:34
    frame #11: 0x00000001162c297a libvcllo.dylib`vcl::PDFWriter::PlayMetafile(this=0x00007ff7bfef6438, i_rMTF=0x00007ff7bfef56a0, i_rPlayContext=0x00007ff7bfef56f8, i_pData=0x00007ff7bfef63a8) at pdfwriter.cxx:466:22
    frame #12: 0x00000001a203bc53 libpdffilterlo.dylib`PDFExport::ImplExportPage(this=0x00007ff7bfef6ca0, rWriter=0x00007ff7bfef6438, rPDFExtOutDevData=0x00007ff7bfef63a8, rMtf=0x00007ff7bfef5c70) at pdfexport.cxx:1139:13
    frame #13: 0x00000001a203ae25 libpdffilterlo.dylib`PDFExport::ExportSelection(this=0x00007ff7bfef6ca0, rPDFWriter=0x00007ff7bfef6438, rRenderable=0x00007ff7bfef6580, rSelection=0x00007ff7bfef6558, rRangeEnum=0x00007ff7bfef65a8, rRenderOptions=0x00007ff7bfef63a0, nPageCount=1) at pdfexport.cxx:248:25
    frame #14: 0x00000001a2040f49 libpdffilterlo.dylib`PDFExport::Export(this=0x00007ff7bfef6ca0, rFile=0x00007ff7bfef6fc0, rFilterData=0x00007ff7bfef6f38) at pdfexport.cxx:994:28
    frame #15: 0x00000001a20573d3 libpdffilterlo.dylib`PDFFilter::implExport(this=0x000060000276dd40, rDescriptor=0x00007ff7bfef74d0) at pdffilter.cxx:185:24
    frame #16: 0x00000001a2057f6c libpdffilterlo.dylib`PDFFilter::filter(this=0x000060000276dd40, rDescriptor=0x00007ff7bfef74d0) at pdffilter.cxx:248:23
    frame #17: 0x000000010936cf0a libsfxlo.dylib`SfxObjectShell::ExportTo(this=0x0000000191c323a0, rMedium=0x00006000005fb860) at objstor.cxx:2494:25
    frame #18: 0x0000000109368698 libsfxlo.dylib`SfxObjectShell::SaveTo_Impl(this=0x0000000191c323a0, rMedium=0x00006000005fb860, pSet=0x0000000000000000) at objstor.cxx:1562:19
    frame #19: 0x0000000109375ac9 libsfxlo.dylib`SfxObjectShell::PreDoSaveAs_Impl(this=0x0000000191c323a0, rFileName=0x00007ff7bfef8d20, aFilterName=0x00007ff7bfef9138, rItemSet=0x00007ff7bfef99c8, rArgs=0x00007ff7bfefa370) at objstor.cxx:2981:39
    frame #20: 0x0000000109373ae8 libsfxlo.dylib`SfxObjectShell::CommonSaveAs_Impl(this=0x0000000191c323a0, aURL=0x00007ff7bfef9150, aFilterName=0x00007ff7bfef9138, rItemSet=0x00007ff7bfef99c8, rArgs=0x00007ff7bfefa370) at objstor.cxx:2771:9
    frame #21: 0x0000000109346747 libsfxlo.dylib`SfxObjectShell::APISaveAs_Impl(this=0x0000000191c323a0, aFileName=(__data = u"file:///Users/khaled/Development/attic/attic/libreoffice/a%20Spressheet%20Test.pdf", __size = 82), rItemSet=0x00007ff7bfef99c8, rArgs=0x00007ff7bfefa370) at objserv.cxx:318:19
    frame #22: 0x00000001093ccd92 libsfxlo.dylib`SfxBaseModel::impl_store(this=0x0000000191c33520, sURL=0x00007ff7bfefa3c0, seqArguments=0x00007ff7bfefa370, bSaveTo=true) at sfxbasemodel.cxx:3146:42
    frame #23: 0x00000001093ce49e libsfxlo.dylib`SfxBaseModel::storeToURL(this=0x0000000191c33520, rURL=0x00007ff7bfefa3c0, rArgs=0x00007ff7bfefa370) at sfxbasemodel.cxx:1782:13
    frame #24: 0x0000000100e035bb libsofficeapp.dylib`desktop::DispatchWatcher::executeDispatchRequests(this=0x0000600001b4aa00, aDispatchRequestsList=size=1, bNoTerminate=false) at dispatchwatcher.cxx:676:48
    frame #25: 0x0000000100e1eb77 libsofficeapp.dylib`desktop::RequestHandler::ExecuteCmdLineRequests(aRequest=0x00007ff7bfefba30, noTerminate=false) at officeipcthread.cxx:1355:38
    frame #26: 0x0000000100db76de libsofficeapp.dylib`desktop::Desktop::OpenClients() at app.cxx:2133:14
    frame #27: 0x0000000100db55a7 libsofficeapp.dylib`desktop::Desktop::OpenClients_Impl(this=0x00007ff7bfefe7b8, (null)=0x0000000000000000) at app.cxx:1913:5
    frame #28: 0x0000000100db264d libsofficeapp.dylib`desktop::Desktop::LinkStubOpenClients_Impl(instance=0x00007ff7bfefe7b8, data=0x0000000000000000) at app.cxx:1897:1
    frame #29: 0x0000000115e357c8 libvcllo.dylib`Link<void*, void>::Call(this=0x000060000227e948, data=0x0000000000000000) const at link.hxx:111:45
    frame #30: 0x0000000115e316f9 libvcllo.dylib`ImplHandleUserEvent(pSVEvent=0x000060000227e940) at winproc.cxx:2287:30
    frame #31: 0x0000000115e2e0e3 libvcllo.dylib`ImplWindowFrameProc(_pWindow=0x0000600002911880, nEvent=UserEvent, pEvent=0x000060000227e940) at winproc.cxx:2857:13
    frame #32: 0x000000010e9ef4e0 libvclplug_osxlo.dylib`SalFrame::CallCallback(this=0x000000010e60abf0, nEvent=UserEvent, pEvent=0x000060000227e940) const at salframe.hxx:306:29
    frame #33: 0x000000010ea07cc7 libvclplug_osxlo.dylib`AquaSalInstance::ProcessEvent(this=0x0000600003d0c1e0, aEvent=(m_pFrame = 0x000000010e60abf0, m_pData = 0x000060000227e940, m_nEvent = UserEvent)) at salinst.cxx:390:22
    frame #34: 0x00000001165af79e libvcllo.dylib`SalUserEventList::DispatchUserEvents(this=0x00007ff7bfefccb0)::$_0::operator()() const at salusereventlist.cxx:119:58
    frame #35: 0x00000001165af1aa libvcllo.dylib`SalUserEventList::DispatchUserEvents(this=0x0000600003d0c1e0, bHandleAllCurrentEvents=false) at salusereventlist.cxx:120:13
    frame #36: 0x000000010ea088bd libvclplug_osxlo.dylib`AquaSalInstance::DoYield(this=0x0000600003d0c1e0, bWait=true, bHandleAllCurrentEvents=false) at salinst.cxx:526:22
    frame #37: 0x0000000116685020 libvcllo.dylib`ImplYield(i_bWait=true, i_bAllEvents=false) at svapp.cxx:475:48
    frame #38: 0x000000011668497c libvcllo.dylib`Application::Yield() at svapp.cxx:559:5
    frame #39: 0x0000000116684740 libvcllo.dylib`Application::Execute() at svapp.cxx:453:13
    frame #40: 0x0000000100daf34b libsofficeapp.dylib`desktop::Desktop::Main(this=0x00007ff7bfefe7b8) at app.cxx:1604:13
    frame #41: 0x00000001166a8165 libvcllo.dylib`ImplSVMain() at svmain.cxx:203:35
    frame #42: 0x000000010ea07df6 libvclplug_osxlo.dylib`AquaSalInstance::handleAppDefinedEvent(pEvent=0x0000600003714000) at salinst.cxx:411:20
    frame #43: 0x000000010eaa9e0e libvclplug_osxlo.dylib`-[VCL_NSApplication sendEvent:](self=0x000000010e504ec0, _cmd="sendEvent:", pEvent=0x0000600003714000) at vclnsapp.mm:89:9
    frame #44: 0x00007ff821e3518b AppKit`-[NSApplication _handleEvent:] + 65
    frame #45: 0x00007ff8219fdd3e AppKit`-[NSApplication run] + 623
    frame #46: 0x00007ff8219d1c97 AppKit`NSApplicationMain + 817
    frame #47: 0x000000010ea0c731 libvclplug_osxlo.dylib`AquaSalInstance::SVMainHook(this=0x0000600003d0c1e0, pnInit=0x00007ff7bfefe704) at salinst.cxx:976:5
    frame #48: 0x00000001166a812a libvcllo.dylib`ImplSVMain() at svmain.cxx:196:54
    frame #49: 0x00000001166a9e89 libvcllo.dylib`SVMain() at svmain.cxx:235:12
    frame #50: 0x0000000100e34434 libsofficeapp.dylib`soffice_main at sofficemain.cxx:94:12
    frame #51: 0x0000000100003f5d soffice`sal_main at main.c:51:15
    frame #52: 0x0000000100003f37 soffice`main(argc=4, argv=0x00007ff7bfefe9e8) at main.c:49:1
    frame #53: 0x000000010001152e dyld`start + 462
Comment 4 Caolán McNamara 2022-09-26 16:23:00 UTC
its an assert, rather than a crash, so only visible in the NDEBUG dev builds
Comment 5 Commit Notification 2022-09-27 20:14:57 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8361df4cf3728ef5e98b6c95a06a4bc829c8fd44

tdf#151187 don't check glyph substitute positions

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