diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-09-14 12:27:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-09-14 16:30:19 +0200 |
commit | 3076912419ddea4e1910a26e7c024cef4405dc5c (patch) | |
tree | 236649828c6eaffe099dcfd8b20f00f55974cfbe /unotools | |
parent | de57562e3b11b64d95344a4ebaaf53607e7bc373 (diff) |
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>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 2 |
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(); |