Error reporting of asio exceptions from AsioDMConnection could be better

Bug #1590447 reported by Michael Terry
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Unity System Compositor
Triaged
Low
Unassigned
unity-system-compositor (Ubuntu)
Triaged
Low
Unassigned

Bug Description

At least in this one case.

Josh Arenson and I were debugging a problem with a greeter / lightdm / unity-system-compositor. It turned out to be because lightdm was passing unity-system-compositor "--from-dm-fd=0" which resulted in an asio exception when it tried to use fd 0.

But the exception looked like:

"""
ERROR: Throw location unknown (consider using BOOST_THROW_EXCEPTION)
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >
std::exception::what: assign: Operation not permitted
"""

It took us a surprising amount of effort to track down where this was actually failing (which was the usc::AsioDMConnection::AsioDMConnection constructor in src/asio_dm_connection.cpp).

I don't have a suggested fix, just a request to make similar failure-hunts easier. Or at the least, this specific error case more obvious.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm not sure this is fixable short of simply not using 3rd party code that throws exceptions. If it's fatal like this one is, we can't catch it and recover. We also can't modify the exception text to be more meaningful.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I would personally recommend never using 'boost' or 'asio' anything. But while we do use it, we also can't (and shouldn't) customise it.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That all said, it appears that we're just doing basic socket stuff. So it's quite feasible to throw away the offending boost code and that would also resolve this bug.

summary: - Error reporting could be better
+ Error reporting of asio exceptions from AsioDMConnection could be better
Changed in unity-system-compositor:
importance: Undecided → Low
Changed in unity-system-compositor (Ubuntu):
importance: Undecided → Low
Changed in unity-system-compositor:
status: New → Triaged
Changed in unity-system-compositor (Ubuntu):
status: New → Triaged
Revision history for this message
Michael Terry (mterry) wrote :

(Or at the least use a try/except here and give a nicer message before dying?)

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.