Skip site navigation (1) Skip section navigation (2)

Re: Mostly Harmless: c++exception - patch 4 of 4

From: Kurt Harriman <harriman(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Mostly Harmless: c++exception - patch 4 of 4
Date: 2008-12-05 09:20:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
(Re-sending just the fourth of four patches: c++exception)

These patches are based on CVS head in which the latest commit was
  user:        petere
  date:        Thu Dec 04 17:51:28 2008 +0000
  summary:     Default values for function arguments

4. c++exception

     When C code calls C++ code, all C++ exceptions need to be caught
     and fully contained within the C++ code.  Exceptions should never
     be thrown outward across the C/C++ frontier.

     If an exception is not caught within C++ code, and the search for
     a matching 'catch' bumps into a C stack frame, the result may be
     platform dependent.  On my platform (Linux/GCC), if this happens
     in the postgres backend, the process terminates silently as if
     abort() had been called.

     With this patch, if --enable-cplusplus is configured,
     PostgresMain defines a handler to intercept any uncaught C++
     exception and convert it to a conventional PostgreSQL error of
     FATAL severity.  This allows the backend to clean up and report
     the error before terminating.

Attachment: c++exception.patch
Description: text/plain (3.3 KB)

In response to

pgsql-hackers by date

Next:From: Greg SmithDate: 2008-12-05 09:24:06
Subject: Re: Mostly Harmless: Welcoming our C++ friends
Previous:From: Kurt HarrimanDate: 2008-12-05 09:18:46
Subject: Re: Mostly Harmless: c++configure - patch 3 of 4

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group