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

3.0 SC crashes at disconnect after running EXECUTE STATEMENT as non-current user [CORE4705] #5013

Closed
firebird-automations opened this issue Mar 6, 2015 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
firebird_log_and_trace_when_fbt_run_against_core_2729.zip
fb30sc-log-for-build-31702.zip

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

Commits: d2db1a7 FirebirdSQL/fbt-repository@8fb0015

====== Test Details ======

Issue related to fbt_run itself. No error occured when run test script ISQL.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: firebird_log_and_trace_when_fbt_run_against_core_2729.zip [ 12682 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

summary: 3.0 SC: crash when running fbt_run with ES EDS => 3.0 SC: crash when running fbt_run with ES

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

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)

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

description: 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 = 32765
LockHashSlots = 22111
TempCacheLimit = 2147483647
RemoteServicePort = 3333
MaxUnflushedWrites = -1
MaxUnflushedWriteTime = -1
TempDirectories = c:\temp
MaxUserTraceLogSize = 99999
FileSystemCacheThreshold = 65536K
AuthServer = Legacy_Auth,Srp
AuthClient = Legacy_Auth,Srp,Win_Sspi
WireCrypt = Disabled
UserManager = Legacy_UserManager
BugcheckAbort = 1

=>

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Please re-test with a fresh build, please.

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: fb30sc-log-for-build-31702.zip [ 12683 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Version: 3.0 Beta 1 [ 10332 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

Component: Engine [ 10000 ]

summary: 3.0 SC: crash when running fbt_run with ES => 3.0 SC crashes at disconnect after running EXECUTE STATEMENT as non-current user

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Cannot be tested

Test Details: Issue related to fbt_run itself. No error occured when run test script ISQL.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

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

No branches or pull requests

2 participants