[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GDB giving immediate segfault on LilyPond startup?
From: |
Jean Abou Samra |
Subject: |
Re: GDB giving immediate segfault on LilyPond startup? |
Date: |
Wed, 18 May 2022 21:59:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
Le 18/05/2022 à 13:54, Luca Fascione a écrit :
While trying to see if I could help out Jean, I found this piece of
documentation about libgc:
https://github.com/ivmai/bdwgc/blob/master/doc/debugging.md
BDWGC is the project name for libgc.so
Quoting from that page:
If the fault occurred in GC_find_limit, or with incremental
collection enabled, this is probably normal. The collector
installs handlers to take care of these. You will not see these
unless you are using a debugger. Your debugger should allow you to
continue. It's often preferable to tell the debugger to ignore
SIGBUS and SIGSEGV ("handle SIGSEGV SIGBUS nostop noprint" in gdb,
"ignore SIGSEGV SIGBUS" in most versions of dbx) and set a
breakpoint in abort. The collector will call abort if the signal
had another cause, and there was not other handler previously
installed.
That did prevent GDB from stopping on startup with SIGSEGV, but
it also prevented it from halting when the segfault I was actually
interested in was encountered.
It's possible this will be enough for debugging our Guile-based
application. However, just in case the original page might move, there
is a second mechanism to try if the above proves unsuitable:
If the application generates an unhandled SIGSEGV or equivalent,
it may often be easiest to set the environment variable
GC_LOOP_ON_ABORT. On many platforms, this will cause the collector
to loop in a handler when the SIGSEGV is encountered (or when the
collector aborts for some other reason), and a debugger can then
be attached to the looping process. This sidesteps common
operating system problems related to incomplete core files for
multi-threaded applications, etc.
I don't think lilypond requires this deeper level of trickery, but
just in case.
Didn't work either; but I don't think I'll investigate
too deep, as typing "continue" is an easy fix.
Thanks nevertheless,
Jean