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

Crash on rel_reduce_groupby_exps (sqlsmith) #6242

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

Crash on rel_reduce_groupby_exps (sqlsmith) #6242

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-03-07 11:55:07 +0100
From: @mlkersten
To: SQL devs <>
Version: 11.25.5 (Dec2016-SP1)
CC: @njnes

Last updated: 2017-03-31 13:28:21 +0200

Comment 25140

Date: 2017-03-07 11:55:07 +0100
From: @mlkersten

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

UsingTPCH SF1 uncovered a segvault on Dec

It looks like an error caused by using deadbeef;
(gdb) print tbls[j]
$3 = (sql_table *) 0xbdbdbdbd0079656b

Thread 3212 "mserver5" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd45d4700 (LWP 7438)]
0x00007fffeecc3b18 in rel_reduce_groupby_exps (changes=0x7fffd45d3774, sql=0x7fffac130610, rel=0x7fffac8b7510)
at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4787
4787 if (tbls[j]->pkey) {
0 0x00007fffeecc3b18 in rel_reduce_groupby_exps (changes=0x7fffd45d3774, sql=0x7fffac130610, rel=0x7fffac8b7510)
at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4787
1 0x00007fffeecd35fa in rewrite (sql=0x7fffac130610, rel=0x7fffac8b7510, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8600
2 0x00007fffeecd362c in rewrite (sql=0x7fffac130610, rel=0x7fffac8b7510, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8603
3 0x00007fffeecd362c in rewrite (sql=0x7fffac130610, rel=0x7fffac8b7510, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8603
4 0x00007fffeecd34d1 in rewrite (sql=0x7fffac130610, rel=0x7fffac8c0650, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8578
5 0x00007fffeecd3524 in rewrite (sql=0x7fffac130610, rel=0x7fffac8c0b50, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8586
6 0x00007fffeecd3524 in rewrite (sql=0x7fffac130610, rel=0x7fffac8c0fa0, rewriter=0x7fffeecc36ad <rel_reduce_groupby_exps>,
has_changes=0x7fffd45d38f8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8586
7 0x00007fffeecd3ebb in _rel_optimizer (sql=0x7fffac130610, rel=0x7fffac8c0fa0, level=0)
at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8777
8 0x00007fffeecd4236 in rel_optimizer (sql=0x7fffac130610, rel=0x7fffac8c0fa0)
at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8836
9 0x00007fffeebbba74 in sql_symbol2relation (c=0x7fffac130610, sym=0x7fffac5f20a0)
at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121
10 0x00007fffeebe107b in SQLparser (c=0x7ffff098a328)

Reproducible: Always

Steps to Reproduce:

select
subq_0.c7 as c0,
ref_5.role_id as c1
from
sys.partsupp as ref_1
right join sys.user_role as ref_5
right join sys.netcdf_attrs as ref_6
on (ref_5.login_id = ref_6.file_id )
on (ref_1.ps_availqty = ref_6.file_id ),
lateral (select distinct
(select clk from sys.tracelog)
as c0,
ref_1.ps_availqty as c1,
ref_17.n_name as c2,
ref_17.n_comment as c3,
ref_17.n_nationkey as c4,
ref_5.role_id as c5,
ref_6.att_name as c6,
(select pg from bam.rg)
as c7,
ref_16.type as c8,
(select db_alias from sys.connections)
as c9
from
tmp.idxs as ref_15
left join sys.geometry_columns as ref_16
on (ref_15.name = ref_16.f_table_schema )
inner join sys.nation as ref_17
on (ref_16.srid = ref_17.n_nationkey )
right join sys.idxs as ref_18
on (ref_15.table_id = ref_18.id )
where 98 is NULL) as subq_0
where (select id from tmp.keys)
is not NULL
limit 104;

Comment 25150

Date: 2017-03-15 14:53:14 +0100
From: @njnes

fixed a problem in the optimizer

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