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

Assertion failure in gdk_bat.c: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed. #3706

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

Comments

@monetdb-team
Copy link

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

Date: 2015-04-16 16:08:24 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.19.9 (Oct2014-SP2)
CC: @njnes

Last updated: 2015-05-07 12:37:20 +0200

Comment 20803

Date: 2015-04-16 16:08:24 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0
Build Identifier:

SQL Query:
SELECT (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) FROM t1 WHERE (a>b-2 AND a<b+2) OR c>d ORDER BY 1;
causes assertion failure

mserver5: ../../MonetDB-11.19.9/gdk/gdk_bat.c:2881: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed.

Also happens on MonetDB 5 server v11.20.0:

mserver5: ../../dev/gdk/gdk_bat.c:2847: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed.

Reproducible: Always

Steps to Reproduce:

  1. Start mserver5 (MonetDB 5 server v11.19.9 "Oct2014-SP2")
  2. Start mclient
  3. execute SQL commands:
    CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
    INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
    INSERT INTO t1(a,c,d,e,b) VALUES(107,106,108,109,105);
    INSERT INTO t1(e,d,b,a,c) VALUES(110,114,112,111,113);
    INSERT INTO t1(d,c,e,a,b) VALUES(116,119,117,115,118);
    SELECT (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) FROM t1 WHERE (a>b-2 AND a<b+2) OR c>d ORDER BY 1;

Actual Results:

builtin opt gdk_dbpath = /export/scratch1/dinther/Downloads/INSTALL/var/monetdb5/dbfarm/demo
builtin opt gdk_debug = 0
builtin opt gdk_vmtrim = no
builtin opt monet_prompt = >
builtin opt monet_daemon = no
builtin opt mapi_port = 50000
builtin opt mapi_open = false
builtin opt mapi_autosense = false
builtin opt sql_optimizer = default_pipe
builtin opt sql_debug = 0
cmdline opt gdk_debug = 10
MonetDB 5 server v11.19.9 "Oct2014-SP2"
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
Found 15.590 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
MonetDB/GIS module loaded
MonetDB/SQL module loaded

mserver5: ../../MonetDB-11.19.9/gdk/gdk_bat.c:2881: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed.

bash-4.2$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.19.9 (Oct2014-SP2), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>CREATE TABLE t1(a INTEGER, b INTEGER, c INTEGER, d INTEGER, e INTEGER);
operation successful (6.762ms)
sql>INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
1 affected row (0.581ms)
sql>INSERT INTO t1(a,c,d,e,b) VALUES(107,106,108,109,105);
1 affected row (0.460ms)
sql>INSERT INTO t1(e,d,b,a,c) VALUES(110,114,112,111,113);
1 affected row (0.499ms)
sql>INSERT INTO t1(d,c,e,a,b) VALUES(116,119,117,115,118);
1 affected row (0.493ms)
sql>SELECT (SELECT count(*) FROM t1 AS x WHERE x.b<t1.b) FROM t1 WHERE (a>b-2 AND a<b+2) OR c>d ORDER BY 1;
sql>
bash-4.2$

Expected Results:

no assertion failure

Comment 20821

Date: 2015-04-19 22:09:30 +0200
From: MonetDB Mercurial Repository <>

Changeset b3a1a04bea24 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

added test for bug #3706

Comment 20822

Date: 2015-04-19 22:10:02 +0200
From: @njnes

fixed after recent changes (probably same fix as 3705)

Comment 20837

Date: 2015-04-23 16:34:39 +0200
From: Martin van Dinther <<martin.van.dinther>>

Unfortunately it is NOT fixed yet. It still happens.
I re-tested with MonetDB 5 server v11.19.11 "Oct2014-SP3" built of 23 april

builtin opt gdk_dbpath = /export/scratch1/dinther/Downloads/INSTALL/var/monetdb5/dbfarm/demo
builtin opt gdk_debug = 0
builtin opt gdk_vmtrim = no
builtin opt monet_prompt = >
builtin opt monet_daemon = no
builtin opt mapi_port = 50000
builtin opt mapi_open = false
builtin opt mapi_autosense = false
builtin opt sql_optimizer = default_pipe
builtin opt sql_debug = 0
cmdline opt gdk_debug = 10
MonetDB 5 server v11.19.11 "Oct2014-SP3"
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
Found 15.590 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
MonetDB/GIS module loaded
MonetDB/SQL module loaded

SQL catalog created, loading sql scripts once
loading sql script: 09_like.sql
loading sql script: 10_math.sql
loading sql script: 11_times.sql
loading sql script: 12_url.sql
loading sql script: 13_date.sql
loading sql script: 14_inet.sql
loading sql script: 15_querylog.sql
loading sql script: 16_tracelog.sql
loading sql script: 19_cluster.sql
loading sql script: 20_vacuum.sql
loading sql script: 21_dependency_functions.sql
loading sql script: 22_clients.sql
loading sql script: 23_skyserver.sql
loading sql script: 24_zorder.sql
loading sql script: 25_debug.sql
loading sql script: 26_sysmon.sql
loading sql script: 39_analytics.sql
loading sql script: 40_geom.sql
loading sql script: 40_json.sql
loading sql script: 41_jsonstore.sql
loading sql script: 45_uuid.sql
loading sql script: 46_gsl.sql
loading sql script: 75_storagemodel.sql
loading sql script: 80_statistics.sql
loading sql script: 80_udf.sql
loading sql script: 85_bam.sql
loading sql script: 90_generator.sql
loading sql script: 99_system.sql
mserver5: ../../MonetDB-11.19.11/gdk/gdk_bat.c:2839: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed.
bash-4.2$

Idem for: MonetDB 5 server v11.20.0:
mserver5: ../../dev/gdk/gdk_bat.c:2863: BATassertHeadProps: Assertion `!b->H->sorted || cmp <= 0' failed.

Comment 20841

Date: 2015-04-24 11:26:29 +0200
From: @njnes

Runs fine according to the current stable branch nightly test output
http://monetdb.cwi.nl/testweb/web/showtestoutput.php?serial=55351:bc4923c9aad2&target=Int-Fedora-x86_64-assert&module=sql&test=sql%2Ftest%2FBugTracker-2015&which=out

Comment 20846

Date: 2015-04-28 14:07:18 +0200
From: MonetDB Mercurial Repository <>

Changeset 59b3760cadc0 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=59b3760cadc0

Changeset description:

Don't copy properties if there are nils (probably due to candidate list).
This fixes bug #3706.

Comment 20847

Date: 2015-04-28 14:07:58 +0200
From: @sjoerdmullender

It turned out that there really still was a bug. This should now be fixed.

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