Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV in Worker::shutdown [CORE3125] #3502

Closed
firebird-issue-importer opened this issue Sep 6, 2010 · 10 comments
Closed

AV in Worker::shutdown [CORE3125] #3502

firebird-issue-importer opened this issue Sep 6, 2010 · 10 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Submitted by: @ibprovider

Attachments:
2010_09_06__server_AV_in Worker_shutdown__without_dump.7z

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

Commits: 705551a ae60094

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Commented by: @ibprovider

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Modified by: @ibprovider

Attachment: 2010_09_06__server_AV_in Worker_shutdown__without_dump.7z [ 11760 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Commented by: @ibprovider

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 6, 2010

Commented by: @hvlad

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 10, 2010

Commented by: @ibprovider

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 22, 2011

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 30, 2016

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants