Hi All!

I have a simple external plugin that throws an exception:

#include "firebird/Interface.h"

using namespace Firebird;

extern "C" void FB_DLL_EXPORT FB_PLUGIN_ENTRY_POINT(IMaster* master)
{
const auto status = master->getStatus();

ISC_STATUS vector[] = {
isc_arg_gds, isc_random, isc_arg_string, (ISC_STATUS) "Unable to initialize module",
isc_arg_end};
const auto ex = FbException(status, vector);
status->dispose();

throw ex;
}

But when an exception throws, server crashes with SIGSEGV:

Thread 5 "firebird" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1075640 (LWP 387536)]

0x00007ffff7c71069 in get_adjusted_ptr(std::type_info const*, std::type_info const*, void**) () from /home/vasiliy/dev/github/firebird/gen/Debug/firebird/lib/libfbclient.so.2
(gdb) bt
#0 0x00007ffff7c71069 in get_adjusted_ptr(std::type_info const*, std::type_info const*, void**) () from /home/vasiliy/dev/github/firebird/gen/Debug/firebird/lib/libfbclient.so.2
#1 0x00007ffff7c7197e in __gxx_personality_v0 ()
from /home/vasiliy/dev/github/firebird/gen/Debug/firebird/lib/libfbclient.so.2
#2 0x00007ffff792e484 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3 0x00007ffff792eebe in _Unwind_Resume () from /lib/x86_64-linux-gnu/libgcc_s.so.1 #4 0x00007ffff7ad5de7 in (anonymous namespace)::PluginSet::loadModule (this=0x7ffff7fc0ce0, info=...)
at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:952
#5 0x00007ffff7ad5366 in (anonymous namespace)::PluginSet::next (this=0x7ffff7fc0ce0, status=0x7ffff1072790) at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:877 #6 0x00007ffff7ad4f15 in (anonymous namespace)::PluginSet::PluginSet (this=0x7ffff7fc0ce0, pinterfaceType=11, pnamesList=0x7ffff1072acc "Debezium_Connector", fbConf=0x0)
at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:814
#7 0x00007ffff7ad671d in Firebird::PluginManager::getPlugins (
this=0x7ffff7f92210 <Why::MasterImplementation::getPluginManager()::manager+16>, status=0x7ffff1072950, interfaceType=11, namesList=0x7ffff1072acc "Debezium_Connector", firebirdConf=0x0) at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:1076 #8 0x00007ffff7ae3bad in Firebird::IPluginManagerBaseImpl<Firebird::PluginManager, Firebird::CheckStatusWrapper, Firebird::IVersionedImpl<Firebird::PluginManager, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IPluginManager> > >::cloopgetPluginsDispatcher ( self=0x7ffff7f92218 <Why::MasterImplementation::getPluginManager()::manager+24>, status=0x7ffff1072bf0, pluginType=11, namesList=0x7ffff1072acc "Replicator_Plugin", firebirdConf=0x0) at /home/vasiliy/dev/github/firebird/src/include/firebird/IdlFbInterfaces.h:8121 #9 0x00007ffff50db385 in Firebird::IPluginManager::getPlugins<Firebird::CheckStatusWrapper> ( this=0x7ffff7f92218 <Why::MasterImplementation::getPluginManager()::manager+24>...

What is the right way to throw an exception? Or it is a bug?

Environment:
Firebird master
Ubuntu 21.10
gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0

--
Vasiliy Yaskov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to