Hi, <br><br>The rtfexport subsequent test was failing with a segfault for me. <br>I used EXPORT DEBUGCPPUNIT=TRUE <br><br>and got the following stack trace: <br><br>Program received signal SIGSEGV, Segmentation fault.<br>
0x478bb2d7 in RtfAttributeOutput::WriteHex(unsigned char const*, unsigned long, SvStream*, unsigned long) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#0 0x478bb2d7 in RtfAttributeOutput::WriteHex(unsigned char const*, unsigned long, SvStream*, unsigned long) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#1 0x478bb7ee in ExportPICT(SwFlyFrmFmt const*, Size const&, Size const&, Size const&, SwCropGrf const&, char const*, unsigned char const*, unsigned long, RtfExport const&, SvStream*) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#2 0x478bc01b in RtfAttributeOutput::FlyFrameOLEReplacement(SwFlyFrmFmt const*, SwOLENode&, Size const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#3 0x478bc2d9 in RtfAttributeOutput::FlyFrameOLEMath(SwFlyFrmFmt const*, SwOLENode&, Size const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#4 0x478bc3f9 in RtfAttributeOutput::FlyFrameOLE(SwFlyFrmFmt const*, SwOLENode&, Size const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#5 0x478c0fa8 in RtfAttributeOutput::OutputFlyFrame_Impl(sw::Frame const&, Point const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#6 0x4790bd0c in AttributeOutputBase::TextFlyContent(SwFmtFlyCnt const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#7 0x479105d7 in AttributeOutputBase::OutputItem(SfxPoolItem const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#8 0x479117a9 in MSWordExportBase::ExportPoolItemsToCHP(std::map<unsigned short, SfxPoolItem const*, sw::util::ItemSort, std::allocator<std::pair<unsigned short const, SfxPoolItem const*> > >&, unsigned short) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#9 0x478e7c7e in SwWW8AttrIter::OutAttr(unsigned short, bool) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>#10 0x478e9d03 in MSWordExportBase::OutputTextNode(SwTxtNode const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br>
#11 0x478c5c6e in RtfExport::OutputTextNode(SwTxtNode const&) () from /home/jlcastle/LibOdev/libo/solver/<a href="http://unxlngi6.pro/lib/libmswordlo.so" target="_blank">unxlngi6.pro/lib/libmswordlo.so</a><br><br>I poked around looking at buffers and sizes and made this correction before a call that matches #1: <br>
<br>diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx<br>index 36d1cea..9a65c42 100644<br>--- a/sw/source/filter/ww8/rtfattributeoutput.cxx<br>+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx<br>
@@ -3347,7 +3347,7 @@ void RtfAttributeOutput::FlyFrameOLEReplacement(const SwFlyFrmFmt* pFlyFrmFmt, S<br><br><< edited and inserted more code here for full context...<br><br> const sal_uInt8* pGraphicAry = 0;<br>
SvMemoryStream aStream;<br> if (GraphicConverter::Export(aStream, *pGraphic, CVT_PNG) != ERRCODE_NONE)<br> OSL_FAIL("failed to export the graphic");<br> aStream.Seek(STREAM_SEEK_TO_END);<br> sal_uInt32 nSize = aStream.Tell();<br>
<br> pGraphicAry = (sal_uInt8*)aStream.GetData();<br><br> m_aRunText->append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));<br> m_aRunText->append("}"); // shppict<br>
m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT);<br> pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;<br> SvMemoryStream aWmfStream;<br> if (GraphicConverter::Export(aWmfStream, *pGraphic, CVT_WMF) != ERRCODE_NONE)<br>
OSL_FAIL("failed to export the graphic");<br> aWmfStream.Seek(STREAM_SEEK_TO_END);<br> nSize = aWmfStream.Tell();<br><br>- pGraphicAry = (sal_uInt8*)aStream.GetData();<br>+ pGraphicAry = (sal_uInt8*)aWmfStream.GetData();<br>
<br> m_aRunText->append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport ));<br> m_aRunText->append("}"); // nonshppict<br>}<br><br>Basically, fix a typo. rtfexport test now passes instead of crashes.<br>
<br>I got myself sideways with gerrit or I would have submitted this there. <br>Submitting patch here so that no one else has to be stuck with the broken subsequent test. <br><br>One question I have is: <br>Should I open a new bug for the rtfexport subsequent test failure? <br>
I will certainly open one if it comes back for me, but should I open one for this patch? <br><br>Plugging back in, <br>LeMoyne<br><br>