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

Suspicious code in store_manager() on exit path #3975

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Suspicious code in store_manager() on exit path #3975

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-04-05 15:00:32 +0200
From: Richard Hughes <<richard.monetdb>>
To: SQL devs <>
Version: 11.21.17 (Jul2015-SP3)
CC: @njnes

Last updated: 2016-06-23 10:24:21 +0200

Comment 22012

Date: 2016-04-05 15:00:32 +0200
From: Richard Hughes <<richard.monetdb>>

I spotted this when reading through the code, so I don't have a reproduction recipe or a clear idea of how to provoke it. Can I ask somebody to take a look and confirm my suspicions:

sql/storage/store.c:1639 (in current Jul2015):

while (store_nr_active) { /* find a moment to flush */
MT_lock_unset(&bs_lock, "store_manager");
MT_sleep_ms(50);
if (GDKexiting())
continue;
MT_lock_set(&bs_lock, "store_manager");
}

If GDKexiting() then it looks to me like you will double-unlock bs_lock, either at line 1640 (if store_nr_active!=0 still) or line 1652 (otherwise). Either way you'll go into undefined behaviour.

Comment 22013

Date: 2016-04-05 15:31:03 +0200
From: @sjoerdmullender

I think you're right. I think that continue should be a return. And I'm also not happy about the other continue.
I'll fix it.

Comment 22014

Date: 2016-04-05 15:33:26 +0200
From: MonetDB Mercurial Repository <>

Changeset e7474ae2fc10 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=e7474ae2fc10

Changeset description:

When exiting, exit.

This fixes bug #3975.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant