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

Executing a query on a non-existing column on a remote table crashes the remote server #6750

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working minor SQL

Comments

@monetdb-team
Copy link

Date: 2019-08-19 17:03:50 +0200
From: @PedroTadim
To: SQL devs <>
Version: 11.33.3 (Apr2019)

Last updated: 2020-06-03 16:58:53 +0200

Comment 27237

Date: 2019-08-19 17:03:50 +0200
From: @PedroTadim

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Build Identifier:

Do the reproducible steps.

Reproducible: Always

Steps to Reproduce:

  1. create table tab1 (col1 clob);
  2. create remote table tab1 (col1 clob, col2 int) on 'mapi:monetdb://'; --on another server
  3. select col2 from tab1; --this crashes the remote server.

Actual Results:

SIGSEV on exps_mark_used

Expected Results:

An error should be thrown saying the column doesn't exist.

Thread 24 "mserver5" received signal SIGSEGV, Segmentation fault.

exps_mark_used (sa=0x7fffc4001800, rel=0x7fffc40f4230, subrel=0x7fffc40f3f00) at ../../../src/sql/server/rel_optimizer.c:6079
6079 exps[0]->used = 1;
Missing separate debuginfos, use: dnf debuginfo-install libpq-11.5-1.fc30.x86_64
(gdb) bt
0 exps_mark_used (sa=0x7fffc4001800, rel=0x7fffc40f4230, subrel=0x7fffc40f3f00) at ../../../src/sql/server/rel_optimizer.c:6079
1 0x00007fffe87b382d in rel_mark_used (sql=0x7fffc40111f0, rel=0x7fffc40f4230, proj=1) at ../../../src/sql/server/rel_optimizer.c:6187
2 0x00007fffe87b49f5 in rel_dce_sub (sql=0x7fffc40111f0, rel=0x7fffc40f4230) at ../../../src/sql/server/rel_optimizer.c:6677
3 0x00007fffe87b4e06 in rel_dce (sql=0x7fffc40111f0, rel=0x7fffc40f4230) at ../../../src/sql/server/rel_optimizer.c:6771
4 0x00007fffe87c1b57 in optimize_rel (sql=0x7fffc40111f0, rel=0x7fffc40f4230, g_changes=0x7fffd4893120, level=0, value_based_opt=0) at ../../../src/sql/server/rel_optimizer.c:9703
5 0x00007fffe87c1e01 in optimize (sql=0x7fffc40111f0, rel=0x7fffc40f4230, value_based_opt=0) at ../../../src/sql/server/rel_optimizer.c:9779
6 0x00007fffe87c1f10 in rel_optimizer (sql=0x7fffc40111f0, rel=0x7fffc40f4230, value_based_opt=0) at ../../../src/sql/server/rel_optimizer.c:9795
7 0x00007fffe869b018 in RAstatement2 (cntxt=0x7fffe91086e0, mb=0x7fffc4005d30, stk=0x7fffc400a850, pci=0x7fffc40ee710) at ../../../../src/sql/backends/monet5/sql_execute.c:1004
8 0x00007ffff7dc30e8 in runMALsequence (cntxt=0x7fffe91086e0, mb=0x7fffc4005d30, startpc=1, stoppc=0, stk=0x7fffc400a850, env=0x7fffc400a850, pcicaller=0x0) at ../../../src/monetdb5/mal/mal_interpreter.c:647
9 0x00007ffff7dc1774 in runMAL (cntxt=0x7fffe91086e0, mb=0x7fffc4005d30, mbcaller=0x0, env=0x7fffc400a850) at ../../../src/monetdb5/mal/mal_interpreter.c:336
10 0x00007ffff7df2d1c in MALengine (c=0x7fffe91086e0) at ../../../src/monetdb5/mal/mal_session.c:752
11 0x00007ffff7def9db in runPhase (c=0x7fffe91086e0, phase=4) at ../../../src/monetdb5/mal/mal_scenario.c:517
12 0x00007ffff7defb77 in runScenarioBody (c=0x7fffe91086e0, once=0) at ../../../src/monetdb5/mal/mal_scenario.c:547
13 0x00007ffff7defda8 in runScenario (c=0x7fffe91086e0, once=0) at ../../../src/monetdb5/mal/mal_scenario.c:580
14 0x00007ffff7df1ba9 in MSserveClient (c=0x7fffe91086e0) at ../../../src/monetdb5/mal/mal_session.c:525
15 0x00007ffff7df1671 in MSscheduleClient (command=0x7fffc4003610 '\275' <repeats 200 times>..., challenge=0x7fffd4895cbb "e8JertRm", fin=0x7fffc4007580, fout=0x7fffd0007180, protocol=PROTOCOL_9, blocksize=8190) at ../../../src/monetdb5/mal/mal_session.c:403
16 0x00007ffff7e9f511 in doChallenge (data=0x7fffd0004f10) at ../../../../src/monetdb5/modules/mal/mal_mapi.c:271
17 0x00007ffff7b33cc8 in THRstarter (a=0x7fffd0009270) at ../../src/gdk/gdk_utils.c:1415
18 0x00007ffff7badda2 in thread_starter (arg=0x7fffbc0039e0) at ../../src/gdk/gdk_system.c:650
19 0x00007ffff6d685a2 in start_thread (arg=) at pthread_create.c:486
20 0x00007ffff6c95303 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment 27238

Date: 2019-08-19 17:10:59 +0200
From: MonetDB Mercurial Repository <>

Changeset 1d9ee75506c2 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Added test for bug #6750.

Comment 27253

Date: 2019-08-23 11:04:49 +0200
From: MonetDB Mercurial Repository <>

Changeset 83441f76c441 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Updated bug #6750 test with another issue: remote tables referencing merge tables in a loop

Comment 27579

Date: 2020-02-24 15:55:25 +0100
From: MonetDB Mercurial Repository <>

Changeset 39e8f7c93323 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Progress for bug #6750 resolution, ie whenever an error is found at rel_read, set it and throw it

Comment 27580

Date: 2020-02-25 10:55:06 +0100
From: MonetDB Mercurial Repository <>

Changeset b0dc972ef4c0 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

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

Changeset description:

Final fix for bug #6750, ie send an extra string with the expected output types for the sending relation and verify it at the other side
@monetdb-team monetdb-team added bug Something isn't working minor SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor SQL
Projects
None yet
Development

No branches or pull requests

2 participants