Re: [PATCH] PR30879: debuginfod intermittent terminate()

2023-10-01 Thread Mark Wielaard
Hi Frank,

On Fri, Sep 22, 2023 at 04:36:07PM -0400, Frank Ch. Eigler via Elfutils-devel 
wrote:
> 
> Author: Frank Ch. Eigler 
> Date:   Fri Sep 22 15:30:51 2023 -0400
> 
> PR30879: intermittent debuginfod crash with unhandled exception
> 
> Code inspection identified two places where sqlite_ps objects were
> being created/used outside try/catch protection.  This patch wraps or
> replaces them.
> 
> * configure.ac: Look for glibc backtrace headers.
> * debuginfod.cxx (scan): New function wrapped by a try/catch loop.
>   (sqlite_checkpoint_pb): Use non-exception-producing sqlite functions.
>   (main, my_terminate_handler): New terminate() handler.

The new terminate_handler seems really useful, I wonder why something
like this isn't the default behaviour.

I think I understand the idea behind wrapping scan () to catch the
reportable_exception.

The sqlite_checkpoint_pb looks simpler now. But I must admit I don't
fully understand if the lifetime of the object. The sqlite_ps had a
destructor that called finalize, which I assume isn't necessary?

The code looks good to me.

Did you already catch (haha, pun intended) where/what caused that odd
sparc uncaught exception?

Cheers,

Mark


Re: [PATCH] PR30879: debuginfod intermittent terminate()

2023-10-01 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> The new terminate_handler seems really useful, I wonder why something
> like this isn't the default behaviour.

Yeah.

> I think I understand the idea behind wrapping scan () to catch the
> reportable_exception.

Yup.

> The sqlite_checkpoint_pb looks simpler now. But I must admit I don't
> fully understand if the lifetime of the object. The sqlite_ps had a
> destructor that called finalize, which I assume isn't necessary?

In the new case, we're calling "sqlite3_execute" directly, which does
not need finalization.

> The code looks good to me.

Thanks!

> Did you already catch (haha, pun intended) where/what caused that odd
> sparc uncaught exception?

Nope. :( In the cases I saw, the error occurred right during the
object ctor, but was not able to trigger it by hand or get a core dump
to analyze further.

- FChE