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

select data from "sys"."rejects" returns unexpected error and when next select data from "sys"."sessions" causes an assertion failure in mal_interpreter.c:646. #3759

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-07-09 15:37:05 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: -- development
CC: @njnes

Last updated: 2015-08-28 13:41:25 +0200

Comment 20981

Date: 2015-07-09 15:37:05 +0200
From: Martin van Dinther <<martin.van.dinther>>

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

mserver5: ../../../dev/monetdb5/mal/mal_interpreter.c:646: runMALsequence: Assertion `bid == 0 || bid == ((bat) int_nil) || t == 255 || ((BBP[abs(bid)>>14][abs(bid)&((1 << 14)-1)].cache[(bid)<0]->T->type == 0)?6:BBP[abs(bid)>>14][abs(bid)&((1 << 14)-1)].cache[(bid)<0]->T->type) == ((t == 0)?6:t)' failed.

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 (MonetDB 5 server v11.22.0)
  2. start mclient
  3. issue SQL queries:
    select COUNT() from "sys"."queue";
    select COUNT(
    ) from "sys"."rejects";
    select COUNT(*) from "sys"."sessions";

Actual Results:

bash-4.2$ ./start_INSTALL_mserver5.sh
builtin opt gdk_dbpath = /export/scratch1/dinther/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 embedded_r = true
cmdline opt mapi_port = 41000
cmdline opt gdk_debug = 10
MonetDB 5 server v11.22.0
This is an unreleased version
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs and 128bit integers 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:41000/
MonetDB/GIS module loaded
Start processing logs sql/sql_logs version 52200
Finished processing logs sql/sql_logs
MonetDB/SQL module loaded
MonetDB/R 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: 17_temporal.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: 27_rejects.sql
loading sql script: 39_analytics.sql
loading sql script: 39_analytics_hge.sql
loading sql script: 40_geom.sql
loading sql script: 40_json.sql
loading sql script: 40_json_hge.sql
loading sql script: 41_md5sum.sql
loading sql script: 45_uuid.sql
loading sql script: 46_gsl.sql
loading sql script: 51_sys_schema_extension.sql
loading sql script: 72_fits.sql
loading sql script: 74_netcdf.sql
loading sql script: 75_storagemodel.sql
loading sql script: 80_statistics.sql
loading sql script: 80_udf.sql
loading sql script: 80_udf_hge.sql
loading sql script: 85_bam.sql
loading sql script: 90_generator.sql
loading sql script: 90_generator_hge.sql
loading sql script: 99_system.sql
mserver5: ../../../dev/monetdb5/mal/mal_interpreter.c:646: runMALsequence: Assertion `bid == 0 || bid == ((bat) int_nil) || t == 255 || ((BBP[abs(bid)>>14][abs(bid)&((1 << 14)-1)].cache[(bid)<0]->T->type == 0)?6:BBP[abs(bid)>>14][abs(bid)&((1 << 14)-1)].cache[(bid)<0]->T->type) == ((t == 0)?6:t)' failed.
./start_INSTALL_mserver5.sh: line 5: 5740 Aborted /export/scratch1/dinther/INSTALL/bin/mserver5 -d10 --set embedded_r=true --set mapi_port=41000
bash-4.2$

bash-4.2$ mclient -p 41000
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.22.0 (unreleased), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>select COUNT() from "sys"."queue";
+------+
| L1 |
+======+
| 1 |
+------+
1 tuple (1.241ms)
sql>select COUNT(
) from "sys"."rejects";
No reject table available
sql>select COUNT(*) from "sys"."sessions";
sql>
bash-4.2$

Expected Results:

No error for query: select COUNT(*) from "sys"."rejects";
Also the error msg "No reject table available" is strange as we are querying the rejects table, and not the reject (without an s) table

No assertion failure after query: select COUNT(*) from "sys"."sessions";

Potentially the assertion failure is due to some internal data corruption after executing: select COUNT(*) from "sys"."rejects";

The problem does NOT exist in Oct2014 SP4, but probably does exist in Jul2015 branch also. Please fix it in Jul2015 branch also.

Comment 20982

Date: 2015-07-09 16:10:51 +0200
From: Martin van Dinther <<martin.van.dinther>>

additional info: I compiled sources with configure flags: --enable-assert --disable-debug

Comment 21075

Date: 2015-08-01 15:18:07 +0200
From: MonetDB Mercurial Repository <>

Changeset 30d12a4105a0 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=30d12a4105a0

Changeset description:

Bug fixes

Bug #3759 fixed types of returned bats (ie use timestamps instead of lng) in modules/mal/clients.c
Bug #3769 fixed crash (triggered assert) by properly looking for referenced groupby columns in push aggr down
optimizer in rel_optimizer.c
Bug #3760 fixed correlated subquery handling in rel_select.c, ie merge only distinct expressions.
Bug #3761 fixed by properly adding the zero_or_one aggregation only when needed (ie when the cardinality of
the outer query is a column/table, ie when we expect one value per row for the subquery).
Bug #3364 fixed in sql_privileges.c, ie allow set role when role_id == auth_id (ie default role).
Bug #3365 fixed in sql_privileges.c, the sql_grant_table_privs always added 'all' privileges in one go
	       in rel_schema.c properly pass the login_id or role_id based on the 'from current_{role/user}'
		part of the grant statement
Bug #3476 was already fixed by previous revoke / schema fixes.

in gdk/gdk_select.c fixed problem with anti select and nils (stop before first nil instead of last)

Comment 21080

Date: 2015-08-01 16:13:22 +0200
From: MonetDB Mercurial Repository <>

Changeset e431bcfc8a34 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=e431bcfc8a34

Changeset description:

added test for bug #3759

Comment 21081

Date: 2015-08-01 16:14:07 +0200
From: @njnes

Fixed aligned sql with mal/c level types

Comment 21177

Date: 2015-08-28 13:41:25 +0200
From: @sjoerdmullender

Jul2015 has been released.

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