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

FB crashes when database is in full shutdown and several sessions make attempts to attach to this DB in infinite loop (3.0 SuperServer only is affected) [CORE6196] #6441

firebird-issue-importer opened this issue Nov 23, 2019 · 0 comments



Submitted by: @pavel-zotov

1. Create database and change its state to full shutdown

2. Prepare firebird.conf:

RemoteServicePort = 3333
IpcName = fb30\_SS
BugcheckAbort = 1
FileSystemCacheThreshold = 65536K
Servermode = Super
DefaultDbCachePages = 512K
TempBlockSize = 2M
TempCacheLimit = 64M
LockHashSlots = 22111
LockMemSize = 5M
MaxUnflushedWrites = \-1
MaxUnflushedWriteTime = \-1
ExternalFileAccess = full
TempDirectories = D:\\TEMP\\fbb
MaxUserTraceLogSize = 99999
AuthServer = Legacy\_Auth,Srp,Win\_Sspi
AuthClient = Legacy\_Auth,Srp,Win\_Sspi
UserManager = Legacy\_UserManager,Srp
WireCompression = false
WireCrypt = Enabled
KeyHolderPlugin = KeyHolder


3. Create batch file (change variables 'fbc' and 'dsn' according to your environment):

@echo off
setlocal enabledelayedexpansion enableextensions

set dtm=19000101000000
call :get\_ANSI\_precise\_dts dtm time\_only
set dtm=\!dtm::=\!
set dtm=\!dtm:\.=\_\!
set err\_file=%\~dpn0\.\!dtm\!\.err

set fbc=C:\\FB\\30SS
set dsn=localhost:e30

set fbn=firebird\.exe
set err=%\~dpn0\.
set /a iter=0
    set /a iter=\!iter\!\+1
    echo \!time\! iter #⁠ \!iter\!
    echo quit; \| \!fbc\!\\isql \!dsn\! \-q \-user sysdba \-pas masterkey 1\>nul 2\>\!err\_file\!
    findstr /m /c:"SQLSTATE = 08006" \!err\_file\! 1\>nul
    if NOT errorlevel 1 \(
        echo \!time\! No reply from Firebird server\. Bye\-bye\.
        del \!err\_file\!
        goto final
    del \!err\_file\!
goto m1

    for /f "tokens=1\-2 delims=\.\+" %%a in \('wmic\.exe OS GET LocalDateTime ^\| findstr /r /b /c:"20\.\*\."' \) do \(
        set current\_dts=%%a
        set ms\_value=%%b
    set current\_dts=\!current\_dts\!\.\!ms\_value:\~0,2\!

    @rem 20191021\|201404\.22
    @rem 01234567\|890123456

    set time\_ms=\!current\_dts:\~\-9\!
    set current\_time=\!time\_ms:\~0,2\!:\!time\_ms:\~2,2\!:\!time\_ms:\~\-5\!
    if /i \.%2\.==\.time\_only\. \(
        set result=\!current\_time\!
    \) else \(
        set current\_date=\!current\_dts:\~0,8\!
        set current\_date=\!current\_date:\~\-2\!\.\!current\_date:\~4,2\!\.\!current\_dts:\~0,4\!
        set result=\!current\_date\! \!current\_time\!
    endlocal & set "%\~1=%result%"



4. Open two cmd.exe and launch this batch in both of them.

After very short time FB will crach. Both sessions of running batch will stop themselves because get "SQLSTATE = 08006" in STDERR.

Here are dump, stack-trace, firebird.conf and .log:


SuperServer only is affected, and only 3.0 (I've checked WI-V3.0.5.33184).
No such effect on SC and on 4.0 (any mode).

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

Successfully merging a pull request may close this issue.

None yet
1 participant