Issue Details (XML | Word | Printable)

Key: CORE-6196
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Pavel Zotov
Votes: 0
Watchers: 2

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

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)

Created: 23/Nov/19 09:46 AM   Updated: 23/Nov/19 09:46 AM
Component/s: Engine
Affects Version/s: None
Fix Version/s: None

QA Status: No test

 Description  « Hide
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).

 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
There are no comments yet on this issue.