Bug 98175 - Crash Libreoffice Impress with any slide transition
Summary: Crash Libreoffice Impress with any slide transition
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.1.5.2 release
Hardware: All All
: high critical
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords: bisected, haveBacktrace, regression
: 98283 98295 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-25 11:42 UTC by Roman Kuznetsov
Modified: 2017-02-16 19:44 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
error with crash Impress (5.82 KB, image/png)
2016-02-25 11:42 UTC, Roman Kuznetsov
Details
bt with debug symbols (5.35 KB, text/plain)
2016-02-28 13:19 UTC, Julien Nabet
Details
valgrind log (56.52 KB, application/x-tar-gz)
2016-02-29 21:50 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2016-02-25 11:42:13 UTC
Created attachment 122985 [details]
error with crash Impress

Version: 5.2.0.0.alpha0+
Build ID: 98a8eafa915b8d57b8bdccab9981e537d77f6f4a
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-02-25_00:49:33
Locale: ru-RU (ru_RU)

1. Open New presentation in Impress
2. On Sidebar select section Slide transition
3. Try select any Slide transition
4. LO Impress displayed error (see screenshot in attach)
Comment 1 Julien Nabet 2016-02-28 13:19:20 UTC
Created attachment 123053 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 2 Julien Nabet 2016-02-29 20:04:34 UTC
*** Bug 98283 has been marked as a duplicate of this bug. ***
Comment 3 Michael Meeks 2016-02-29 21:08:32 UTC
Tomaz - looks interesting =)

Julien - it'd be lovely to have a valgrind trace with those debugging symbols.

The iterator piece in it:

slideshow::internal::UnoViewContainer::begin (this=0x9999999999999999) at /home/user/libreoffice/slideshow/source/inc/unoviewcontainer.hxx:76

looks like this could be related to some global iterator / container type change.?

I imagine the:

    // init views and create slide bitmaps
    for( const auto& pView : mrViewContainer )
        this->viewAdded( pView );

that the mrViewContainer is a broken reference at this stage; but valgrind would give us more =)
Comment 4 Julien Nabet 2016-02-29 21:50:54 UTC
Created attachment 123094 [details]
valgrind log

Valgrind log with master sources updated yesterday (e03f21d400e7ec911f3b0b65c4f35771bc97b003)
+ SAL_USE_VCLPLUGIN=gen and enable-dbgutil
Comment 5 raal 2016-03-01 09:33:29 UTC
*** Bug 98295 has been marked as a duplicate of this bug. ***
Comment 7 Julien Nabet 2016-03-02 11:19:31 UTC
Noel: following Tomaz's comment, thought you might be interested in this one.
Comment 8 Noel Grandin 2016-03-02 13:50:49 UTC
I did some debugging by putting a breakpoint at 'slideshow::internal::SlideChangeBase::~SlideChangeBase'

and noticed that the destructor is being called before the call that crashes LO.

The first stacktrace below is the destruction, and the second call is the crasher.


#0  slideshow::internal::SlideChangeBase::~SlideChangeBase (this=0x2777970, vtt=0x2aaae2899e38 <VTT for slideshow::internal::(anonymous namespace)::ClippedSlideChange+8>)
    at /home/noel/libo4/slideshow/source/engine/transitions/slidechangebase.hxx:51
#1  0x00002aaae24eb8d3 in slideshow::internal::(anonymous namespace)::ClippedSlideChange::~ClippedSlideChange (this=0x2777970, 
    vtt=0x2aaae2899e30 <VTT for slideshow::internal::(anonymous namespace)::ClippedSlideChange>) at /home/noel/libo4/slideshow/source/engine/transitions/slidetransitionfactory.cxx:279
#2  0x00002aaae24eb660 in slideshow::internal::(anonymous namespace)::ClippedSlideChange::~ClippedSlideChange (this=0x2777970)
    at /home/noel/libo4/slideshow/source/engine/transitions/slidetransitionfactory.cxx:279
#3  0x00002aaae24eb699 in slideshow::internal::(anonymous namespace)::ClippedSlideChange::~ClippedSlideChange (this=0x2777970)
    at /home/noel/libo4/slideshow/source/engine/transitions/slidetransitionfactory.cxx:279
#4  0x00002aaae24dedbf in std::_Sp_counted_ptr<slideshow::internal::SlideChangeBase*, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x2688200)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr_base.h:374
#5  0x00002aaae225e775 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x2688200)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr_base.h:150
#6  0x00002aaae225e72a in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x7fffffff3610)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr_base.h:659
#7  0x00002aaae2324c29 in std::__shared_ptr<slideshow::internal::ViewEventHandler, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7fffffff3608)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr_base.h:925
#8  0x00002aaae2324b55 in std::shared_ptr<slideshow::internal::ViewEventHandler>::~shared_ptr (this=0x7fffffff3608)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr.h:93
#9  0x00002aaae24d9de7 in slideshow::internal::SlideChangeBase::prefetch (this=0x2777970) at /home/noel/libo4/slideshow/source/engine/transitions/slidechangebase.cxx:179
#10 0x00002aaae245ecaf in (anonymous namespace)::SlideShowImpl::createSlideTransition(com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Event> const&)::$_0::operator()() const (this=0x27295d0)
    at /home/noel/libo4/slideshow/source/engine/slideshowimpl.cxx:861
#11 0x00002aaae245eabd in std::_Function_handler<void (), (anonymous namespace)::SlideShowImpl::createSlideTransition(com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Event> const&)::$_0>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/functional:1871
#12 0x00002aaae22daebe in std::function<void ()>::operator()() const (this=0x2777cf8) at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/functional:2271
#13 0x00002aaae22dadc4 in slideshow::internal::Delay::fire (this=0x2777ce0) at /home/noel/libo4/slideshow/source/engine/delayevent.cxx:32
#14 0x00002aaae235cb2a in slideshow::internal::EventQueue::process_ (this=0x2754d80, bFireAllEvents=false) at /home/noel/libo4/slideshow/source/engine/eventqueue.cxx:222
#15 0x00002aaae235d0f8 in slideshow::internal::EventQueue::process (this=0x2754d80) at /home/noel/libo4/slideshow/source/engine/eventqueue.cxx:164
#16 0x00002aaae2453339 in (anonymous namespace)::SlideShowImpl::update (this=0x2754ba0, nNextTimeout=@0x7fffffff4110: 0) at /home/noel/libo4/slideshow/source/engine/slideshowimpl.cxx:2000
#17 0x00002aaadc38b0ff in sd::SlideshowImpl::updateSlideShow (this=0x270c210) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1765
#18 0x00002aaadc38b019 in sd::SlideshowImpl::updateHdl (this=0x270c210) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1750
#19 0x00002aaadc37fb48 in sd::SlideshowImpl::LinkStubupdateHdl (instance=0x270c210, data=0x270c290) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1748
#20 0x00002aaab343a4a8 in Link<Timer*, void>::Call (this=0x270c2b0, data=0x270c290) at /home/noel/libo4/include/tools/link.hxx:84
#21 0x00002aaab343a287 in Timer::Invoke (this=0x270c290) at /home/noel/libo4/vcl/source/app/timer.cxx:88


#0  std::__cxx1998::vector<std::shared_ptr<slideshow::internal::UnoView>, std::allocator<std::shared_ptr<slideshow::internal::UnoView> > >::begin (this=0x99999999999999b1)
    at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/stl_vector.h:557
#1  0x00002aaae22f4dd7 in std::__debug::vector<std::shared_ptr<slideshow::internal::UnoView>, std::allocator<std::shared_ptr<slideshow::internal::UnoView> > >::begin (
    this=0x9999999999999999) at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/debug/vector:281
#2  0x00002aaae22efacc in slideshow::internal::UnoViewContainer::begin (this=0x9999999999999999) at /home/noel/libo4/slideshow/source/inc/unoviewcontainer.hxx:76
#3  0x00002aaae24d9e08 in slideshow::internal::SlideChangeBase::prefetch (this=0x2777970) at /home/noel/libo4/slideshow/source/engine/transitions/slidechangebase.cxx:182
#4  0x00002aaae245ecaf in (anonymous namespace)::SlideShowImpl::createSlideTransition(com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Event> const&)::$_0::operator()() const (this=0x27295d0)
    at /home/noel/libo4/slideshow/source/engine/slideshowimpl.cxx:861
#5  0x00002aaae245eabd in std::_Function_handler<void (), (anonymous namespace)::SlideShowImpl::createSlideTransition(com::sun::star::uno::Reference<com::sun::star::drawing::XDrawPage> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Slide> const&, std::shared_ptr<slideshow::internal::Event> const&)::$_0>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/functional:1871
#6  0x00002aaae22daebe in std::function<void ()>::operator()() const (this=0x2777cf8) at /usr/lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/functional:2271
#7  0x00002aaae22dadc4 in slideshow::internal::Delay::fire (this=0x2777ce0) at /home/noel/libo4/slideshow/source/engine/delayevent.cxx:32
#8  0x00002aaae235cb2a in slideshow::internal::EventQueue::process_ (this=0x2754d80, bFireAllEvents=false) at /home/noel/libo4/slideshow/source/engine/eventqueue.cxx:222
#9  0x00002aaae235d0f8 in slideshow::internal::EventQueue::process (this=0x2754d80) at /home/noel/libo4/slideshow/source/engine/eventqueue.cxx:164
#10 0x00002aaae2453339 in (anonymous namespace)::SlideShowImpl::update (this=0x2754ba0, nNextTimeout=@0x7fffffff4110: 0) at /home/noel/libo4/slideshow/source/engine/slideshowimpl.cxx:2000
#11 0x00002aaadc38b0ff in sd::SlideshowImpl::updateSlideShow (this=0x270c210) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1765
#12 0x00002aaadc38b019 in sd::SlideshowImpl::updateHdl (this=0x270c210) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1750
#13 0x00002aaadc37fb48 in sd::SlideshowImpl::LinkStubupdateHdl (instance=0x270c210, data=0x270c290) at /home/noel/libo4/sd/source/ui/slideshow/slideshowimpl.cxx:1748
#14 0x00002aaab343a4a8 in Link<Timer*, void>::Call (this=0x270c2b0, data=0x270c290) at /home/noel/libo4/include/tools/link.hxx:84
#15 0x00002aaab343a287 in Timer::Invoke (this=0x270c290) at /home/noel/libo4/vcl/source/app/timer.cxx:88
Comment 9 Noel Grandin 2016-03-02 14:22:57 UTC
OK, I've figured this out.

I converted 

   shared_from_this()

to 

   std::shared_ptr<Activity>((Activity*)this) )

all over the place, which is bad, I should have used

   std::dynamic_pointer_cast<ViewEventHandler>(shared_from_this())

patch coming up.
Comment 10 Douglas Mencken 2016-03-02 14:30:18 UTC
(In reply to Noel Grandin from comment #9)
> OK, I've figured this out.
> 
> I converted 
> 
>    shared_from_this()
> 
> to 
> 
>    std::shared_ptr<Activity>((Activity*)this) )
> 
> all over the place, which is bad, I should have used
> 
>    std::dynamic_pointer_cast<ViewEventHandler>(shared_from_this())
> 
> patch coming up.

You 're faster than me

After reverting (in that order)

git revert 4e354737908b89713297ebf5216eb44f3d9ae990
git revert 93de1f80e8b6ea49be8eca57a87e6ba92dc6cae9
git revert ef3aea797bc33edc6d8a975ed74bb3a38031d62b
git revert f29c0b2b3e8861909fa2c6c37bf631ab01590541

I got too that idea of replacing shared_from_this() was wrong
Comment 11 Commit Notification 2016-03-02 14:40:47 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#98175 fix Impress crash

It will be available in 5.2.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 12 Douglas Mencken 2016-03-02 16:33:14 UTC
(In reply to Commit Notification from comment #11)

> Affected users are encouraged to test the fix and report feedback.

It works now
Comment 13 Michael Meeks 2016-03-03 16:56:49 UTC
*** Bug 97195 has been marked as a duplicate of this bug. ***
Comment 14 Michael Meeks 2016-03-03 17:13:34 UTC
Noel - interesting; it seems that some variant of this same issue pre-existed your fixes as well; since we see bug#97195 - before your re-work (and fix) - with a very similar stack-trace.

I wonder - would it be possible to back-port some sub-set of your cleanup & associated fix to -5-1 as well (and 5-0?).

Thanks !
Comment 15 Julien Nabet 2016-03-03 18:42:43 UTC
On pc Debian x86-64 with master sources updated today, I don't reproduce this anymore.
Thank you Tomaz for the pointer and Noel for the fix! :-)
Comment 16 Kumāra 2016-10-17 08:56:40 UTC
(In reply to Michael Meeks from comment #14)
> Noel - interesting; it seems that some variant of this same issue
> pre-existed your fixes as well; since we see bug#97195 - before your re-work
> (and fix) - with a very similar stack-trace.
> 
> I wonder - would it be possible to back-port some sub-set of your cleanup &
> associated fix to -5-1 as well (and 5-0?).
> 
> Thanks !

Back-porting to the latest Still would be very good for LO's image.
Comment 17 Noel Grandin 2016-10-17 09:02:58 UTC
Unfortunately, this cleanup was pretty much all-or-nothing, since the shared_ptr infrastructure is pervasive throughout slideshow.

So backporting is not really an option.

This fix is already available in the latest stable build (5.2) anyhow.
Comment 18 Kumāra 2016-10-18 09:34:58 UTC
It's not over yet. I've just downloaded 5.2.2.2 (Windows 64bit) and the bug is still there!

Actually the bug is in the latest Still: 5.1.5.2 too.

I need to continue work on a presentation soon. In which version was the bug introduced?
Comment 19 Kumāra 2016-10-19 08:47:42 UTC Comment hidden (no-value)
Comment 20 Buovjaga 2016-10-19 11:21:56 UTC Comment hidden (off-topic)
Comment 21 Roman Kuznetsov 2016-10-19 12:21:51 UTC
(In reply to Kumāra from comment #18)

> Actually the bug is in the latest Still: 5.1.5.2 too.
> 

steps for reproducion are the same as mine?
Comment 22 Kumāra 2016-10-20 08:02:34 UTC Comment hidden (obsolete)
Comment 23 Kumāra 2016-10-20 08:21:31 UTC Comment hidden (obsolete)