[Libreoffice-commits] core.git: coverity#1323754 we apparently can survive std::abort for a while

Michael Meeks michael.meeks at collabora.com
Fri Sep 11 03:34:21 PDT 2015


Hi Stephan,

On Fri, 2015-09-11 at 11:25 +0200, Stephan Bergmann wrote:
> > --- a/vcl/source/opengl/OpenGLHelper.cxx
> > +++ b/vcl/source/opengl/OpenGLHelper.cxx
> > @@ -554,6 +554,7 @@ void OpenGLWatchdogThread::execute()
> >                       nUnchanged = 0;
> >                       std::abort();
> >                   }
> > +                // coverity[dead_error_line] - we might have caught SIGABRT and failed to exit yet
> >                   bAbortFired = true;
> >               }
> >           }
> 
> What am I missing here?  abort is guaranteed to not return to its caller 
> (even if there is a handler for SIGABRT).

	Good question; it may well be guaranteed - but - seemingly I saw this
code-path continue; perhaps this is an artifact of the debugger under
windows:

	https://msdn.microsoft.com/en-us/library/k089yyh0.aspx

	has some more details; but I'd swear to not having pressed ignore in my
cases either so ... ;->

>   So, like Coverity, I fail to 
> see how that line can ever be reached (and bAbortFired, of automatic 
> storage during in OpenGLWatchdogThread::execute, ever be true).

	=) well, me too - was gob-smacked etc. of course, in the ideal world
this is true; perhaps I was just gotcha'd by the debugging environment.

	Then again - during our abort handling - we spend a lot of time
creating GUI dialogs and so on on the main thread (which is by now this
one) - that could easily also wedge / lock-up ;-) that's particularly
true wrt. the problem of getting the solar-mutex; my hope is that the
abort handler is good with dropping that.

	Which thread would you expect the signal to be delivered to (I wonder)
- it's all a bit interesting I suspect.

	My hope was that the watchdog would carry on working in these cases &
kill us again more aggressively if necessary if people insist on
ignoring these guys.

> really wanted to do is make bAbortFired static, and set it to true 
> /before/ calling std::abort()?

	I guess we could launch another watchdog thread in this case (if indeed
we believe the that std::abort never returns ;-) in which case making
that static would be useful indeed. Would love to see a patch like that.

	HTH,

		Michael.

-- 
 michael.meeks at collabora.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list