Issue Details (XML | Word | Printable)

Key: CORE-5936
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Saulius Vabalas
Votes: 0
Watchers: 2

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

Firebird server segfaults in the end of database backup

Created: 05/Oct/18 11:20 AM   Updated: 29/Apr/19 08:32 AM
Component/s: Engine
Affects Version/s: 2.5.7, 2.5.8
Fix Version/s: 2.5.9, 3.0.5

Environment: Found on Linux, classic server.

QA Status: Done successfully
Test Details:
" the end of database backup" -- where is BACKUP in this ticket ? May be title has to be changed in order to properly reflect reason of crash ?

 Description  « Hide
Once per 3-5 days fb_inet_server process dies in the end of gbak's backup. Core files analysis shows that all of them contain the following frames:

#0 TRA_state (bit_vector=0x7f325d78800c '\377' <repeats 200 times>..., oldest=<optimized out>, number=795364748) at ../src/jrd/tra.cpp:1793
#1 0x00007f3269dc9973 in extend_cache (number=795364748, tdbb=0x7fffac5830f0) at ../src/jrd/tpc.cpp:561
#2 TPC_snapshot_state (tdbb=0x7fffac5830f0, number=795364748) at ../src/jrd/tpc.cpp:362
#3 0x00007f3269dcbc20 in TRA_snapshot_state (tdbb=0x7fffac5830f0, trans=0x7f3265cee090, number=795364748) at ../src/jrd/tra.cpp:1641

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 05/Oct/18 11:33 AM
Steps to reproduce is very similar to CORE-5935, but a bit differs.

Run Firebird 2.5 in Classic or SuperClassic mode and open two terminals.

1) in terminal 1
create database 'core-5936.fdb' page_size 8192;
create table a (id int);
create index idx_a on a computed by (id);

set term ^;

create procedure p_gen_tx(n int)
declare i int = 0;
  while (i < n) do
    in autonomous transaction do
      i = i + 1;

set term ;^

gfix -write async core-5936.fdb

2) in terminal 1:
isql core-5936.fdb -n
select current_transaction, rdb$get_context('SYSTEM', 'ISOLATION_LEVEL') from rdb$database;

3) in terminal 2:
isql core-5936.fdb -n
execute procedure p_gen_tx (33000);

insert into a values (current_transaction);
set statistics index idx_a;

select * from a where id > 0;

execute procedure p_gen_tx (33000);

4) in terminal 1:
select * from a where id > 0;

here we get
Statement failed, SQLSTATE = 08006
Error reading data from the connection.

Vlad Khorsun added a comment - 08/Oct/18 11:14 AM
Fix is frontported into v3