[Libreoffice-bugs] [Bug 140962] New: [FILESAVE] Saving a Writer document containing an inaccessible UNC link as HTML takes 33 seconds

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Mar 11 19:04:57 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=140962

            Bug ID: 140962
           Summary: [FILESAVE] Saving a Writer document containing an
                    inaccessible UNC link as HTML takes 33 seconds
           Product: LibreOffice
           Version: 7.0.4.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: thomas.kraemer at posteo.de

Saving a Writer document containing an inaccessible UNC link as HTML takes 33
seconds on Windows because of the following call to FindFirstFileW in
core\sal\osl\w32\file_dirvol.cxx:1084:

hFind = FindFirstFileW( o3tl::toW(rtl_uString_getStr(strSysFilePath)),
&aFindData );
(https://git.libreoffice.org/core/+/refs/heads/libreoffice-7-0-4/sal/osl/w32/file_dirvol.cxx#1084)

FindFirstFileW does not return for about 33 seconds. It then returns
0xffffffffffffffff. GetLastError() returns ERROR_BAD_NETPATH (53) which is
translated to osl_File_E_NOENT.

The call occurs while normalizing the links contained in the document before
saving it as HTML:
>	sal3.dll!osl_getDirectoryItem(_rtl_uString * strFilePath, void * * pItem) row 1084	C++
> 	[Inlineframe] ucpfile1.dll!osl::DirectoryItem::get(const rtl::OUString &) row 1529	C++
> 	ucpfile1.dll!fileaccess::TaskManager::getv(long CommandId, const rtl::OUString & aUnqPath, const com::sun::star::uno::Sequence<com::sun::star::beans::Property> & properties) row 1083	C++
> 	ucpfile1.dll!fileaccess::BaseContent::getPropertyValues(long nMyCommandIdentifier, const com::sun::star::uno::Sequence<com::sun::star::beans::Property> & PropertySet) row 687	C++
> 	ucpfile1.dll!fileaccess::BaseContent::execute(const com::sun::star::ucb::Command & aCommand, long CommandId, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & Environment) row 302	C++
> 	svllo.dll!`anonymous namespace'::normalizePrefix(const com::sun::star::uno::Reference<com::sun::star::ucb::XUniversalContentBroker> & broker, const rtl::OUString & uri, rtl::OUString * normalized) row 149	C++
> 	svllo.dll!`anonymous namespace'::normalize(const com::sun::star::uno::Reference<com::sun::star::ucb::XUniversalContentBroker> & broker, const com::sun::star::uno::Reference<com::sun::star::uri::XUriReferenceFactory> & uriFactory, const rtl::OUString & uriReference) row 180	C++
> 	svllo.dll!URIHelper::normalizedMakeRelative(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> & context, const rtl::OUString & baseUriReference, const rtl::OUString & uriReference) row 264	C++
> 	svllo.dll!URIHelper::simpleNormalizedMakeRelative(const rtl::OUString & baseUriReference, const rtl::OUString & uriReference) row 273	C++
> 	swlo.dll!SwHTMLWriter::convertHyperlinkHRefValue(const rtl::OUString & rURL) row 1260	C++
> 	swlo.dll!SwHTMLWriter::OutHyperlinkHRefValue(const rtl::OUString & rURL) row 1265	C++
> 	swlo.dll!OutHTML_INetFormat(Writer & rWrt, const SwFormatINetFormat & rINetFormat, bool bOn) row 3017	C++
> 	swlo.dll!OutHTML_SwFormatINetFormat(Writer & rWrt, const SfxPoolItem & rHt) row 3076	C++
> 	swlo.dll!Out(Writer &(*)(Writer &, const SfxPoolItem &) * pTab, const SfxPoolItem & rHt, Writer & rWrt) row 40	C++
> 	swlo.dll!`anonymous namespace'::HTMLEndPosLst::OutStartAttrs(SwHTMLWriter & rHWrt, long nPos, HTMLOutContext * pContext) row 1935	C++
> 	swlo.dll!OutHTML_SwTextNode(Writer & rWrt, const SwContentNode & rNode) row 2427	C++
> 	swlo.dll!SwHTMLWriter::Out_SwDoc(SwPaM * pPam) row 834	C++
> 	swlo.dll!SwHTMLWriter::WriteStream() row 471	C++
> 	swlo.dll!Writer::Write(SwPaM & rPaM, SvStream & rStrm, const rtl::OUString * pFName) row 272	C++
> 	swlo.dll!Writer::Write(SwPaM & rPam, SfxMedium & rMedium, const rtl::OUString * pFileName) row 286	C++
> 	swlo.dll!SwWriter::Write(const tools::SvRef<Writer> & rxWriter, const rtl::OUString * pRealFileName) row 859	C++
> 	swlo.dll!SwDocShell::ConvertTo(SfxMedium & rMedium) row 782	C++
> 	sfxlo.dll!SfxObjectShell::SaveTo_Impl(SfxMedium & rMedium, const SfxItemSet * pSet) row 1553	C++
> 	sfxlo.dll!SfxObjectShell::DoSave_Impl(const SfxItemSet * pArgs) row 2565	C++
> 	sfxlo.dll!SfxObjectShell::Save_Impl(const SfxItemSet * pSet) row 2635	C++
> 	sfxlo.dll!SfxBaseModel::storeSelf(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & aSeqArgs) row 1631	C++
> 	sfxlo.dll!SfxBaseModel::impl_store(const rtl::OUString & sURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & seqArguments, bool bSaveTo) row 2994	C++
> 	sfxlo.dll!SfxBaseModel::storeAsURL(const rtl::OUString & rURL, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & rArgs) row 1685	C++
>...

Steps to reproduce:
1. Open LibreOffice Writer 7.0.4.2 on Windows 10
2. insert a UNC link to a reachable but inacessible shared folder (e.g.
"\\foo.bar.net\some_directory\another_directory")
3. Save document as "HTML Document (Writer)"

Unfortunately, I am currently unable to provide an example link. All examples
known to me are only available inside private networks. They all feature host
names which can be resolved via DNS and react to pings but time out when trying
to access them with Chrome or the Windows Explorer.

Is there a way to normalize the links without sending requests to the
associated resources? All it seems to do in my case is to turn backslashes into
slashes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210311/8fe8753c/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list