Re: strange static object related crashes

Mark Kretschmann <[email protected]>
Newsgroups gmane.comp.kde.devel.koffice
Message-ID <[email protected]>
On Sat, Nov 6, 2010 at 3:59 PM, Jos van den Oever
<[email protected]> wrote:
> Hi all,
>
> Yesterday I spent quite some time with David Faure to figure out why I was
> getting so many crashes on the build server. I could get a backtrace for this
> command
>  kpresenter --nocrashhandler --profile-filename feaifeo --benchmark-loading
> kofficetests/interoperability/kpresenter/MSPowerpoint2000/mp00_3d_bar_cylinder_chart.ppt
>
> No-body was able to get the same crash. Running valgrind was not working
> because valgrind did not understand some assembler in Qt 4.7.0. So I
> recompiled Qt with the option
>  -no-sse2
> Now valgrind did provide a backtrace (2nd one below). After recompiling koffice
> on this new Qt, the crash disappeared. I am posting this for reference.
>  KDE 4.5.3, Qt 4.7.0 , KOffice trunk
>  gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3

All of these are results of over-usage of static objects. IMHO, we are
using far too many of them, and they can lead to "random" crashes on
exit. Reason:

The destruction order of static objects is undefined.


What we can do now is only trying to fix the existing bugs. It's a lot
of work. In the longer term, I suggest:

1) Reducing usage of static objects.
2) Use state managing for getting fine control over what is started
and destroyed at a certain point.

-- 
Mark Kretschmann
Amarok Developer, Software Engineer at KO GmbH
Fellow of the Free Software Foundation Europe
http://amarok.kde.org - http://fsfe.org - http://kogmbh.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.