Crashes libfbclient

12 views
Skip to first unread message

Jorge Gonçalves

unread,
May 17, 2023, 12:03:09 PM5/17/23
to firebir...@googlegroups.com
Hello, 
we are running some stress tests using unixODBC and we are finding a lot of crashes in libfbclient. 
The test consists of making several asynchronous connections (+1000 ) and disconnects. In this process we always keep ~100 active connections.

On almost every run ( + 700 connections)  libfbclient crashes. 

The tests are done on Linux using libcliente 2.5.9 and  3.0 . 
We get the source code of 2.5.9 and the current git trunk and have re-run the test with debug Info .  

Can you help us or advise any client version where these issues are resolved?

Findings:

-- Was crashing due to a call to 'getDefaultMemoryPool' after the default pool was de-allocated ('cleanupDefaultPool') [versions 2.5.9 and 5.0]:

(from version 2.5.9)

#0  0x00007f652059d301 in Firebird::MemoryPool::allocate_nothrow (this=0x0, size=192, upper_size=0, file=0x7f652061f358 "../src/common/StatusArg.cpp", line=66) at ../src/common/classes/alloc.cpp:789
#1  0x00007f652059d7bf in Firebird::MemoryPool::verify_pool (this=0x4200000000, fast_checks_only=false) at ../src/common/classes/alloc.cpp:911
#2  0x00007f652052fcb2 in operator new (s=192, pool=..., file=0x7f652061f358 "../src/common/StatusArg.cpp", line=66) at ../src/include/../common/classes/alloc.h:505
#3  0x00007f6520599aaf in Firebird::Arg::StatusVector::StatusVector (this=0x7f653f7db268, k=1, c=335544373) at ../src/common/StatusArg.cpp:66
#4  0x00007f652059a529 in Firebird::Arg::Gds::Gds (this=0x7f653f7db268, s=335544373) at ../src/common/StatusArg.cpp:210
#5  0x00007f65205979e3 in Firebird::system_error::system_error (this=0x7f64b8068ff0, syscall=0x7f65205c9514 "pthread_mutex_lock", error_code=22) at ../src/common/fb_exception.cpp:354
#6  0x00007f6520597bdf in Firebird::system_call_failed::system_call_failed (this=0x7f64b8068ff0, syscall=0x7f65205c9514 "pthread_mutex_lock", error_code=22) at ../src/common/fb_exception.cpp:382
#7  0x00007f6520597c2b in Firebird::system_call_failed::raise (syscall=0x7f65205c9514 "pthread_mutex_lock", error_code=22) at ../src/common/fb_exception.cpp:398
#8  0x00007f652052fb6a in Firebird::Mutex::enter (this=0x7f653c1300d8) at ../src/include/../common/classes/locks.h:172
#9  0x00007f652052fbd6 in Firebird::MutexLockGuard::MutexLockGuard (this=0x7f653f7db388, alock=...) at ../src/include/../common/classes/locks.h:246

-- Sometimes we get the following error: Assertion (lockCounter.value() == 0) failure: [...]/firebird/src/yvalve/../common/classes/rwlock.h 235 and the program aborts [version 5.0]

-- Another crash [version 5.0]:

#0  0x00007fd3094099ec in Firebird::RefPtr<Firebird::RefMutex>::operator Firebird::RefMutex* (this=0x7fd1f1db57e0) at /home/msilva/code/firebird/src/include/../common/classes/RefCounted.h:181
#1  0x00007fd30943c610 in (anonymous namespace)::ClientPortsCleanup::closePort (this=0x7fd31c003bd0, port=0x7fd1f1db57d0) at /home/msilva/code/firebird/src/remote/client/interface.cpp:9476
#2  0x00007fd309419560 in PortsCleanup::closePorts (this=0x7fd31c003bd0) at /home/msilva/code/firebird/src/remote/remote.cpp:814
#3  0x00007fd3094247bd in Remote::RProvider::shutdown (this=0x7fd30b1ab7d0, status=0x7fff1115cd90) at /home/msilva/code/firebird/src/remote/client/interface.cpp:1023
#4  0x00007fd309452091 in Firebird::IProviderBaseImpl<Remote::RProvider, Firebird::CheckStatusWrapper, Firebird::IPluginBaseImpl<Remote::RProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IReferenceCountedImpl<Remote::RProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IVersionedImpl<Remote::RProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IProvider> > > > > > >::cloopshutdownDispatcher (self=0x7fd30b1ab7d8, status=0x7fff1115cf58, timeout=36000000, reason=-7) at /home/msilva/code/firebird/src/include/firebird/IdlFbInterfaces.h:12140
#5  0x00007fd3093d8634 in Firebird::IProvider::shutdown<Firebird::CheckStatusWrapper> (this=0x7fd30b1ab7d8, status=0x7fff1115cf50, timeout=36000000, reason=-7)
    at /home/msilva/code/firebird/src/include/firebird/IdlFbInterfaces.h:2938
#6  0x00007fd3093c117b in Why::Dispatcher::shutdown (this=0x7fd1e7b9aeb0, userStatus=0x7fff1115d400, timeout=36000000, reason=-7) at /home/msilva/code/firebird/src/yvalve/why.cpp:6676
#7  0x00007fd3093b3ab2 in fb_shutdown (timeout=10000, reason=-7) at /home/msilva/code/firebird/src/yvalve/why.cpp:3790
#8  0x00007fd3093a738f in (anonymous namespace)::ShutdownInit::atExitShutdown () at /home/msilva/code/firebird/src/yvalve/why.cpp:763
#9  0x00007fd3094d52ae in Firebird::InstanceControl::destructors () at /home/msilva/code/firebird/src/common/classes/init.cpp:244
#10 0x00007fd3094d4e6d in (anonymous namespace)::allClean () at /home/msilva/code/firebird/src/common/classes/init.cpp:112
#11 0x00007fd3094d57fe in std::_Function_handler<void (), void (*)()>::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/9/bits/std_function.h:300
#12 0x00007fd3093ce1fc in std::function<void ()>::operator()() const (this=0x7fd30984e020 <(anonymous namespace)::global>) at /usr/include/c++/9/bits/std_function.h:688
#13 0x00007fd3093cb89c in Firebird::Cleanup::~Cleanup (this=0x7fd30984e020 <(anonymous namespace)::global>, __in_chrg=<optimized out>) at /home/msilva/code/firebird/src/include/../common/classes/auto.h:315
#14 0x00007fd31ced48a7 in __run_exit_handlers (status=0, listp=0x7fd31d07a718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#15 0x00007fd31ced4a60 in __GI_exit (status=<optimized out>) at exit.c:139
#16 0x00007fd31ceb208a in __libc_start_main (main=0x564d300c45a0, argc=1, argv=0x7fff1115e808, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff1115e7f8)
    at ../csu/libc-start.c:342

Adriano dos Santos Fernandes

unread,
May 22, 2023, 8:38:25 PM5/22/23
to firebir...@googlegroups.com
Test case, please.


Adriano


On 17/05/2023 10:49, Jorge Gonçalves wrote:
> Hello, 
> we are running some stress tests using unixODBC and we are finding a lot
> of crashes in libfbclient. 
> The test consists of making several asynchronous connections (+1000 )
> and disconnects. In this process we always keep ~100 active connections.
>
> On almost every run ( + 700 connections)  libfbclient crashes. 
>
> The tests are done on Linux using libcliente 2.5.9 and  3.0 . 
> We get the source code of 2.5.9 and the current git trunk and have
> re-run the test with debug Info .  
>
> Can you help us or advise any client version where these issues are
> resolved?
>
> Findings:
>
> -- Was crashing due to a call to '*getDefaultMemoryPool*' after the
> default pool was de-allocated ('*cleanupDefaultPool*')*[versions 2.5.9
> and 5.0]*:
> -- Sometimes we get the following error: *Assertion (lockCounter.value()
> == 0) failure: [...]/firebird/src/yvalve/../common/classes/rwlock.h 235
> *and the program aborts***[version 5.0]*
>
> -- Another crash *[version 5.0]*:
> --
> You received this message because you are subscribed to the Google
> Groups "firebird-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to firebird-deve...@googlegroups.com
> <mailto:firebird-deve...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/firebird-devel/CAFwqtPJ_kZOhuDGsxMpeCa3J6rOuHJys%3D7SLP3JEGbSW9EBhqQ%40mail.gmail.com <https://groups.google.com/d/msgid/firebird-devel/CAFwqtPJ_kZOhuDGsxMpeCa3J6rOuHJys%3D7SLP3JEGbSW9EBhqQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages