Issue Details (XML | Word | Printable)

Key: CORE-4705
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

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

3.0 SC crashes at disconnect after running EXECUTE STATEMENT as non-current user

Created: 06/Mar/15 07:59 PM   Updated: 23/Sep/15 11:33 AM
Component/s: Engine
Affects Version/s: 3.0 Beta 1
Fix Version/s: 3.0 Beta 2

File Attachments: 1. Zip Archive fb30sc-log-for-build-31702.zip (2 kB)
2. Zip Archive firebird_log_and_trace_when_fbt_run_against_core_2729.zip (6 kB)


QA Status: Cannot be tested
Test Details: Issue related to fbt_run itself. No error occured when run test script ISQL.


 Description  « Hide
WI-T6.3.0.31698, SuperClassic only.

When running:

fbt_run -b <FB30_SC_home> bugs.core_2729 -o localhost/<port>

-- FB crashes, see attached firebird.log.

File "bugs.core_2729.fbt" contains following test_script section:
"""
    execute block returns (
        user_on_start varchar(32),
        user_on_extds varchar(32),
        same_attach char(1)
    ) as
        declare v_att_ini int;
        declare v_att_eds int;
    begin
    
        user_on_start = current_user;
        v_att_ini = current_connection;
        
        execute statement 'select current_user, current_connection from rdb$database'
        into :user_on_extds, :v_att_eds;
        
     
        same_attach = iif( v_att_ini = v_att_eds, 'Y', 'N');
        suspend;
        
        execute statement 'select current_user, current_connection from rdb$database'
        as user 'test' password 'test'
        into :user_on_extds, :v_att_eds;
        
        same_attach = iif( v_att_ini = v_att_eds, 'Y', 'N');
        suspend;
    
    end
"""
-- please see it in SVN: qa/fbt-repository/trunk/tests/bugs/core_2729.fbt

PS. Windows error message appears ONCE if trace is not running and FIVE times when trace has been launched before fbt_run for this test.

PPS.
firebird.conf:
=========

DefaultDbCachePages = 256
LockHashSlots = 22111
TempCacheLimit = 256M

MaxUnflushedWrites = -1
MaxUnflushedWriteTime = -1

SharedCache = false
SharedDatabase = true

RemoteServicePort=3330

ExternalFileAccess = Restrict C:\MIX\firebird
TempDirectories = c:\temp
MaxUserTraceLogSize = 99999
FileSystemCacheThreshold = 65536K

AuthServer = Legacy_Auth,Srp
AuthClient = Legacy_Auth,Srp,Win_Sspi
WireCrypt = Disabled
UserManager = Legacy_UserManager

BugcheckAbort = 1


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 06/Mar/15 08:05 PM
One more note: NO crash when running similar script via ISQL, it seems that problem somehow related to fbt_run.exe

If I run the following batch:

@echo off

::--------------------------- test SuperClassic ----------------------
set fdb=c2252_sC.fdb
del %fdb% 2>nul
echo create database '%fdb%';|C:\MIX\firebird\fb30sc\isql -q -n

set fbc=C:\MIX\firebird\fb30sc
set fbp=3330
echo Test CLASSIC:
%fbc%\isql localhost/%fbp%:%~dp0%fdb% -i c2252.sql -n
del %fdb% 2>nul


::--------------------------- test SuperServer -----------------------
set fdb=c2252_sS.fdb
del %fdb% 2>nul
echo create database '%fdb%';|C:\MIX\firebird\fb30\isql -q -n

set fbc=C:\MIX\firebird\fb30
set fbp=3333
echo.
echo Test SUPER:
%fbc%\isql localhost/%fbp%:%~dp0%fdb% -i c2252.sql -n

del %fdb% 2>nul

And script for it:

set term ^ ;
execute block
returns (tran_id integer)
as
declare variable db_name type of column mon$attachments.mon$attachment_name;
begin
    select a.mon$attachment_name
    from mon$attachments a
    where a.mon$attachment_id = current_connection
    into :db_name;
    
    execute statement 'select current_transaction from rdb$database'
    on external 'localhost:' || :db_name
    as user 'sysdba' password 'masterke'
    into :tran_id;
    
    suspend;
end
^
set term ;^
set stat off;
rollback;

-- then no crash, but in firebird.log the following lines will appear:


CSPROG Fri Mar 06 22:40:22 2015
Error in isc_release_request() API call when working with legacy security database
invalid request handle


CSPROG Fri Mar 06 22:40:22 2015
Error in isc_detach_database() API call when working with legacy security database
invalid database handle (no active connection)



Dmitry Yemanov added a comment - 06/Mar/15 08:42 PM
Please re-test with a fresh build, please.

Pavel Zotov added a comment - 07/Mar/15 08:32 AM
WI-T3.0.0.31702, SuperClassic.

Now there is *no* crash of FB service.
But error messages still appear in firebird.log:

===
CSPROG Sat Mar 07 11:17:36 2015
Error in isc_release_request() API call when working with legacy security database
invalid request handle


CSPROG Sat Mar 07 11:17:36 2015
Error in isc_detach_database() API call when working with legacy security database
invalid database handle (no active connection)
===

Number of messages in firebird.log is still depends on whether trace was launched or no.
Also, it magically depends on tool which is used for testing - ISQL vs fbt_run.exe -- see attach.

Dmitry Yemanov added a comment - 07/Mar/15 09:36 AM
While these issues may both be related to the "linger" feature, I'd rather separate them. If the crash is gone, this ticket should be closed.