Bug 114457 - MacOS: OfaTreeOptionsDialog::LoadNodes(Module*, rtl::OUString const&) is leaking a bit
Summary: MacOS: OfaTreeOptionsDialog::LoadNodes(Module*, rtl::OUString const&) is leak...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-14 10:42 UTC by Telesto
Modified: 2020-01-07 03:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (356.78 KB, image/png)
2017-12-14 10:43 UTC, Telesto
Details
screenshot (411.28 KB, image/png)
2017-12-19 19:46 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2017-12-14 10:42:05 UTC
Description:
OfaTreeOptionsDialog::LoadNodes(Module*, rtl::OUString const&) is leaking a bit

Steps to Reproduce:
1. Start the Instruments
2. Choose Memory Leak profile tool
3. Select LibreOffice.app in instdir as target process
4. Click on the record button, LODev is started by the profiling tool
5. Wait for the StartCenter to load.
6. Open A writer document 
7. Go to LibreOffice Menu -> Preferences
8. Expand Load/Save - >General
9. Change the Autosave Autorecovery time to something else
10. Press OK
11. Type something (not sure if this relevant..)


Actual Results:  
Small leak

Expected Results:
No leak


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.1.0.0.alpha0+
Build ID: d46dc8e547810208287aab77f0313f1971901464
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2017-12-08_10:35:46
Locale: nl-NL (nl_NL.UTF-8); Calc: group threaded


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8
Comment 1 Telesto 2017-12-14 10:43:55 UTC
Created attachment 138439 [details]
Screenshot
Comment 2 Julien Nabet 2017-12-16 15:01:22 UTC
With master sources updated today, I don't reproduce this on MacOs.
I tried twice by following each step, I even tried to display several options in prefs but nothing.

However, I submitted a patch to review because I think having found something wrong in this part of code:
https://gerrit.libreoffice.org/#/c/46602/
Comment 3 Commit Notification 2017-12-16 19:20:11 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=41981d4cb48e66b6fdb32cdc3ae65632af9593dc

Related tdf#114457: fix leak in treeopt (cui)

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 4 Julien Nabet 2017-12-19 18:46:20 UTC
Telesto: with a build including http://cgit.freedesktop.org/libreoffice/core/commit/?id=41981d4cb48e66b6fdb32cdc3ae65632af9593dc, could you give a new try?
Comment 5 Telesto 2017-12-19 19:46:59 UTC
Created attachment 138530 [details]
screenshot

Looks worse to me:
Version: 6.1.0.0.alpha0+
Build ID: 184ce84226b49a1b4b693f3bb8cc8569c76d864d
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2017-12-18_23:53:27
Locale: nl-NL (nl_NL.UTF-8); Calc: group threaded
Comment 6 Julien Nabet 2017-12-19 19:56:33 UTC
Thank you for your feedback. I submitted a revert, as soon as it's verified by Jenkins, I push this.
I won't be able to help here so uncc myself.
Comment 7 Commit Notification 2017-12-20 06:03:51 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cf4228fa0aaea82858f05848fe5a6a96b34405a0

Revert "Related tdf#114457: fix leak in treeopt (cui)"

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Alex Thurgood 2018-01-11 15:58:24 UTC
Confirming with

Version: 6.1.0.0.alpha0+
Build ID: dd758f54fa5ea1ecd3d793bcea999d771010ff00
CPU threads: 4; OS: Mac OS X 10.13.2; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group threaded

It seems to be happening here :

        do
        {
            SolarMutexReleaser aReleaser;

SAL_WNODEPRECATED_DECLARATIONS_PUSH
    // 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12
            pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask
SAL_WNODEPRECATED_DECLARATIONS_POP
                            untilDate: nil
                            inMode: NSDefaultRunLoopMode
                            dequeue: YES];
            if( pEvent )
            {
                [NSApp sendEvent: pEvent];
                if ( isWakeupEvent( pEvent ) )
                    continue;
                bHadEvent = true;
            }


lines 596 to 613 of salinst.cxx, and in particular:

            pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask

and

                [NSApp sendEvent: pEvent];
Comment 9 Alex Thurgood 2018-01-11 15:59:32 UTC
Note that I don't see the leak in :

OfaTreeOptionsDialog::LoadNodes(Module*, rtl::OUString const&)
Comment 10 Julien Nabet 2018-01-14 20:03:40 UTC
Perhaps these patches would help:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=7794b2d96f5259b062ca6bd9db265a086631593f
+
https://cgit.freedesktop.org/libreoffice/core/commit/?id=42bfd59b6ba9e7a53ba789f04694060cc43d9d88

I used unique_ptr at different locations to try to improve memory management.
Comment 11 QA Administrators 2019-01-15 03:48:52 UTC Comment hidden (obsolete)
Comment 12 Julien Nabet 2019-06-09 12:08:39 UTC
Following commits quoted in my previous comment, any better with a recent LO version (eg 6.2.4)?
Comment 13 QA Administrators 2019-12-07 03:43:56 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2020-01-07 03:29:12 UTC
Dear Telesto,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp