Mir

mirscreencast utility crashes on android devices

Bug #1280086 reported by Alberto Aguirre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
Medium
Alberto Aguirre
mir (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

mir screencast utility SEGFAULT on android devices during glReadPixels call.

Related branches

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

There is a subtle threading issue happening. For some unkown reason, the EGL context goes bad after waiting on a future in the main thread - the EGL context was made current in the main thread and should remain so.

Possibly a TLS issue.

....
 while (running)
    {
        //EGL context is good here - all gl calls made here work fine.
        frame_written_future.wait();
        //EGL context is not valid here anymore all gl calls fail after this wait
        auto format = read_pixels(frame_size, frame_data.data());
        frame_written_future = write_frame_to_file(frame_data, frame_number, format);

        egl_setup.swap_buffers();
        ++frame_number;
    }

description: updated
Changed in mir:
assignee: nobody → Alberto Aguirre (albaguirre)
status: New → In Progress
milestone: none → 0.1.6
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Submitted an issue in libhybris:

https://github.com/libhybris/libhybris/issues/212

summary: - mir screencast utility crashes on android devices
+ mirscreencast utility crashes on android devices
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir/devel at revision None, scheduled for release in mir, milestone Unknown

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
importance: High → Medium
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Debugging further, I noticed that the gl android dispatcher table uses a fixed TLS slot ( slot 6 - offset #24 bytes).

The gnu linker/glibc libraries are not aware of this, so collisions can occur when using std::async or other c++11 constructs which uses thread local storage, which is why allocating dummy thread_local variables helps, since it pushes the slots used by std::async and others away from stomping over slot 6.

I don't think this can be solved in libhybris, short of rewriting the complete android gl dispatcher table.

Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This bug was fixed in the package mir - 0.1.6+14.04.20140310-0ubuntu1
---------------
mir (0.1.6+14.04.20140310-0ubuntu1) trusty; urgency=medium

Changed in mir (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
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.