John McCabe-Dansted wrote:
> This patch adds a backtrace helper.
> 1) On LASSERTS it will pop-up a dialog notifying the user an assert
> has occurred and that a back-trace has been generated. It will then
> continue. There were some arguments for aborting LyX, but I think they
> were made on the understanding that aborting LyX was the only way to
> get a back-trace. Anyway if the new behavior is not desired one can
> set the LYX_NO_BACKTRACE_HELPER command-line variable.

this looks nice.

> 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.

lyx: SIGSEGV signal caught
Sorry, you have found a bug in LyX. Please read the bug-reporting instructions 
in Help->Introduction and send us a bug report, if necessary. Thanks !
Bye.
lassert.cpp(69): Generating backtrace

lassert.cpp(70): python -c  "print 'set height 0'; print 'bt'; print 
'\n'.join(['q' for n in xrange (1, 999999)])" | gdb -q src/lyx 21047 > 
/trash/lyx_tmpdir.T21047/lyx.backtrace.LhX21047.txt

warning: Can not parse XML syscalls information; XML support was disabled at 
compile time.
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 32] Broken pipe
lassert.cpp(71): GDB RESULT: 0

lassert.cpp(72): Backtrace 
generated:/trash/lyx_tmpdir.T21047/lyx.backtrace.LhX21047.txt

lassert.cpp(73): Please attach the this backtrace to your bugreport

Aborted


> Compatibililty:
>    Compilers: This patch only supports GNUC (gcc, mingw etc.). Other
> compilers get the old behavior. It should be easy to extend to other
> compilers however (1-5 LOC per compiler).
>
>    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.

> This patch does not implement your idea where we pipe data into
> separate process with a QTextEdit. However, it does get the job done
> of displaying the needed information to the users and I recall that
> you wanted to avoid over-engineering. Would you still like this
> functionality?

i like this functionality and i'm all for having it enabled by default
for build type of devel/prereleases.

if its supported on all platforms we can do something like this:
release all alpha/beta with debugging symbols on and let this
feature to be enabled. on stable releases we would switch this
off but we could still offer "lyx -debugger_on" in commandline. in
this case only limited bt will be obtained due to lacking
symbols.

>  I note that such a binary would be about  330K (or 27k stripped).
> Would you like a separate binary, called say "lyx-backtrace-dialog"

not sure. separate binary maybe be better. and also it would be fine
to get the whole backtrace displayed under the file name for convenience.

pavel

Reply via email to