Issue Details (XML | Word | Printable)

Key: CORE-3443
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0

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

Races in UDF library lookup

Created: 15/Apr/11 06:15 PM   Updated: 15/Jul/15 04:28 AM
Component/s: None
Affects Version/s: 3.0 Initial, 2.5.0
Fix Version/s: 2.5.1, 3.0 Alpha 1

QA Status: Cannot be tested

 Description  « Hide
Was reported privately by Dmitry Kovalenko.

When closing database on superclassic server in rare cases AV happens with following stack trace:

   ntdll.dll!RtlEnterCriticalSection() + 0x6 байт
   fb_inet_server.exe!Firebird::MemoryPool::deallocate(void * block=0x00000000047b7128) Строка 1942 C++
   fb_inet_server.exe!Jrd::Module::InternalModule::~InternalModule() Строка 77 + 0x1e байт C++
   fb_inet_server.exe!Jrd::Module::~Module() Строка 332 + 0x11 байт C++
   fb_inet_server.exe!Jrd::Module::`scalar deleting destructor'() + 0x14 байт C++
   fb_inet_server.exe!Jrd::Database::~Database() Строка 98 + 0x243 байт C++
   fb_inet_server.exe!shutdown_database(Jrd::Database * dbb=0x0000000004876aa8, const bool release_pools=true) Строка 5409 + 0x35 байт C++
   fb_inet_server.exe!purge_attachment(Jrd::thread_db * tdbb=0x0000000002f6f940, Jrd::Attachment * attachment=0x00000000047b71f8, const bool force_flag=false) Строка 5882 C++
   fb_inet_server.exe!jrd8_detach_database(__int64 * user_status=0x0000000002f6fb40, Jrd::Attachment * * handle=0x00000000005be2d8) Строка 2306 + 0x13 байт C++
   fb_inet_server.exe!detach_or_drop_database(__int64 * user_status=0x000000001280ba48, unsigned int * handle=0x0000000005244bb0, const int proc=410085592, const __int64 specCode=1) Строка 2270 + 0x19 байт C++

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 15/Apr/11 06:17 PM
The reason of a bug is used earlier 'long' instead 'AtomicCounter' to count references to UDF module from various databases. Before 2.5 it was safe.

Alexander Peshkov added a comment - 30/May/11 02:07 PM
It's really good idea to use atomic counter in such cases.