Issue Details (XML | Word | Printable)

Key: CORE-5350
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Assert in CachedMasterInterface::set

Created: 17/Sep/16 08:43 AM   Updated: 19/Feb/17 09:43 PM
Component/s: None
Affects Version/s: 3.0.0, 3.0.1
Fix Version/s: 3.0.2, 4.0 Alpha 1

Environment: Windows 7 x64

QA Status: Cannot be tested


 Description  « Hide
1. Start server [debug build, x64]
2. Connect to database
3. Disconnect from database
4. Wait some time (1-2 minutes)
5. Connect to database again

void CachedMasterInterface::set(IMaster* master)
{
fb_assert(master);
fb_assert(!cached); // <-------------- line with problem
cached = master;
}

Stack of crash:
  engine12.dll!fb_assert_impl(const char * msg, const char * file, int line, bool do_abort) Line 40 C++
> engine12.dll!Firebird::CachedMasterInterface::set(Firebird::IMaster * master) Line 56 C++
  engine12.dll!firebird_plugin(Firebird::IMaster * master) Line 428 C++
  fbclient.dll!`anonymous namespace'::PluginSet::loadModule(const `anonymous-namespace'::PluginLoadInfo & info) Line 1091 C++
  fbclient.dll!`anonymous namespace'::PluginSet::next(Firebird::CheckStatusWrapper * status) Line 1013 C++
  fbclient.dll!`anonymous namespace'::PluginSet::PluginSet(const unsigned int pinterfaceType, const char * const pnamesList, Firebird::IFirebirdConf * const fbConf) Line 928 C++
  fbclient.dll!Firebird::PluginManager::getPlugins(Firebird::CheckStatusWrapper * status, unsigned int interfaceType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 1250 C++
  fbclient.dll!Firebird::IPluginManagerBaseImpl<Firebird::PluginManager,Firebird::CheckStatusWrapper,Firebird::IVersionedImpl<Firebird::PluginManager,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IPluginManager> > >::cloopgetPluginsDispatcher(Firebird::IPluginManager * self, Firebird::IStatus * status, unsigned int pluginType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 6464 C++
  fbclient.dll!Firebird::IPluginManager::getPlugins<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, unsigned int pluginType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 810 C++
  fbclient.dll!Firebird::GetPlugins<Firebird::IProvider>::GetPlugins<Firebird::IProvider>(const unsigned int interfaceType, Config * const knownConfig, const char * namesList) Line 136 C++
  fbclient.dll!Why::Dispatcher::attachOrCreateDatabase(Firebird::CheckStatusWrapper * status, bool createFlag, const char * filename, unsigned int dpbLength, const unsigned char * dpb) Line 5705 C++
  fbclient.dll!Why::Dispatcher::attachDatabase(Firebird::CheckStatusWrapper * status, const char * filename, unsigned int dpbLength, const unsigned char * dpb) Line 5625 C++
  fbclient.dll!Firebird::IProviderBaseImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::IPluginBaseImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IReferenceCountedImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IProvider> > > > > > >::cloopattachDatabaseDispatcher(Firebird::IProvider * self, Firebird::IStatus * status, const char * fileName, unsigned int dpbLength, const unsigned char * dpb) Line 8995 C++
  firebird.exe!Firebird::IProvider::attachDatabase<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, const char * fileName, unsigned int dpbLength, const unsigned char * dpb) Line 2026 C++
  firebird.exe!Auth::SrpServer::authenticate(Firebird::CheckStatusWrapper * status, Firebird::IServerBlock * sb, Firebird::IWriter * writerInterface) Line 138 C++
  firebird.exe!Firebird::IServerBaseImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::IAuthImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IPluginBaseImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IReferenceCountedImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IServer> > > > > > > > >::cloopauthenticateDispatcher(Firebird::IServer * self, Firebird::IStatus * status, Firebird::IServerBlock * sBlock, Firebird::IWriter * writerInterface) Line 9753 C++
  firebird.exe!Firebird::IServer::authenticate<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, Firebird::IServerBlock * sBlock, Firebird::IWriter * writerInterface) Line 2359 C++
  firebird.exe!`anonymous namespace'::ServerAuth::authenticate(packet * send, ServerAuthBase::AuthenticateFlags flags) Line 434 C++
  firebird.exe!accept_connection(rem_port * port, p_cnct * connect, packet * send) Line 1785 C++
  firebird.exe!process_packet(rem_port * port, packet * sendL, packet * receive, rem_port * * result) Line 4193 C++
  firebird.exe!loopThread(void * __formal) Line 5836 C++
  firebird.exe!`anonymous namespace'::ThreadArgs::run() Line 78 C++
  firebird.exe!threadStart(void * arg) Line 94 C++


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 17/Sep/16 09:27 AM
Does not reproduce on linux on current B3_0_Release

Kovalenko Dmitry added a comment - 18/Sep/16 06:12 AM
Reproduced on clear source code of FB 3.0.1.32597 [B3_0_Release]

Microsoft Visual Studio Community 2015
Version 14.0.25431.01 Update 3

Kovalenko Dmitry added a comment - 14/Nov/16 08:05 AM
The problem with this assert still exists.

Original source from B3_0_Release, FB 3.0.2.32629, x64, VS2015 build, SuperServer.

1. Connect to database
2. Disconnect to database
3. Wait one minute
  - server unmaps the "fb_lock_xxxx" and "fb12_monitor_xxxx" files
4. Wait one minute
  - server unmaps the "fb12_trace" file
5. Try to connect to database and get this problem

Watch:
+ master fbclient.dll!0x00007ff9dde25c60 {...} Firebird::IMaster *
+ cached fbclient.dll!0x00007ff9dde25c60 {...} Firebird::IMaster *

Stack:
> engine12.dll!Firebird::CachedMasterInterface::set(Firebird::IMaster * master) Line 55 C++
  engine12.dll!firebird_plugin(Firebird::IMaster * master) Line 428 C++
  fbclient.dll!`anonymous namespace'::PluginSet::loadModule(const `anonymous-namespace'::PluginLoadInfo & info) Line 948 C++
  fbclient.dll!`anonymous namespace'::PluginSet::next(Firebird::CheckStatusWrapper * status) Line 889 C++
  fbclient.dll!`anonymous namespace'::PluginSet::PluginSet(unsigned int pinterfaceType, const char * pnamesList, Firebird::IFirebirdConf * fbConf) Line 821 C++
  fbclient.dll!Firebird::PluginManager::getPlugins(Firebird::CheckStatusWrapper * status, unsigned int interfaceType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 1080 C++
  fbclient.dll!Firebird::IPluginManagerBaseImpl<Firebird::PluginManager,Firebird::CheckStatusWrapper,Firebird::IVersionedImpl<Firebird::PluginManager,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IPluginManager> > >::cloopgetPluginsDispatcher(Firebird::IPluginManager * self, Firebird::IStatus * status, unsigned int pluginType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 6509 C++
  fbclient.dll!Firebird::IPluginManager::getPlugins<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, unsigned int pluginType, const char * namesList, Firebird::IFirebirdConf * firebirdConf) Line 811 C++
  fbclient.dll!Firebird::GetPlugins<Firebird::IProvider>::GetPlugins<Firebird::IProvider>(unsigned int interfaceType, Config * knownConfig, const char * namesList) Line 62 C++
  fbclient.dll!Why::Dispatcher::attachOrCreateDatabase(Firebird::CheckStatusWrapper * status, bool createFlag, const char * filename, unsigned int dpbLength, const unsigned char * dpb) Line 5679 C++
  fbclient.dll!Why::Dispatcher::attachDatabase(Firebird::CheckStatusWrapper * status, const char * filename, unsigned int dpbLength, const unsigned char * dpb) Line 5612 C++
  fbclient.dll!Firebird::IProviderBaseImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::IPluginBaseImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IReferenceCountedImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Why::Dispatcher,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IProvider> > > > > > >::cloopattachDatabaseDispatcher(Firebird::IProvider * self, Firebird::IStatus * status, const char * fileName, unsigned int dpbLength, const unsigned char * dpb) Line 9040 C++
  firebird.exe!Firebird::IProvider::attachDatabase<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, const char * fileName, unsigned int dpbLength, const unsigned char * dpb) Line 2027 C++
  firebird.exe!Auth::SrpServer::authenticate(Firebird::CheckStatusWrapper * status, Firebird::IServerBlock * sb, Firebird::IWriter * writerInterface) Line 138 C++
  firebird.exe!Firebird::IServerBaseImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::IAuthImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IPluginBaseImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IReferenceCountedImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IVersionedImpl<Auth::SrpServer,Firebird::CheckStatusWrapper,Firebird::Inherit<Firebird::IServer> > > > > > > > >::cloopauthenticateDispatcher(Firebird::IServer * self, Firebird::IStatus * status, Firebird::IServerBlock * sBlock, Firebird::IWriter * writerInterface) Line 9798 C++
  firebird.exe!Firebird::IServer::authenticate<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper * status, Firebird::IServerBlock * sBlock, Firebird::IWriter * writerInterface) Line 2360 C++
  firebird.exe!`anonymous namespace'::ServerAuth::authenticate(packet * send, ServerAuthBase::AuthenticateFlags flags) Line 434 C++
  firebird.exe!accept_connection(rem_port * port, p_cnct * connect, packet * send) Line 1785 C++
  firebird.exe!process_packet(rem_port * port, packet * sendL, packet * receive, rem_port * * result) Line 4191 C++
  firebird.exe!loopThread(void * __formal) Line 5834 C++
  firebird.exe!`anonymous namespace'::ThreadArgs::run() Line 78 C++
  firebird.exe!threadStart(void * arg) Line 94 C++

Alexander Peshkov added a comment - 14/Nov/16 04:54 PM
Confirmed on windows

Kovalenko Dmitry added a comment - 16/Nov/16 07:26 PM
With release build (in same scenario - connect/disconnect/pause/connect) I get the "Error occurred during login, please check server firebird.log for details." error.

Tested at FB x64 SuperServer (VS2015 SP3 build).

Vlad Khorsun added a comment - 17/Nov/16 11:13 AM
Fix is committed, verify please

Kovalenko Dmitry added a comment - 17/Nov/16 12:25 PM - edited
Debug and release binaries (SuperServer x64) now work without these problems.