Re: [Firebird-devel] Handling exception from external plugins

2022-04-11 Thread Vasiliy Yashkov

Ok, now I get it. Thanks for the explanations!

--
Vasiliy Yashkov



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


[Firebird-devel] Handling exception from external plugins

2022-04-11 Thread Vasiliy Yashkov

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 0x71075640 (LWP 387536)]

0x77c71069 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 0x77c71069 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 0x77c7197e in __gxx_personality_v0 ()
from 
/home/vasiliy/dev/github/firebird/gen/Debug/firebird/lib/libfbclient.so.2

#2 0x7792e484 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3 0x7792eebe in _Unwind_Resume () from 
/lib/x86_64-linux-gnu/libgcc_s.so.1
#4 0x77ad5de7 in (anonymous namespace)::PluginSet::loadModule 
(this=0x77fc0ce0, info=...)

at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:952
#5 0x77ad5366 in (anonymous namespace)::PluginSet::next 
(this=0x77fc0ce0,
status=0x71072790) at 
/home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:877
#6 0x77ad4f15 in (anonymous namespace)::PluginSet::PluginSet 
(this=0x77fc0ce0,
pinterfaceType=11, pnamesList=0x71072acc "Debezium_Connector", 
fbConf=0x0)

at /home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:814
#7 0x77ad671d in Firebird::PluginManager::getPlugins (
this=0x77f92210 
,
status=0x71072950, interfaceType=11, namesList=0x71072acc 
"Debezium_Connector",
firebirdConf=0x0) at 
/home/vasiliy/dev/github/firebird/src/yvalve/PluginManager.cpp:1076
#8 0x77ae3bad in 
Firebird::IPluginManagerBaseImplFirebird::CheckStatusWrapper, 
Firebird::IVersionedImplFirebird::CheckStatusWrapper, 
Firebird::Inherit > >::cloopgetPluginsDispatcher (
self=0x77f92218 
,
status=0x71072bf0, pluginType=11, namesList=0x71072acc 
"Replicator_Plugin",
firebirdConf=0x0) at 
/home/vasiliy/dev/github/firebird/src/include/firebird/IdlFbInterfaces.h:8121
#9 0x750db385 in 
Firebird::IPluginManager::getPlugins (
this=0x77f92218 
...


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


[Firebird-devel] [FB-Tracker] Created: (CORE-5633) Recalculating computed fields that depend on altering field

2017-10-09 Thread Vasiliy Yashkov (JIRA)
Recalculating computed fields that depend on altering field
---

 Key: CORE-5633
 URL: http://tracker.firebirdsql.org/browse/CORE-5633
 Project: Firebird Core
  Issue Type: Bug
  Components: Engine
Affects Versions: 4.0 Alpha 1, 3.0.2, 2.5.7, 3.0.1, 2.5.6, 3.0.0
 Environment: Ubuntu 17.04 x86_64 Linux 4.10
Reporter: Vasiliy Yashkov


When field is altered, a computed fields, that depend on it, don't altered.
Example:
create table test(f1 varchar(6));
commit;
create table test1(f1 integer, f2 computed by((select first 1 f1 from test)));
commit;
create view v1 as select f1 from test;
commit;
alter table test alter column f1 type varchar(8);
commit;
insert into test(f1) values('qwertyqw');
commit;
insert into test1(f1) values(1);
commit;
select * from test1; --arithmetic exception, numeric overflow, or string 
truncation

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel