Re: backend dies when C function calls C++ library that throws an exception

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: backend dies when C function calls C++ library that throws an exception
Дата
Msg-id 14748.1050105300@sss.pgh.pa.us
обсуждение исходный текст
Ответ на backend dies when C function calls C++ library that throws an exception  (David Blasby <dblasby@refractions.net>)
Список pgsql-hackers
David Blasby <dblasby@refractions.net> writes:
> We are having trouble trapping exceptions thrown by the GEOS C++ 
> library.  The library isworking very well in general, but when GEOS 
> raises an exception that tries to leave the GEOS .so library, postgresql 
> immediately dies (signal 6 - ABORT).

The redhat bugzilla entry you reference suggests that this should work
in Linux, given compatible (and recent) versions of gcc/glibc/glibc++.
Are you up to date on those?

But if you want a general cross-platform solution, you may be out of
luck.  Since there is no C++ library in the standard backend, there
is nothing that would know to set up the C++ exception stack.

(It occurs to me that if it's still failing for you on recent Linux
releases, it might be because your code and GEOS are in separate shared
libs that can't even agree on a common location of the C++ exception
stack pointers.)

The only workaround I can think of is to build a nonstandard postgres
executable that contains libc++ as part of the main executable.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sean Chittenden
Дата:
Сообщение: Re: [GENERAL] medical image on postgreSQL?
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [BUGS] Bug #943: Server-Encoding from EUC_TW to UTF-8 doesn't