Crash caused by exception thown from DMABufTextureBinder::ensure_egl_image()

Bug #1591376 reported by Alan Griffiths
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
New
Undecided
Unassigned
mir (Ubuntu)
New
Undecided
Unassigned

Bug Description

The most reliable way I have to reproduce is:

1. Run (Mir-on-X) $ miral-shell --window-manager tiling
2. Run a script that iterates over mir_demo_client_* launching all our demo clients.

The following exception causes a segfault in report_exception() - because by then the library has been unloaded:

Thread 3 "Mir/Comp" hit Catchpoint 1 (exception thrown), 0x00007ffff6ee58bd in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff6ee58bd in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007ffff18275be in throw_exception (e=...) at /usr/include/boost/throw_exception.hpp:69
#2 boost::exception_detail::throw_exception_<std::system_error>(std::system_error const&, char const*, char const*, int) [clone .constprop.114] (x=...,
    current_function=0x7ffff182b2e0 <(anonymous namespace)::DMABufTextureBinder::ensure_egl_image()::__PRETTY_FUNCTION__> "virtual void {anonymous}::DMABufTextureBinder::ensure_egl_image()", file=<optimised out>, line=<optimised out>)
    at /usr/include/boost/throw_exception.hpp:86
#3 0x00007ffff1822967 in (anonymous namespace)::DMABufTextureBinder::ensure_egl_image() [clone .lto_priv.250] (
    this=<optimised out>)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/platforms/mesa/server/common/buffer_allocator.cpp:147
#4 0x00007ffff182308e in (anonymous namespace)::EGLImageBufferTextureBinder::gl_bind_to_texture() [clone .lto_priv.247] (
    this=0x7fffe8509c50) at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/platforms/mesa/server/common/buffer_allocator.cpp:71
#5 mir::graphics::mesa::GBMBuffer::gl_bind_to_texture() (this=<optimised out>)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/platforms/mesa/server/common/gbm_buffer.cpp:166
#6 0x00007ffff65e402f in mir::gl::RecentlyUsedCache::load(mir::graphics::Renderable const&) (this=<optimised out>,
    renderable=...) at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/gl/recently_used_cache.cpp:45
#7 0x00007ffff65fd2f9 in mir::renderer::gl::Renderer::draw(mir::graphics::Renderable const&, mir::renderer::gl::Renderer::Program const&) const (this=this@entry=0x7fffe80008c0, renderable=..., prog=...)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/renderers/gl/renderer.cpp:247
#8 0x00007ffff65fd590 in mir::renderer::gl::Renderer::render(std::vector<std::shared_ptr<mir::graphics::Renderable>, std::allocator<std::shared_ptr<mir::graphics::Renderable> > > const&) const (this=0x7fffe80008c0, renderables=...)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/renderers/gl/renderer.cpp:205
#9 0x00007ffff65a30be in composite (this=this@entry=0x7fffe84c76c0,
    scene_elements=scene_elements@entry=<unknown type in /usr/lib/debug/.build-id/01/9340776985304e24a5e24d7cdcce3fc030bb9f.debug, CU 0x216701, DIE 0x23f84d>)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/server/compositor/default_display_buffer_compositor.cpp:83
#10 0x00007ffff65a1076 in mir::compositor::CompositingFunctor::operator()() (this=0x7c4570)
    at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/server/compositor/multi_threaded_compositor.cpp:141
#11 0x00007ffff6601087 in std::function<void ()>::operator()() const () at /usr/include/c++/5/functional:2267
#12 execute (this=0x7fffef7afdf0) at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/server/thread/basic_thread_pool.cpp:40
#13 operator() (this=0x7c4660) at /build/mir-pkdHET/mir-0.21.0+16.04.20160330/src/server/thread/basic_thread_pool.cpp:91
#14 __invoke () at /usr/include/c++/5/functional:201
#15 operator() () at /usr/include/c++/5/functional:428
#16 _M_invoke () at /usr/include/c++/5/functional:1531
#17 operator() () at /usr/include/c++/5/functional:1520
#18 _M_run (this=<optimised out>) at /usr/include/c++/5/thread:115
#19 0x00007ffff6f10c70 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#20 0x00007ffff62e46fa in start_thread (arg=0x7fffef7b0700) at pthread_create.c:333
#21 0x00007ffff697fb5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The exception comes from:

            auto ret = drmPrimeHandleToFD(drm_fd, gem_handle, DRM_CLOEXEC, &raw_fd);
            prime_fd = mir::Fd{raw_fd};
            if (ret)
            {
                std::string const msg("Failed to get PRIME fd from gbm bo");
                BOOST_THROW_EXCEPTION(
                    std::system_error(errno, std::system_category(), "Failed to get PRIME fd from gbm bo"));
            }

Is this something we should be able to handle? How and where?

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Running on lp:mir trunk I get somewhat better behaviour. Instead of a segfault with no information I get:

ERROR: /home/alan/display_server/mir/src/platforms/mesa/server/buffer_allocator.cpp(150): Throw in function virtual void {anonymous}::DMABufTextureBinder::ensure_egl_image()
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::system_error> >
std::exception::what: Failed to get PRIME fd from gbm bo: No such file or directory

Segmentation fault (core dumped)

Revision history for this message
Michał Sawicz (saviq) wrote :

Syncing task from Mir.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.