On Tue, Mar 16, 2010 at 6:38 PM, Pavel Sanda <[email protected]> wrote: > this looks nice.
Thanks :)
>> 2) On SIGSEGV's and SIGABRTS it will print a notification of the
>> back-trace being generated on the terminal, and popup the backtrace
>> this is not as pretty as the QEditText proposal, but this is
>> sufficient for getting the backtrace to the user. This will be
>> discussed a bit below.
>
> i dont get any dialog when segfault occurs.
I suspect this has something to do with how gratuitously non-async
safe my code is. Perhaps this alone is a good reason to push this code
out into a separate binary where we don't have to worry about things
like this.
I could whip together a binary in qtcreator, but my thesis is due in a
couple of months so I probably shouldn't spend time to commit to
"learning new things". Would some one else be interesting in
integrating this with the several build systems LyX supports (or
waiting a couple of months)?
There is a problem with the dialog that I don't know how the solve.
The last few lines of LyX's output to stderr is often highly relevant
(as the next two lines below), but I don't know how the
backtrace-helper could collect this output.
"/usr/include/c++/4.4/debug/vector:272:error: attempt to subscript container
with out-of-bounds index 0, but container only holds 0 elements."
A couple of other minor improvements I'd make to the backtrace-helper
would include
- Mentioning the type of signal recieved ("SIGSEGV", "SIGABRT" etc.)
- Collecting the output of "lyx -version".
- Mentioning the svn revision (maybe this should be added to lyx -version?)
- filtering out lines that match "^(Reading|Loaded) symbols "
- perhaps store the backtraces somewhere more permanent than /tmp, as
they can be useful...
... an example of the use of the backtraces is that we can count the
backtraces reported by backtrace-helper so we can see which bugs are
biting us the hardest. For example, using the attached sriptlet
"profile_bugs.sh" I found that most of the crashing I was getting when
using trunk was in Paragraph::getChar. In my personal tree I am now
testing for invalid positions sent to getChar and converting these to
LASSERTs that can be gracefully handled by backtrace-helper. This will
presumably make this bug less frustrating for me (this modification is
available at http://www.lyx.org/trac/ticket/6607 although it is not
intended to be merged, as it doesn't actually *fix* the bug).
>> OS: This patch should support all OS's LyX supports, but I have
>> only tested Linux. There are some OS specific #ifdef's I have not
>> tested.
>
> people on Windows, could you have a look, if its possible to extend this patch
> it could help us to catch up causes of user crashes much more easily.
I'll just mention that the "proper" way of doing this seems to be to
use google breakpad. This has been tested on Windows, Mac OS X etc,
and works by submitting "minidump" files so we can even get backtraces
from users with stripped binaries (If we have the debug symbols).
Unfortunately the "Getting started" guide for breakpad ends with the
instruction to "write a server" to process the minidumps. Apparently
mozilla has written a server called "socorro" so I guess we could set
this up on www.lyx.org. However this does seem to be leaning towards
the "over-engineered" side of things; it is not like we can just do an
"apt-get/yum install socorro":
http://code.google.com/p/socorro/wiki/SocorroInstallation
This is something that I wouldn't even want to think to hard about on
while I still have a PhD to think of. Even then it seems that breakpad
should be made somewhat easier to use.
--
John C. McCabe-Dansted
profile_bugs.sh
Description: Bourne shell script
