summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-09-14 12:27:19 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-09-15 16:55:54 +0200
commit5ef6543e9e9cc3bb4b449027d0dcfbef87315efd (patch)
treefae276cde348c6054ef27ef5f1b82fe4a9c6f1c6
parentConditional jump or move depends on uninitialised value (diff)
downloadcore-5ef6543e9e9cc3bb4b449027d0dcfbef87315efd.tar.gz
core-5ef6543e9e9cc3bb4b449027d0dcfbef87315efd.zip
crashtesting: SvMemoryStream::PutData assert
crashtesting logs contain a pile of SvMemoryStream::PutData assert failures with the last ~90 documents some experimentation suggests that the fallback path in TempFile::GetStream is getting taken to use a SvMemoryStream if there was no filename. presumably there is no filename because there is no inodes left in /tmp (see. https://gerrit.libreoffice.org/c/core/+/139881 to remove left over OSL_PIPE when killed) or some other similar problem. But the SvMemoryStream ctor used gives a Stream which cannot be written to because it's given an empty buffer to use and isn't allowed to resize it. this went wrong at: commit 7f8f277b94704a289fbbd1b836e4e5d66311580d Date: Wed Jan 7 09:28:42 2015 +0200 fdo#84938: convert STREAM_ #defines to 'enum class' with - pStream = new SvMemoryStream( eMode ); + pStream = new SvMemoryStream( NULL, 0, eMode ); which selected ctor a) SvMemoryStream(void* pBuf, std::size_t nSize, StreamMode eMode); Previously eMode was just a sal_uInt16 typedef and this gave a fairly arbitrary but useable nInitSize to select the other ctor of b) SvMemoryStream(std::size_t nInitSize=512, std::size_t nResize=64); Using eMode as nInitSize was bogus and worked by chance, that was introduced with: commit 160f790791d6e839919f0d0f9277cb047fe020ae Date: Mon Oct 4 19:30:08 2004 +0000 INTEGRATION: CWS mav09 (1.14.114); FILE MERGED 2004/07/08 08:29:38 mav 1.14.114.3: RESYNC: (1.15-1.17); FILE MERGED 2004/04/29 16:50:04 mav 1.14.114.2: RESYNC: (1.14-1.15); FILE MERGED 2004/04/29 11:03:41 mba 1.14.114.1: #i27773#: no SvFileStream please Change-Id: I23ca3e8033400f6b016a802037dad3443df8af34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139926 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 3076912419ddea4e1910a26e7c024cef4405dc5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139975 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 83a523a2bd9b..faca685d2676 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -429,7 +429,7 @@ SvStream* TempFile::GetStream( StreamMode eMode )
if (!aName.isEmpty())
pStream.reset(new SvFileStream(aName, eMode | StreamMode::TEMPORARY));
else
- pStream.reset(new SvMemoryStream(nullptr, 0, eMode));
+ pStream.reset(new SvMemoryStream);
}
return pStream.get();