Description: SfxUndoManager_Data::SfxUndoManager_Data leaks memory with multiple invocations Steps to Reproduce: 1. Start the Instruments.app 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. Click on the new Writer document icon to open a blank Writer document. 7. Insert a chart with the toolbar icon 8. Select the chart and delete (backspace) 9. Stop recording (after the closing is fully processed) 10. Analyse the profile trace. Actual Results: SfxUndoManager_Data::SfxUndoManager_Data leaks memory SfxUndoActions::SfxUndoActions() leaks memory osl::Mutex::Mutex()leaks memory Expected Results: No leaks Reproducible: Always User Profile Reset: No Additional Info: Recent MacOS build User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Created attachment 136540 [details] BT & Few screenshots
Confirming, and allegedly leaking here : struct SfxUndoActions::Impl { std::vector<MarkedUndoAction> maActions; }; SfxUndoActions::SfxUndoActions() : mpImpl(new Impl) {} SfxUndoActions::SfxUndoActions( const SfxUndoActions& r ) : mpImpl(new Impl) { mpImpl->maActions = r.mpImpl->maActions; } SfxUndoActions::~SfxUndoActions() { } in undo.cxx, lines 152-167
(In reply to Alex Thurgood from comment #2) > Confirming, and allegedly leaking here : > Ignore the previous code pointer, I was looking at the wrong part, it seems, but the UndoManager code here might be more promising: explicit SfxUndoManager_Data( size_t i_nMaxUndoActionCount ) :pUndoArray( new SfxUndoArray( i_nMaxUndoActionCount ) ) ,pActUndoArray( nullptr ) ,mnMarks( 0 ) ,mnEmptyMark(MARK_INVALID) ,mbUndoEnabled( true ) ,mbDoing( false ) ,mbClearUntilTopLevel( false ) { pActUndoArray = pUndoArray.get(); } lines 233-243 of undo.cxx
Line 691 of ChartModel.cxx also gets pointed to by the Apple Instruments tool: m_pUndoManager.set( new UndoManager( *this, m_aModelMutex ) );
Along with line 835 of undomanagerhelper.cxx : :m_xImpl( new UndoManagerHelper_Impl( i_undoManagerImpl ) )
I traced the number of calls to constructor and destructor. For ChartModel, it's ok, same number It's wrong for UndoManager, I only see calls to its constructor, none for destructor. The use of UndoManager in ChartModel is: ::rtl::Reference< UndoManager > m_pUndoManager; (see https://opengrok.libreoffice.org/xref/core/chart2/inc/ChartModel.hxx#133) I noticed destructor of ChartModel is: 196 ChartModel::~ChartModel() 197 { 198 if( m_xOldModelAgg.is()) 199 m_xOldModelAgg->setDelegator( nullptr ); 200 } But then I'm completely lost since I don't know enough about rtl::reference, weak ref, acquire/release, dispose/disposing to help here.
** Please read this message in its entirety before responding ** 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 http://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://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Telesto, 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://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Telesto, 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