[Spice-devel] [PATCH] common: add backtrace via gstack
Uri Lublin
uril at redhat.com
Mon Jul 18 03:19:05 PDT 2011
On 07/18/2011 12:47 PM, Alon Levy wrote:
> On Mon, Jul 18, 2011 at 11:13:50AM +0200, Christophe Fergeau wrote:
>> On Mon, Jul 18, 2011 at 11:57:47AM +0300, Alon Levy wrote:
>>> On Mon, Jul 18, 2011 at 10:13:27AM +0200, Christophe Fergeau wrote:
>>>> What use case do you have in mind for this? Is it meant for use during
>>>> development when something asserts but we forgot to run it in gdb? Or do
>>>> you want to get more backtraces from crashes in bugzilla? I'm asking
>>>> because /usr/bin/gstack comes in the gdb package here, which is not likely
>>>> to be installed on "users" boxes. glibc also has backtrace(3) and
>>>> backtrace_symbols(3), but they are explicitly documented as GNU extensions.
>>>
>>> Both I guess. Ok, so this fails the second use case. I can do both -
>>> compile backtrack support in if it is available (there must be some
>>> define I can use)
>>
>> Or this can be checked for in configure.ac
I'm not sure configure.ac is the place to check it.
>>
>>
>>> and do gstack first if available, otherwise (if
>>> compiled in) glibc's backtrace.
>>
>> Yep, though for now we can just go with the gstack based trace, and add the
>> backtrace() code later if it's really needed.
>>
>> Christophe
>
> I'll take that as an ack.
Maybe just check (stat) that /usr/bin/gstack exists before fork+exec (although
it's already safe as in such a scenario exec fails and child exits)
More information about the Spice-devel
mailing list