Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 04/11/2012 10:44 PM, Kohei Yoshida wrote:
On Wed, 2012-04-11 at 21:29 +0100, Caolán McNamara wrote:
On Wed, 2012-04-11 at 15:56 -0400, Kohei Yoshida wrote:
Hey there,

I'm trying to set up a new unit test for the edit engine core, but
struggling with one crasher.

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6089be1a7a17ae849d8793520e9d8d36296ed5cf should get 
you closer anyway, and into a more "mundane" crash with SfxItemPools

Thanks a lot.  This helps.

Hopefully any fix of yours will also fix the following problem: My local --enable-dbgutil "make check" build keeps failing with a crash in sw_subsequent_rtftok. Valgrind gives

==32152== Invalid read of size 8
==32152==    at 0x12DC7689: SfxItemPool::GetDefaultItem(unsigned short) const 
(/svl/source/items/itempool.cxx:874)
==32152==    by 0x12DC6058: SfxItemPool::Put(SfxPoolItem const&, unsigned short) 
(/svl/source/items/itempool.cxx:681)
==32152==    by 0x12DC5E44: SfxItemPool::Put(SfxPoolItem const&, unsigned short) 
(/svl/source/items/itempool.cxx:663)
==32152==    by 0x12DDD519: SfxItemSet::Put(SfxPoolItem const&, unsigned short) 
(/svl/source/items/itemset.cxx:609)
==32152==    by 0x213CB7E5: SfxItemSet::Put(SfxPoolItem const&) 
(/solver/unxlngx6/inc/svl/itemset.hxx:150)
==32152==    by 0x214DDDA4: sdr::properties::TextProperties::ForceDefaultAttributes() 
(/svx/source/sdr/properties/textproperties.cxx:384)
==32152==    by 0x214DBC82: sdr::properties::DefaultProperties::GetObjectItemSet() const 
(/svx/source/sdr/properties/defaultproperties.cxx:94)
==32152==    by 0x215A02D1: SdrObject::GetObjectItemSet() const (/svx/source/svdraw/svdobj.cxx:1981)
==32152==    by 0x215FB757: SdrTextObj::GetTextLeftDistance() const 
(/svx/source/svdraw/svdotext.cxx:1792)
==32152==    by 0x2161D645: SdrTextObj::NbcResize(Point const&, Fraction const&, Fraction const&) 
(/svx/source/svdraw/svdotxtr.cxx:125)
==32152==    by 0x215ED66E: SdrPathObj::NbcResize(Point const&, Fraction const&, Fraction const&) 
(/svx/source/svdraw/svdopath.cxx:2370)
==32152==    by 0x215EDF95: SdrPathObj::NbcSetSnapRect(Rectangle const&) 
(/svx/source/svdraw/svdopath.cxx:2466)
==32152==    by 0x2159F3A1: SdrObject::SetSnapRect(Rectangle const&) 
(/svx/source/svdraw/svdobj.cxx:1687)
==32152==    by 0x217086D4: 
SvxDrawPage::_CreateSdrObject(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> 
const&) (/svx/source/unodraw/unopage.cxx:518)
==32152==    by 0x2185BF74: 
SvxFmDrawPage::_CreateSdrObject(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> 
const&) (/svx/source/form/fmdpage.cxx:102)
==32152==    by 0x1F39D352: 
SwFmDrawPage::_CreateSdrObject(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> 
const&) (/sw/source/core/unocore/unodraw.cxx:333)
==32152==    by 0x21709CEF: 
SvxDrawPage::CreateSdrObject(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> 
const&) (/svx/source/unodraw/unopage.cxx:850)
==32152==    by 0x217071B0: 
SvxDrawPage::add(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) 
(/svx/source/unodraw/unopage.cxx:246)
==32152==    by 0x1F39ED4F: 
SwXDrawPage::add(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) 
(/sw/source/core/unocore/unodraw.cxx:630)
==32152==    by 0x255DA9D7: writerfilter::rtftok::RTFDocumentImpl::popState() 
(/writerfilter/source/rtftok/rtfdocumentimpl.cxx:3299)
==32152==    by 0x25614308: writerfilter::rtftok::RTFTokenizer::resolveParse() 
(/writerfilter/source/rtftok/rtftokenizer.cxx:110)
==32152==    by 0x255C4960: writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) 
(/writerfilter/source/rtftok/rtfdocumentimpl.cxx:548)
==32152==    by 0x231E0722: 
RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/writerfilter/source/filter/RtfFilter.cxx:99)
==32152==    by 0x1C359018: SfxObjectShell::ImportFrom(SfxMedium&, bool) 
(/sfx2/source/doc/objstor.cxx:2238)
==32152==    by 0x1C351224: SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:730)
==32152==    by 0x1C39E867: 
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/sfx2/source/doc/sfxbasemodel.cxx:1900)
==32152==    by 0x1C3EC76C: 
SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:611)
==32152==    by 0x1A9C5EC5: framework::LoadEnv::impl_loadContent() 
(/framework/source/loadenv/loadenv.cxx:1160)
==32152==    by 0x1A9C2696: framework::LoadEnv::startLoading() 
(/framework/source/loadenv/loadenv.cxx:418)
==32152==    by 0x1A9C150C: 
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, 
com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, rtl::OUString const&, rtl::OUString 
const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/framework/source/loadenv/loadenv.cxx:184)
==32152==    by 0x1A9FFCB0: framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/framework/source/services/desktop.cxx:661)
==32152==    by 0xCA59392: unotest::MacrosTest::loadFromDesktop(rtl::OUString const&) 
(/unotest/source/cpp/macros_test.cxx:53)
==32152==    by 0xC61FB5E: RtfModelTest::load(rtl::OUString const&) 
(/sw/qa/extras/rtftok/rtftok.cxx:120)
==32152==    by 0xC621359: RtfModelTest::testN695479() (/sw/qa/extras/rtftok/rtftok.cxx:228)
==32152==    by 0xC635A92: CppUnit::TestCaller<RtfModelTest>::runTest() 
(/solver/unxlngx6/inc/cppunit/TestCaller.h:166)
==32152==    by 0x4F635BA: CppUnit::TestCaseMethodFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0xBA193C5: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) 
(/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:80)
==32152==    by 0x4F5900A: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F4AF33: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F5900A: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F58E9F: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F72077: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, 
std::string const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F6308B: CppUnit::TestCase::run(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F63E2F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F63CB7: CppUnit::TestComposite::run(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F63E2F: CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F63CB7: CppUnit::TestComposite::run(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F78EFB: CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F71D79: CppUnit::TestResult::runTest(CppUnit::Test*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F7915D: CppUnit::TestRunner::run(CppUnit::TestResult&, std::string const&) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==  Address 0x198697c0 is 16 bytes before a block of size 160 free'd
==32152==    at 0x4A0662E: free 
(/builddir/build/BUILD/valgrind-3.6.1/coregrind/m_replacemalloc/vg_replace_malloc.c:366)
==32152==    by 0x4C43CCC: rtl_freeMemory_SYSTEM(void*) (/sal/rtl/source/alloc_global.cxx:285)
==32152==    by 0x4C43F31: rtl_freeMemory (/sal/rtl/source/alloc_global.cxx:355)
==32152==    by 0x4C6C874: rtl_uString_release (/sal/rtl/source/strtmpl.cxx:1061)
==32152==    by 0x151EC656: rtl::OUString::~OUString() (/solver/unxlngx6/inc/rtl/ustring.hxx:332)
==32152==    by 0x151E5EE2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:304)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151EAF2F: stoc_defreg::NestedKeyImpl::getResolvedName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:1113)
==32152==    by 0x151E5BB2: stoc_defreg::NestedKeyImpl::computeName(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:272)
==32152==    by 0x151E81CA: stoc_defreg::NestedKeyImpl::openKey(rtl::OUString const&) 
(/stoc/source/defaultregistry/defaultregistry.cxx:684)
==32152==    by 0x1520B593: stoc_loader::DllComponentLoader::activate(rtl::OUString const&, rtl::OUString const&, 
rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> const&) 
(/stoc/source/loader/dllcomponentloader.cxx:207)
==32152==    by 0xBF10E94: cppu::ORegistryFactoryHelper::createModuleFactory() 
(/cppuhelper/source/factory.cxx:886)
==32152==    by 0xBF1019B: 
cppu::ORegistryFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const&) (/cppuhelper/source/factory.cxx:736)
==32152==    by 0xBF0EB42: 
cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const&) (/cppuhelper/source/factory.cxx:213)
==32152==    by 0xBF0F5E6: 
cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const&) (/cppuhelper/source/factory.cxx:489)
==32152==    by 0x15247CAF: stoc_smgr::OServiceManager::createInstanceWithContext(rtl::OUString const&, 
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) 
(/stoc/source/servicemanager/servicemanager.cxx:1191)
==32152==    by 0x152484A2: stoc_smgr::OServiceManager::createInstance(rtl::OUString const&) 
(/stoc/source/servicemanager/servicemanager.cxx:1301)
==32152==    by 0x1C39945C: SfxBaseModel::getDocumentProperties() 
(/sfx2/source/doc/sfxbasemodel.cxx:951)
==32152==    by 0x255C26A1: 
writerfilter::rtftok::RTFDocumentImpl::RTFDocumentImpl(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, 
com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, 
com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, 
com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&) (/writerfilter/source/rtftok/rtfdocumentimpl.cxx:292)
==32152==    by 0x255C0B30: 
writerfilter::rtftok::RTFDocumentFactory::createDocument(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, 
com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, 
com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, 
com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&) (/writerfilter/source/rtftok/rtfdocumentfactory.cxx:39)
==32152==    by 0x231E06F2: 
RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/writerfilter/source/filter/RtfFilter.cxx:98)
==32152==    by 0x1C359018: SfxObjectShell::ImportFrom(SfxMedium&, bool) 
(/sfx2/source/doc/objstor.cxx:2238)
==32152==    by 0x1C351224: SfxObjectShell::DoLoad(SfxMedium*) (/sfx2/source/doc/objstor.cxx:730)
==32152==    by 0x1C39E867: 
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/sfx2/source/doc/sfxbasemodel.cxx:1900)
==32152==    by 0x1C3EC76C: 
SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, 
com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) (/sfx2/source/view/frmload.cxx:611)
==32152==    by 0x1A9C5EC5: framework::LoadEnv::impl_loadContent() 
(/framework/source/loadenv/loadenv.cxx:1160)
==32152==    by 0x1A9C2696: framework::LoadEnv::startLoading() 
(/framework/source/loadenv/loadenv.cxx:418)
==32152==    by 0x1A9C150C: 
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, 
com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, rtl::OUString const&, rtl::OUString 
const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/framework/source/loadenv/loadenv.cxx:184)
==32152==    by 0x1A9FFCB0: framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) 
(/framework/source/services/desktop.cxx:661)
==32152==    by 0xCA59392: unotest::MacrosTest::loadFromDesktop(rtl::OUString const&) 
(/unotest/source/cpp/macros_test.cxx:53)
==32152==    by 0xC61FB5E: RtfModelTest::load(rtl::OUString const&) 
(/sw/qa/extras/rtftok/rtftok.cxx:120)
==32152==    by 0xC621359: RtfModelTest::testN695479() (/sw/qa/extras/rtftok/rtftok.cxx:228)
==32152==    by 0xC635A92: CppUnit::TestCaller<RtfModelTest>::runTest() 
(/solver/unxlngx6/inc/cppunit/TestCaller.h:166)
==32152==    by 0x4F635BA: CppUnit::TestCaseMethodFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0xBA193C5: (anonymous namespace)::Prot::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) 
(/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:80)
==32152==    by 0x4F5900A: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F4AF33: CppUnit::DefaultProtector::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F5900A: CppUnit::ProtectorChain::ProtectFunctor::operator()() const (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F58E9F: CppUnit::ProtectorChain::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F72077: CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, 
std::string const&) (in /data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)
==32152==    by 0x4F6308B: CppUnit::TestCase::run(CppUnit::TestResult*) (in 
/data/lo/core/solver/unxlngx6/lib/libcppunit-1.12.so.1)

Looking into the GetDefaultItem call, it gets to the bottom "return **(pImp->ppStaticDefaults + nPos);", nPos is 14, pImp->aName is "EditEngineItemPool" and pImp->ppStaticDefaults apparently points to junk.

Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.