[Libreoffice-bugs] [Bug 124042] New: Lots of CoreGraphics calls without a valid context

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Mar 13 07:39:18 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=124042

            Bug ID: 124042
           Summary: Lots of CoreGraphics calls without a valid context
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: iOS
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: tml at iki.fi

Description:
Running the app in Xcode, you get tons of output like:

2019-03-13 09:29:05.832895+0200 Mobile[21976:7389174] [Unknown process name]
CGContextSaveGState: invalid context 0x0. If you want to see the backtrace,
please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.

Doing that, you can figure out where the calls are, for instance in
AquaSalGraphics::drawPolyPolygon(), which is called from:

> #0	0x0000000103b6e208 in AquaSalGraphics::drawPolyPolygon(basegfx::B2DPolyPolygon const&, double) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/quartz/salgdicommon.cxx:1006
> #1	0x0000000103a0efcc in SalGraphics::DrawPolyPolygon(basegfx::B2DPolyPolygon const&, double, OutputDevice const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/gdi/salgdilayout.cxx:463
> #2	0x000000010386e408 in vcl::(anonymous namespace)::munchDrawCommands(std::__1::vector<std::__1::shared_ptr<vcl::DrawCommand>, std::__1::allocator<std::__1::shared_ptr<vcl::DrawCommand> > > const&, SalGraphics&, long, long, long, long) [inlined] at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/gdi/FileDefinitionWidgetDraw.cxx:278
> #3	0x000000010386e2bc in vcl::FileDefinitionWidgetDraw::resolveDefinition(ControlType, ControlPart, ControlState, ImplControlValue const&, long, long, long, long) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/gdi/FileDefinitionWidgetDraw.cxx:445
> #4	0x000000010386ed5c in vcl::FileDefinitionWidgetDraw::drawNativeControl(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&) ()
> #5	0x0000000103a11288 in SalGraphics::callDrawNativeControl(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/gdi/salgdilayout.cxx:726
> #6	0x0000000103a116a0 in SalGraphics::DrawNativeControl(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&, OutputDevice const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/gdi/salgdilayout.cxx:747
> #7	0x00000001037d46e4 in OutputDevice::DrawNativeControl(ControlType, ControlPart, tools::Rectangle const&, ControlState, ImplControlValue const&, rtl::OUString const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/outdev/nativecontrols.cxx:309
> #8	0x0000000103617a90 in vcl::Window::Erase(OutputDevice&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/paint.cxx:1636
> #9	0x0000000103617400 in vcl::Window::PushPaintHelper(PaintHelper*, OutputDevice&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/paint.cxx:499
> #10	0x0000000103617118 in PaintHelper::DoPaint(vcl::Region const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/paint.cxx:299
> #11	0x0000000103617fec in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/paint.cxx:606
> #12	0x0000000103618fb0 in vcl::Window::Update() at /Volumes/TML13/lo/ios-optimised-cp-6.0/vcl/source/window/paint.cxx:1332
> #13	0x0000000101323c0c in framework::ProgressBarWrapper::start(rtl::OUString const&, int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/uielement/progressbarwrapper.cxx:111
> #14	0x0000000101324660 in framework::StatusIndicatorInterfaceWrapper::start(rtl::OUString const&, int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/uielement/statusindicatorinterfacewrapper.cxx:52
> #15	0x0000000101295510 in framework::StatusIndicatorFactory::start(com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&, rtl::OUString const&, int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/helper/statusindicatorfactory.cxx:140
> #16	0x000000010129422c in framework::StatusIndicator::start(rtl::OUString const&, int) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/helper/statusindicator.cxx:51
> #17	0x0000000103032480 in XMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/filter/xml/swxml.cxx:637
> #18	0x0000000102fc2fbc in SwReader::Read(Reader const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/filter/basflt/shellio.cxx:177
> #19	0x0000000103076ba4 in SwDocShell::Load(SfxMedium&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sw/source/uibase/app/docshini.cxx:555
> #20	0x0000000102397bb4 in SfxObjectShell::LoadOwnFormat(SfxMedium&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/doc/objstor.cxx:3029
> #21	0x00000001023982a8 in SfxObjectShell::DoLoad(SfxMedium*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/doc/objstor.cxx:723
> #22	0x00000001023b3c94 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/doc/sfxbasemodel.cxx:1795
> #23	0x0000000102407c64 in (anonymous namespace)::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&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/sfx2/source/view/frmload.cxx:693
> #24	0x00000001012c437c in framework::LoadEnv::impl_loadContent() at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/loadenv/loadenv.cxx:1141
> #25	0x00000001012c20f8 in framework::LoadEnv::startLoading() at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/loadenv/loadenv.cxx:375
> #26	0x00000001012c1798 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/loadenv/loadenv.cxx:161
> #27	0x00000001012ddd44 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at /Volumes/TML13/lo/ios-optimised-cp-6.0/framework/source/services/desktop.cxx:618
> #28	0x00000001024ca0ec in lo_documentLoadWithOptions(_LibreOfficeKit*, char const*, char const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/desktop/source/lib/init.cxx:1636
> #29	0x0000000100a9310c in lok::Office::documentLoad(char const*, char const*) at /Volumes/TML13/lo/ios-optimised-cp-6.0/include/LibreOfficeKit/LibreOfficeKit.hxx:643
> #30	0x0000000100a8bc94 in Document::load(std::__1::shared_ptr<ChildSession> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Volumes/TML13/lo/online-ios-co-4/kit/Kit.cpp:1676
> #31	0x0000000100a630ec in Document::onLoad(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Volumes/TML13/lo/online-ios-co-4/kit/Kit.cpp:1396
> #32	0x000000010088cec0 in ChildSession::loadDocument(char const*, int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) at /Volumes/TML13/lo/online-ios-co-4/kit/ChildSession.cpp:558
> #33	0x000000010087aa70 in ChildSession::_handleInput(char const*, int) at /Volumes/TML13/lo/online-ios-co-4/kit/ChildSession.cpp:205
> #34	0x00000001008d62cc in Session::handleMessage(bool, WSOpCode, std::__1::vector<char, std::__1::allocator<char> >&) at /Volumes/TML13/lo/online-ios-co-4/common/Session.cpp:219
> #35	0x0000000100a7a164 in Document::forwardToChild(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<char, std::__1::allocator<char> > const&) at /Volumes/TML13/lo/online-ios-co-4/kit/Kit.cpp:1830
> #36	0x0000000100a5c904 in Document::run() at /Volumes/TML13/lo/online-ios-co-4/kit/Kit.cpp:1939
> #37	0x000000010452476c in Poco::(anonymous namespace)::RunnableHolder::run() at /Users/tml/src/poco-1.9.0/Foundation/src/Thread.cpp:55
> #38	0x00000001045220f0 in Poco::ThreadImpl::runnableEntry(void*) at /Users/tml/src/poco-1.9.0/Foundation/src/Thread_POSIX.cpp:345
> #39	0x0000000195a5025c in _pthread_body ()
> #40	0x0000000195a501bc in _pthread_start ()
> #41	0x0000000195a53cf4 in thread_start ()



Steps to Reproduce:
.

Actual Results:
.

Expected Results:
.


Reproducible: Always


User Profile Reset: No



Additional Info:
The least that should be done is to not call CoreGraphics API with an invalid
context (like zero).

But it would be better to figure out the root cause and fix things to that
these vcl calls from higher up in the stack will not be done at all. In the
particular backtrace above, the code apparently thinks it is displaying an
actual progress bar itself. On iOS, vcl will never have any actual "windows"
(they aren't called so in iOS, but bear with me) to manipulate, everything is
always rendered to bitmaps that are passed on through LibreOfficeKit to the
app. Clearly there is no way ever to display a "normal" desktop-style progress
bar directly.

(Another thing then is that ideally, when we have resources (time and funding),
we should rework the iOS app dialog mechanism so that it would actually be
native widgets that are drawn natively, not through any bitmap, but that is
another thing.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190313/70c6662d/attachment.html>


More information about the Libreoffice-bugs mailing list