Issue Details (XML | Word | Printable)

Key: CORE-3125
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1
Operations

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

AV in Worker::shutdown

Created: 06/Sep/10 05:27 AM   Updated: 23/Feb/11 07:41 AM
Component/s: Engine
Affects Version/s: 2.5 RC3
Fix Version/s: 2.5.1, 3.0 Alpha 1

Time Tracking:
Not Specified

File Attachments: 1. File 2010_09_06__server_AV_in Worker_shutdown__without_dump.7z (139 kB)

Environment: SuperClassic x64 / Vista x64 / IBProvider Test System

Planning Status: Unspecified


 Description  « Hide
Guten Morgen

[06.09.2010 01:28:35] [info] Provider DLL :_IBProvider_v3_vc9_w64_trial_i.dll
[06.09.2010 01:28:35] [info] Provider Version:3.0.0.10547
[06.09.2010 01:28:35] [info] Server Name :Firebird SuperClassic x64 [2010-08-31 09:32] [VS2008 SP1+]
[06.09.2010 01:28:35] [info] Server Version :2.5.0.26073
[06.09.2010 01:28:35] [info] Client Name :Firebird SQL Server
[06.09.2010 01:28:35] [info] Client Version :2.5.0.26073
[06.09.2010 01:28:35] [info] Database ODS :11.2
[06.09.2010 01:28:35] [info] Database Dialect:3

---- [Stack of crash thread]
  ntdll.dll!RtlEnterCriticalSection() + 0x6 байт
> fb_inet_server.exe!Worker::shutdown() Строка 5616 C++
  fb_inet_server.exe!SRVR_multi_thread(rem_port * main_port=0x0000000000000000, unsigned short flags=0) Строка 706 C++
  fb_inet_server.exe!inet_connect_wait_thread(void * __formal=0x0000000000000000) Строка 381 + 0x8 байт C++
  fb_inet_server.exe!`anonymous namespace'::threadStart(void * arg=0x0000000000000000) Строка 139 + 0x5 байт C++
  msvcr90.dll!_callthreadstartex() Строка 348 + 0xd байт C
  msvcr90.dll!_threadstartex(void * ptd=0x0000000000000000) Строка 326 + 0x5 байт C
  kernel32.dll!BaseThreadInitThunk() + 0xd байт
  ntdll.dll!RtlUserThreadStart() + 0x21 байт

----
Other informations (without dump file) will be included in 7Z archive

For obtain the dump (19MB in 7Z archive) and binaries - please contact with me


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kovalenko Dmitry added a comment - 06/Sep/10 05:31 AM
00_readme.txt
01_threads.txt
01_threads__sorted_by_func.txt
01_threads__sorted_by_ID.txt
02_thread__1384.txt
02_thread__1864.txt
02_thread__1880.txt
02_thread__2432.txt
02_thread__3324.txt
02_thread__3356.txt
02_thread__3724.txt
02_thread__4524.txt
02_thread__4744.txt
02_thread__5064.txt
02_thread__5140.txt
02_thread__5416.txt
02_thread__5556.txt
02_thread__6112.txt
02_thread__6280.txt
02_thread__7676.txt
03_fb_inet_server.exe_info__DLLs.txt
03_fb_inet_server.exe_info__files.txt
04_modules.txt
VS2008_screen.bmp

Kovalenko Dmitry added a comment - 06/Sep/10 06:01 AM
Last information from firebird.log (created at during test cycle)

-----
HOME2 Mon Sep 06 01:03:46 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 01:03:46 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 01:03:46 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 02:02:22 2010
Database: D:\DATABASE\IBP_TEST_FB25_D3.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 02:02:23 2010
Database: D:\DATABASE\IBP_TEST_FB25_D3.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 02:02:23 2010
Database: D:\DATABASE\IBP_TEST_FB25_D3.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Mon Sep 06 02:02:23 2010
Access violation.
The code attempted to access a virtual
address without privilege to do so.
This exception will cause the Firebird server
to terminate abnormally.

HOME2 Mon Sep 06 02:02:23 2010
INET/inet_error: send errno = 10093

HOME2 Mon Sep 06 02:02:23 2010
INET/inet_error: select in packet_receive errno = 10093

HOME2 Mon Sep 06 02:02:23 2010
INET/select_wait: select failed, errno = 10093

HOME2 Mon Sep 06 02:02:23 2010
SRVR_multi_thread/RECEIVE: error on main_port, shutting down

Vlad Khorsun added a comment - 06/Sep/10 12:03 PM
With great help of Dmitry Kovalenko i found following:

thread 4524 doing sweep.
sweep terminated abnormally because of bugcheck 179 (why it happens is another story).
sweep's Attachment was released (see unwindAttach()) and its Database is releasing also.
It waits in LM because there is an AST which is currently delivered.
Note, Attachment is gone completely and Database almost destroyed.

thread 7676 executed some query .
An AST interrupted its execution. This is DatabaseSnapshot::blockingAst().
An AST established new execution context (this is almost destroyed database from thread 4524).
As Attachment from thread 4524 is gone, it detached from all locks it holds at destroy time.
Therefore in AST's tdbb we have Database from thread 4524 and NULL Attachment.
An AST handler call PIO_get_number_of_pages() which call GetFileSize(hFile, ...) which returns error, as Database file is already closed.
nt_error() call ERR_punt() and we have AV there at

gds__log_status(tdbb->getAttachment()->att_filename.hasData() ?
tdbb->getAttachment()->att_filename.c_str() : NULL,

remember, we have NULL attachment in tdbb.

This AV is loggeg in firebird.log and it is OK. But ISC_exception_post() calls exit() which is initialted engine shutdown and started to
destroy all global variables and performs additional cleanup.

One of the cleanup routines is INET\wsaExitHandler(). It calls WSACleanup(). Therefore we have 10093 errors in firebird.log.
Listener is stopped and waiting for all worker threads to exit. But its static mutex Worker::m_mutex is destroyed and we have
second AV which is a subject of this ticket.

Kovalenko Dmitry added a comment - 10/Sep/10 02:21 AM - edited
Guten morgen (#2)

I like my new combination of tests :)

target\ibp_oledb_test_vc9_Win32_Release.exe /auto /thread_count 8 /log_dir _log /log_file_prefix local_d1 /cn_str "provider=LCPI.IBProvider.3;location=localhost:d:\database\ibp_test_fb25_d1.gdb;user id=gamer;password=vermut;ctype=win1251;icu_library=icuuc30.dll;dbclient_library=fbclient.dll" /test cmd* /test column* /test array*001* /test icr* /test rowset* /test schema*column* /test schema*param* /test octet*

HOME2 Fri Sep 10 00:52:23 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)
HOME2 Fri Sep 10 00:52:23 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)
HOME2 Fri Sep 10 00:52:23 2010
Database: D:\DATABASE\IBP_TEST_FB25_D1.GDB
internal Firebird consistency check (decompression overran buffer (179), file: sqz.cpp line: 235)

HOME2 Fri Sep 10 00:52:23 2010
Access violation.
The code attempted to access a virtual
address without privilege to do so.
This exception will cause the Firebird server
to terminate abnormally.

HOME2 Fri Sep 10 00:52:23 2010
INET/inet_error: select in packet_receive errno = 10093
HOME2 Fri Sep 10 00:52:23 2010
INET/select_wait: select failed, errno = 10093
HOME2 Fri Sep 10 00:52:23 2010
SRVR_multi_thread/RECEIVE: error on main_port, shutting down