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

Query sequence with 2x ifthenelse() and next nullif() causes mserver5 Segmentation fault #6436

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: 2017-10-19 12:17:09 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.27.5 (Jul2017-SP1)
CC: @mlkersten, @njnes

Last updated: 2017-12-14 14:46:00 +0100

Comment 25763

Date: 2017-10-19 12:17:09 +0200
From: Martin van Dinther <<martin.van.dinther>>

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

Next query sequence:
SELECT ifthenelse(true, 22347, 34456) as a;
SELECT ifthenelse(false, 22347, 34456) as a;
SELECT nullif(1, 2) as a;
SELECT nullif(11234, 2345) as a;
SELECT nullif(null, 2345) as a;
SELECT nullif(1234, null) as a;

causes mserver5 process to crash, ususally already after query: SELECT nullif(1, 2) as a;

Reproducible: Always

Steps to Reproduce:

  1. Start mserver5 (MonetDB 5 server v11.27.8)
  2. Start mclient
  3. Execute queries:
    SELECT ifthenelse(true, 22347, 34456) as a;
    SELECT ifthenelse(false, 22347, 34456) as a;
    SELECT nullif(1, 2) as a;
    SELECT nullif(11234, 2345) as a;
    SELECT nullif(null, 2345) as a;
    SELECT nullif(1234, null) as a;

Actual Results:

bash-4.4$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.27.8 (unreleased), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>SELECT ifthenelse(true, 22347, 34456) as a;
TypeException:user.s4_1[6]:'calc.ifthenelse' undefined in: X_7:void := calc.ifthenelse(X_4:bit, X_5:sht, X_6:int);
sql>SELECT ifthenelse(false, 22347, 34456) as a;
TypeException:user.s6_1[6]:'calc.ifthenelse' undefined in: X_7:void := calc.ifthenelse(X_4:bit, X_5:sht, X_6:int);
sql>SELECT nullif(1, 2) as a;
sql>
bash-4.4$

bash-4.4$ ./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 embedded_py = true
cmdline opt gdk_debug = 10
MonetDB 5 server v11.27.8
This is an unreleased version
Serving database 'demo', using 4 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
Found 31.312 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
Visit https://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
MonetDB/Python2 module loaded
MonetDB/R module loaded

./start_INSTALL_mserver5.sh: line 7: 21137 Segmentation fault (core dumped) /export/scratch1/dinther/INSTALL/bin/mserver5 -d10 --set embedded_r=true --set embedded_py=true --set mapi_port=50000
bash-4.4$

Expected Results:

No crash of mserver5 process

Also happens on Windows (tested with Jul2107-SP2)

Comment 25768

Date: 2017-10-19 20:04:03 +0200
From: MonetDB Mercurial Repository <>

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

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fc1d11e132eb

Changeset description:

partial fix of bug #6436 (ie do not overwrite the argument list of a function description)
fix bug #6437, ie do not drop systems schemas (later we should remove the system flag from the bam schema)

Comment 25796

Date: 2017-10-25 07:07:58 +0200
From: MonetDB Mercurial Repository <>

Changeset b11852dcfd52 made by martin.kersten@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b11852dcfd52

Changeset description:

Pass errors onwards
Partially addresses Bug #6436

Comment 25797

Date: 2017-10-25 07:08:48 +0200
From: @mlkersten

On default branch the nullif() seem to work.

However, the ifthenelse() statements return nothing and the EXPLAIN is empty.
The missing MAL primitive was not properly reported.

Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.28.0 (unreleased), 'mapi:monetdb://rocks074.scilens.private:50000/demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
sql>explain SELECT ifthenelse(true, 22347, 34456) as a;
sql>

Comment 25935

Date: 2017-12-03 16:24:16 +0100
From: MonetDB Mercurial Repository <>

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

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fa09cb21a5c8

Changeset description:

improved function resolution, fixing Bugs 6436 and 6471

Comment 25938

Date: 2017-12-03 16:25:15 +0100
From: @njnes

fixed by improved function resolution and type checking

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