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)
--------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-6196
                 URL: http://tracker.firebirdsql.org/browse/CORE-6196
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
            Reporter: 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
    :m1
        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


    :get_ANSI_precise_dts
        setlocal
        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%"
    goto:eof


    :final

=======

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:

https://drive.google.com/open?id=13KPHXcYhJFBByqFtF1mfPV08KmpDgsF0

PS.

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).




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to