Bug 124042 - Lots of CoreGraphics calls without a valid context
Summary: Lots of CoreGraphics calls without a valid context
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0 target:6.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-13 07:39 UTC by How can I remove my account?
Modified: 2023-10-30 03:13 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description How can I remove my account? 2019-03-13 07:39:18 UTC
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.)
Comment 1 Commit Notification 2019-03-13 08:06:58 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/f6fdcbeb81f9879a2e117d87d9d60a8a8a0111f5%5E%21

tdf#124042: There are no progress bars that vcl would handle on iOS or Android

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2019-03-15 16:40:52 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/b4fbe662d02366c38bb7660f25a8d2076ad34d69%5E%21

tdf#124042: Add SAL_INFOs for iOS about the CGContext life cycle in LOKit

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2019-03-15 16:44:42 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/3140194a85fe4a6ac69c8cddc4d3b019430cd6e8%5E%21

tdf#124042: If mrContext is zero, calling Core Graphics APIs on it is futile

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Xisco Faulí 2019-04-17 15:06:19 UTC
A polite ping to Tor Lillqvist:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 5 Xisco Faulí 2019-07-18 11:40:30 UTC
(In reply to Xisco Faulí from comment #4)
> A polite ping to Tor Lillqvist:
> Is this bug fixed? if so, could you please close it as RESOLVED FIXED ?
> Otherwise, Could you please explain what's missing?
> Thanks

Ping?
Comment 6 How can I remove my account? 2019-07-18 11:52:34 UTC
I don't know.
Comment 7 Commit Notification 2019-07-25 07:58:33 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/8d5164463a77f7957c26bc922689f45b394a2cf6%5E%21

tdf#124042: Remove unnecessary code for iOS

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Xisco Faulí 2019-10-29 09:29:41 UTC
Dear Tor Lillqvist,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 9 QA Administrators 2021-10-29 03:49:26 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2023-10-30 03:13:11 UTC
Dear Tor Lillqvist,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug