Apache OpenOffice (AOO) Bugzilla – Issue 17788
patches for sparc linux gcc-3.3 spreadsheet crashes
Last modified: 2004-02-20 10:58:37 UTC
would someone commit my patches please? sparc linux gcc-3.3 30/7/03 cvs gcc.gnu.org Moving from gcc-3.2.3 to gcc-3.3 two new files in module sc that need be build with no optimisation. the patches are attached. the backtraces are below. cells.patch for sc/source/uni/unoobj/cellsuno.cxx token.patch for sc/source/core/tool/token.cxx cells ======== Program received signal SIGBUS, Bus error. [Switching to Thread 16384 (LWP 4213)] 0x7b1acb04 in ScCellObj::SetFormulaResultDouble(double) () from ./libsc645ls.so (gdb) where #0 0x7b1acb04 in ScCellObj::SetFormulaResultDouble(double) () from ./libsc645ls.so #1 0x7b4f4cd0 in ScXMLTableRowCellContext::EndElement() () from ./libsc645ls.so #2 0x76e7b31c in SvXMLImport::endElement(rtl::OUString const&) () from ./libxo645ls.so #3 0x734ccf5c in sax_expatwrap::SaxExpatParser_Impl::callbackEndElement(void*, unsigned short const*) () from ./sax.uno.so #4 0x734d7354 in doContent () from ./sax.uno.so #5 0x734d68c0 in contentProcessor () from ./sax.uno.so #6 0x734d8938 in doProlog () from ./sax.uno.so #7 0x734d86a8 in prologProcessor () from ./sax.uno.so #8 0x734d865c in prologInitProcessor () from ./sax.uno.so #9 0x734d6450 in XML_Parse () from ./sax.uno.so #10 0x734cc614 in sax_expatwrap::SaxExpatParser_Impl::parse() () from ./sax.uno.so #11 0x734cb63c in sax_expatwrap::SaxExpatParser::parseStream(com::sun::star::xml::sax::InputSource const&) () from ./sax.uno.so #12 0x7b4c213c in ScXMLImportWrapper::ImportFromComponent(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>&, com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, com::sun::star::xml::sax::InputSource&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any>&, unsigned char) () from ./libsc645ls.so #13 0x7b4c36d4 in ScXMLImportWrapper::Import(unsigned char) () from ./libsc645ls.so #14 0x7afc3d1c in ScDocShell::LoadXML(SfxMedium*, SvStorage*) () from ./libsc645ls.so #15 0x7afc3ef4 in ScDocShell::Load(SvStorage*) () from ./libsc645ls.so #16 0x7afc9294 in virtual thunk to ScDocShell::Load(SvStorage*) () from ./libsc645ls.so #17 0x769a86c4 in SfxObjectShell::LoadOwnFormat(SfxMedium&) () from ./libsfx645ls.so #18 0x7699ee10 in SfxObjectShell::DoLoad(SfxMedium*) () from ./libsfx645ls.so #19 0x76920884 in LoadEnvironment_Impl::Load(SfxObjectFactory const*) () from ./libsfx645ls.so ---Type <return> to continue, or q <return> to quit--- #20 0x7692258c in LoadEnvironment_Impl::LoadDataAvailable() () from ./libsfx645ls.so #21 0x769227e4 in LoadEnvironment_Impl::LoadDataAvailable() () from ./libsfx645ls.so #22 0x7691fcec in LoadEnvironment_Impl::Start() () from ./libsfx645ls.so #23 0x769ff224 in 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&) () from ./libsfx645ls.so #24 0x74808ecc in framework::BaseDispatcher::implts_loadIt(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Any const&) () from ./libfwk645ls.so #25 0x7480f4d8 in framework::BlankDispatcher::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libfwk645ls.so #26 0x7480379c in framework::BaseDispatcher::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) () from ./libfwk645ls.so #27 0x7481c004 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, long, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libfwk645ls.so #28 0x768f1920 in SfxApplication::OpenDocExec_Impl(SfxRequest&) () from ./libsfx645ls.so #29 0x768f462c in SfxStubSfxApplicationOpenDocExec_Impl(SfxShell*, SfxRequest&) () from ./libsfx645ls.so #30 0x76a51570 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, unsigned char) () from ./libsfx645ls.so #31 0x76a52ab0 in SfxDispatcher::_Execute(SfxShell&, SfxSlot const&, SfxRequest&, unsigned short) () from ./libsfx645ls.so #32 0x76a53a5c in SfxDispatcher::Execute(unsigned short, unsigned short, SfxPoolItem const**, unsigned short, SfxPoolItem const**) () from ./libsfx645ls.so ---Type <return> to continue, or q <return> to quit--- #33 0x76a4ac24 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) () from ./libsfx645ls.so #34 0x76a49c20 in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libsfx645ls.so #35 0x748626fc in framework::MenuManager::Select(Menu*) () from ./libfwk645ls.so #36 0x74861a7c in framework::MenuManager::LinkStubSelect(void*, void*) () from ./libfwk645ls.so #37 0x701e66b4 in Menu::Select() () from ./libvcl645ls.so #38 0x701ea1e8 in Menu::ImplCallSelect(Menu*) () from ./libvcl645ls.so #39 0x701ea1c8 in Menu::LinkStubImplCallSelect(void*, void*) () from ./libvcl645ls.so #40 0x702302c8 in ImplHandleUserEvent(ImplSVEvent*) () from ./libvcl645ls.so #41 0x70230aec in ImplWindowFrameProc(void*, SalFrame*, unsigned short, void const*) () from ./libvcl645ls.so #42 0x7028bf48 in SalFrameData::HandleClientMessage(XClientMessageEvent*) () from ./libvcl645ls.so #43 0x7028c948 in SalFrameData::Dispatch(_XEvent*) () from ./libvcl645ls.so #44 0x702b73dc in SalDisplay::Dispatch(_XEvent*) () from ./libvcl645ls.so #45 0x702b7018 in SalDisplay::Yield(unsigned char) () from ./libvcl645ls.so #46 0x702b323c in DisplayYield(int, SalDisplay*) () from ./libvcl645ls.so #47 0x702b13a8 in SalXLib::Yield(unsigned char) () from ./libvcl645ls.so #48 0x702bab20 in SalInstance::Yield(unsigned char) () from ./libvcl645ls.so #49 0x700f6144 in Application::Yield() () from ./libvcl645ls.so #50 0x700f6024 in Application::Execute() () from ./libvcl645ls.so #51 0x0002b86c in desktop::Desktop::Main() () #52 0x700faff4 in SVMain() () from ./libvcl645ls.so #53 0x702afd48 in main () from ./libvcl645ls.so #54 0x7158ce0c in __libc_start_main () from /lib/libc.so.6 (gdb) step Single stepping until exit from function _ZN9ScCellObj22SetFormulaResultDoubleEd, which has no line number information. sh: line 1: crash_report: command not found ===== token ====== Program received signal SIGBUS, Bus error. [Switching to Thread 16384 (LWP 27342)] 0x7abcb7f8 in ScTokenArray::AddDouble(double) () from ./libsc645ls.so (gdb) where #0 0x7abcb7f8 in ScTokenArray::AddDouble(double) () from ./libsc645ls.so #1 0x7ac5b168 in TokenPool::GetElementRek(unsigned short) () from ./libsc645ls.so #2 0x7ac5b0f0 in TokenPool::GetElementRek(unsigned short) () from ./libsc645ls.so #3 0x7ac5b03c in TokenPool::GetElement(unsigned short) () from ./libsc645ls.so #4 0x7ac58c50 in ExcelToSc8::Convert(ScTokenArray const*&, unsigned long, FORMULA_TYPE) () from ./libsc645ls.so #5 0x7ac474a0 in ImportExcel::Shrfmla() () from ./libsc645ls.so #6 0x7ac428c0 in ImportExcel8::Read() () from ./libsc645ls.so #7 0x7ac4ebb8 in ScImportExcel(SfxMedium&, ScDocument*, EXCIMPFORMAT) () from ./libsc645ls.so #8 0x7a79fe00 in ScDocShell::ConvertFrom(SfxMedium&) () from ./libsc645ls.so #9 0x7699f088 in SfxObjectShell::DoLoad(SfxMedium*) () from ./libsfx645ls.so #10 0x76920884 in LoadEnvironment_Impl::Load(SfxObjectFactory const*) () from ./libsfx645ls.so #11 0x7692258c in LoadEnvironment_Impl::LoadDataAvailable() () from ./libsfx645ls.so #12 0x769227e4 in LoadEnvironment_Impl::LoadDataAvailable() () from ./libsfx645ls.so #13 0x7691fcec in LoadEnvironment_Impl::Start() () from ./libsfx645ls.so #14 0x769ff224 in 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&) () from ./libsfx645ls.so #15 0x74808ecc in framework::BaseDispatcher::implts_loadIt(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, com::sun::star::uno::Any const&) () from ./libfwk645ls.so #16 0x7480f4d8 in framework::BlankDispatcher::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libfwk645ls.so #17 0x7480379c in framework::BaseDispatcher::dispatchWithNotification(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener>---Type <return> to continue, or q <return> to quit--- const&) () from ./libfwk645ls.so #18 0x7481c004 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, long, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libfwk645ls.so #19 0x768f1920 in SfxApplication::OpenDocExec_Impl(SfxRequest&) () from ./libsfx645ls.so #20 0x768f462c in SfxStubSfxApplicationOpenDocExec_Impl(SfxShell*, SfxRequest&) () from ./libsfx645ls.so #21 0x76a51570 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, unsigned char) () from ./libsfx645ls.so #22 0x76a52ab0 in SfxDispatcher::_Execute(SfxShell&, SfxSlot const&, SfxRequest&, unsigned short) () from ./libsfx645ls.so #23 0x76a53a5c in SfxDispatcher::Execute(unsigned short, unsigned short, SfxPoolItem const**, unsigned short, SfxPoolItem const**) () from ./libsfx645ls.so #24 0x76a4ac24 in SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) () from ./libsfx645ls.so #25 0x76a49c20 in SfxOfficeDispatch::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) () from ./libsfx645ls.so #26 0x748626fc in framework::MenuManager::Select(Menu*) () from ./libfwk645ls.so #27 0x74861a7c in framework::MenuManager::LinkStubSelect(void*, void*) () from ./libfwk645ls.so #28 0x701e66b4 in Menu::Select() () from ./libvcl645ls.so #29 0x701ea1e8 in Menu::ImplCallSelect(Menu*) () from ./libvcl645ls.so #30 0x701ea1c8 in Menu::LinkStubImplCallSelect(void*, void*) () from ./libvcl645ls.so #31 0x702302c8 in ImplHandleUserEvent(ImplSVEvent*) () from ./libvcl645ls.so #32 0x70230aec in ImplWindowFrameProc(void*, SalFrame*, unsigned short, void const*) () from ./libvcl645ls.so ---Type <return> to continue, or q <return> to quit--- #33 0x7028bf48 in SalFrameData::HandleClientMessage(XClientMessageEvent*) () from ./libvcl645ls.so #34 0x7028c948 in SalFrameData::Dispatch(_XEvent*) () from ./libvcl645ls.so #35 0x702b73dc in SalDisplay::Dispatch(_XEvent*) () from ./libvcl645ls.so #36 0x702b7018 in SalDisplay::Yield(unsigned char) () from ./libvcl645ls.so #37 0x702b323c in DisplayYield(int, SalDisplay*) () from ./libvcl645ls.so #38 0x702b13a8 in SalXLib::Yield(unsigned char) () from ./libvcl645ls.so #39 0x702bab20 in SalInstance::Yield(unsigned char) () from ./libvcl645ls.so #40 0x700f6144 in Application::Yield() () from ./libvcl645ls.so #41 0x700f6024 in Application::Execute() () from ./libvcl645ls.so #42 0x0002b86c in desktop::Desktop::Main() () #43 0x700faff4 in SVMain() () from ./libvcl645ls.so #44 0x702afd48 in main () from ./libvcl645ls.so #45 0x7158ce0c in __libc_start_main () from /lib/libc.so.6 (gdb) (gdb)
Created attachment 8218 [details] cellsuno patch
Created attachment 8219 [details] token.cxx patch
these patches needed to prevent spreadsheet crashes when building with gcc-3.3 on sparc linux
sparc linux retarget to ooo2 moving from gcc-3.2.3 up to gcc-3.3 finds more spreadsheet files need compile with no optimisation. as these errors only show up at runtime when performing various operations in spreadsheet, i wonder if there are more of these crashes that i have not found yet. there must be a better way to prevent these things, not just wait for a crash and then rebuild with no optimisation? does this affect other platforms or is it just a sparc linux compiler issue? and what about sw and sd - i have not tested those much yet...
retarget sparc linux ooo2
i have to confirm this myself, since there is no-one else building on sparc linux?
I gave you the "can confirm" privileges.
As no-one else builds linux sparc yet, I confirm this issue based on my stacktraces above. The problem goes away when those two files are compiled without optimisation. Perhaps this is a compiler issue as it seems to affect linux sparc more, but i notice other platforms have some NOOPT files too, different ones. Much testing will be needed to see if other files have this problem. Meanwhile the first contrib version has all of sc module compiled without optimisation, to be safer for users. I would like advice - would it be OK to also release a "test" version having sc module compiled WITH optimisation so users can help find more problems? Would it be best to keep these patches out of the cvs until the answer is known?
Just a question: was the gcc -fno-strict-aliasing option used? If not, please do so and try again.
Hi, i have made -fno-strict-aliasing my default in solenv/inc/unxlngs.mk ever since your very helpful advice in issue 17301, and that is used for sc too. Here are some later NOOPT files i have added but i have not gone back yet to check in case some earlier ones are no longer needed. I notcice some NOOPT files for all platforms too. (1)changed from gcc-3.2.3 to gcc-3.3.1 (list filter) unobj/cellsuno core/tool/token (2) changed from -O1 to -O2 (goal seek) core/tool/interpr2 Now i am using gcc-3.3.2 (debian) and -O3. Please note i get very many warning messages - for example about the overloaded == functions. Are these important?
So far almost every compiler had some optimization problems now and then, in different places of course, so there are some NOOPT entries for most platforms, except Windows where you can toggle optimization by means of a #pragma on function level. However, I have not the slightest idea what may cause all the sudden crashes with your new gcc-3.3 version, this would have to be inspected on an assembler level. Only that I don't have the time nor the machine to do so. I guess there is a common cause for most optimization crashes, similar to the aliasing problem we had. What warnings about overloaded == functions are you referring to? Could you give an example please?
This message appears for very many files when compiling sc In file included from ../../../inc/document.hxx:95, from ../inc/docsh.hxx:87, from /usr/local/oo_src/sc/source/ui/unoobj/cellsuno.cxx:121: ../../../inc/tabopparams.hxx: At global scope: ../../../inc/tabopparams.hxx:124: warning: ISO C++ forbids declaration of `operator==' with no type Now i see this in tabopparams.hxx: return *this; } operator ==( const ScInterpreterTableOpParams& r ) { return bValid && r.bValid && aOld1 == r.aOld1 && Just for an experiment i did guess BOOL and recompiled: BOOL operator ==( const ScInterpreterTableOpParams& r ) and the messages went away and sc seemed to work OK (but it did not fix the NOOPTS problem). There are some other operator== without types too. I suppose the warnings might become errors in some future gcc but it is OK for now. I only mention these warnings in case it means something to you, i am not asking anything to be done. The other one with no type is from far away... In file included from /usr/local/oo_src/sc/source/ui/app/seltrans.cxx:75: /usr/local/oo_src/solver/645/unxlngs.pro/inc/sfx2/docfile.hxx:157: warning: `class SfxPoolCancelManager' only defines a private destructor and has no friends In file included from /usr/local/oo_src/solver/645/unxlngs.pro/inc/svx/svdotext.hxx:74, from /usr/local/oo_src/solver/645/unxlngs.pro/inc/svx/svdorect.hxx:66, from /usr/local/oo_src/solver/645/unxlngs.pro/inc/svx/svdograf.hxx:69, from /usr/local/oo_src/sc/source/ui/app/seltrans.cxx:77: /usr/local/oo_src/solver/645/unxlngs.pro/inc/svx/svdtrans.hxx:90: warning: ISO C++ forbids declaration of `nWinkDiv' with no type
Sigh.. yes, of course the operator== should return a BOOL. in fact I'm quite surprised that not any compiler treats the missing return type as an error. The nWinkDiv seems to be intended as an int. However, if used as shown in the example given in svx/inc/svdtrans.hxx (nWinkDiv*double) it should be a double in order to not produce wrong roundoff errors. This should be clarified with the Graphics project's team, who are probably users of that stuff, if any at all. With a short grep I didn't find any further operator== declarations without return type information within Calc. Could you please file separate issues against the projects where this happens or any missing type information occurs? Thank you.
There are no more ==operator warnings, sorry i was mixed up. I have now filed issue 18988 to manage the warnings about functions with no types.
Thanks. May I asume that all Calc patches went there and this issue here now is superfluous and may be closed?
OK, this issue is closed as the NOOPT patches have gone to issue 18988.
close issue.