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

savepoints crash mserver5 #7021

Closed
yzchang opened this issue Dec 9, 2020 · 4 comments
Closed

savepoints crash mserver5 #7021

yzchang opened this issue Dec 9, 2020 · 4 comments
Labels
bug major SQL
Milestone

Comments

@yzchang
Copy link
Member

@yzchang yzchang commented Dec 9, 2020

Describe the bug
Running two transactions with a release savepoint in each of them crashes mserver5 at:

0x00007ffff62d6ff5 in idx_destroy (i=0xdbdbdbdbdbdbdbdb)
    at /home/vagrant/shared/monetdb/mdb-src/Oct2020/sql/storage/store.c:185
185		if (--(i->base.refcnt) > 0)

To Reproduce
Run the following queries to get the crash:

start transaction;
create table savepointtest (id int, primary key(id));
savepoint name1;
insert into savepointtest values(1), (2), (3);
savepoint name2;
insert into savepointtest values(4), (5), (6);
insert into savepointtest values(7), (8), (9);
savepoint name3;
release savepoint name3;
select * from savepointtest;
commit;

start transaction;
create table savepointtest (id int, primary key(id));
savepoint name1;
insert into savepointtest values(1), (2), (3);
savepoint name2;
insert into savepointtest values(4), (5), (6);
insert into savepointtest values(7), (8), (9);
savepoint name3;
release savepoint name1;
select * from savepointtest;
commit;

Note that, if we release savepoint "name2" instead of "name3" in the first transaction, mserver5 doesn't crash.

Expected behavior
No crash. The second transaction should abort since the table savepointtest already exists.

Software versions

  • MonetDB version number [v11.39.8 (hg id: 0a97056b6c89), also happens with Oct2020-SP1 but the behavior is different]
  • OS and version: [e.g. Ubuntu 20.04.1]
  • Mercurial source code
@yzchang yzchang added bug SQL major labels Dec 9, 2020
@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 9, 2020

gdb.txt
Full stack-trace of the crashed thread

@yzchang yzchang changed the title multiple transactions with "release savepoint" crashes mserver5 savepoints crash mserver5 Dec 9, 2020
@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 9, 2020

The crash can be triggered with much simpler queries and it's related to the use of setting savepoint not release savepoint.

The following queries trigger the aforementioned SIGSEGV in store.c:185:

start transaction;
create table savepointtest (id int, primary key(id));
savepoint name1;
insert into savepointtest values(1), (2), (3);
savepoint name2;
insert into savepointtest values(4), (5), (6);
insert into savepointtest values(7), (8), (9);
--savepoint name3;
select * from savepointtest;
commit;

The following queries trigger the assertion mserver5: /home/vagrant/shared/monetdb/mdb-src/Oct2020/sql/storage/store.c:3940: trans_init: Assertion istmp || !c->base.allocated' failed.(note the change in the use of savepointname3instead ofname2`):

start transaction;
create table savepointtest (id int, primary key(id));
savepoint name1;
insert into savepointtest values(1), (2), (3);
--savepoint name2;
insert into savepointtest values(4), (5), (6);
insert into savepointtest values(7), (8), (9);
savepoint name3;
select * from savepointtest;
commit;

@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 9, 2020

Tests added: sql/test/BugTracker-2020/Tests/savepoints_crash_mserver5_{1,2}.Bug-7021.sql

@yzchang yzchang closed this as completed Dec 10, 2020
@yzchang
Copy link
Member Author

@yzchang yzchang commented Dec 10, 2020

Both the SIGSEGV and the assertion have been fixed by changeset 65bc955a71cd

@njnes njnes added this to the NEXTRELEASE milestone Dec 17, 2020
@sjoerdmullender sjoerdmullender removed this from the NEXTRELEASE milestone Jan 25, 2021
@sjoerdmullender sjoerdmullender added this to the NEXTFEATURERELEASE milestone Jan 25, 2021
@sjoerdmullender sjoerdmullender removed this from the NEXTFEATURERELEASE milestone Jan 26, 2021
@sjoerdmullender sjoerdmullender added this to the Oct2020-SP2 milestone Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug major SQL
Projects
None yet
Development

No branches or pull requests

3 participants