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

find_fk: Assertion `t && i' failed. #3690

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

find_fk: Assertion `t && i' failed. #3690

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-03-26 12:57:47 +0100
From: @swingbit
To: SQL devs <>
Version: 11.19.9 (Oct2014-SP2)
CC: @njnes

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

Comment 20741

Date: 2015-03-26 12:57:47 +0100
From: @swingbit

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

This assertions happens in the reorder_joins optimizer, see gdb trace below.

The query it fails with is a rather large one, with many subqueries.
I attach a reproducible test that fails.

0 0x0000003633c348d7 in raise () from /lib64/libc.so.6
1 0x0000003633c3653a in abort () from /lib64/libc.so.6
2 0x0000003633c2d47d in __assert_fail_base () from /lib64/libc.so.6
3 0x0000003633c2d532 in __assert_fail () from /lib64/libc.so.6
4 0x00007f05666602ed in find_fk (sql=0x7f05580d18d0, rels=0x7f0558363920, exps=0x7f055835c5b0) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:722
5 0x00007f05666605a9 in order_joins (sql=0x7f05580d18d0, rels=0x7f0558363920, exps=0x7f055835c5b0) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:762
6 0x00007f0566661147 in reorder_join (sql=0x7f05580d18d0, rel=0x7f055835c730) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:991
7 0x00007f056666136d in rel_join_order (changes=0x7f05654c7604, sql=0x7f05580d18d0, rel=0x7f055835c730) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:1043
8 0x00007f056667b2dd in rewrite (sql=0x7f05580d18d0, rel=0x7f055835c730, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7014
9 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582a5a50, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
10 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582a8e70, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
11 0x00007f056667b203 in rewrite (sql=0x7f05580d18d0, rel=0x7f055834e060, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:6994
12 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582ac400, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
13 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582b28d0, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
14 0x00007f056667b203 in rewrite (sql=0x7f05580d18d0, rel=0x7f055835cf00, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:6994
15 0x00007f056667b1dc in rewrite (sql=0x7f05580d18d0, rel=0x7f055835e100, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:6993
16 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582b8a30, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
17 0x00007f056667b1dc in rewrite (sql=0x7f05580d18d0, rel=0x7f0558353d70, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:6993
18 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582f8950, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
19 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582f8a80, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
20 0x00007f056667b22f in rewrite (sql=0x7f05580d18d0, rel=0x7f05582f8c00, rewriter=0x7f05666612cc <rel_join_order>, has_changes=0x7f05654c7948) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7001
21 0x00007f056667baa5 in _rel_optimizer (sql=0x7f05580d18d0, rel=0x7f05582f8c00, level=1) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7185
22 0x00007f056667bd12 in _rel_optimizer (sql=0x7f05580d18d0, rel=0x7f05582f8c00, level=1) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7228
23 0x00007f056667bd65 in rel_optimizer (sql=0x7f05580d18d0, rel=0x7f05582f8c00) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/server/rel_optimizer.c:7237
24 0x00007f05665739cb in sql_symbol2relation (c=0x7f05580d18d0, sym=0x7f0558234840) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/backends/monet5/sql.c:129
25 0x00007f056659deee in SQLparser (c=0x6dc480) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/sql/backends/monet5/sql_scenario.c:2488
26 0x00007f056e7e55cd in runPhase (c=0x6dc480, phase=1) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/mal/mal_scenario.c:526
27 0x00007f056e7e5768 in runScenarioBody (c=0x6dc480) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/mal/mal_scenario.c:561
28 0x00007f056e7e590b in runScenario (c=0x6dc480) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/mal/mal_scenario.c:590
29 0x00007f056e7e7242 in MSserveClient (dummy=0x6dc480) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/mal/mal_session.c:450
30 0x00007f056e7e6c3e in MSscheduleClient (command=0x7f05580eca10 "", challenge=0x7f05654c7df0 "6RGoNPfpd", fin=0x7f0558100790, fout=0x7f0558105820) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/mal/mal_session.c:330
31 0x00007f056e8d5596 in doChallenge (data=0x7f05600008d0) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/monetdb5/modules/mal/mal_mapi.c:192
32 0x00007f056e27a976 in thread_starter (arg=0x7f0560000a50) at /opt/spinque/MonetDBServer/MonetDB.Spinque_Oct2014/src/gdk/gdk_system.c:535
33 0x000000363400752a in start_thread () from /lib64/libpthread.so.0
34 0x0000003633d0022d in clone () from /lib64/libc.so.6

Reproducible: Always

Steps to Reproduce:

  1. run the attached SQL script

Actual Results:

find_fk: Assertion `t && i' failed.

$ mserver5 --version
MonetDB 5 server v11.19.10 (64-bit, 64-bit oids)
This is an unreleased version
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
Found 15.6GiB available memory, 8 available cpu cores
Libraries:
libpcre: 8.35 2014-04-04 (compiled with 8.35)
openssl: OpenSSL 1.0.1k 8 Jan 2015 (compiled with OpenSSL 1.0.1k-fips 8 Jan 2015)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: roberto@photon.spinque.com (x86_64-unknown-linux-gnu)
Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wunreachable-code
Linking : /usr/bin/ld -m elf_x86_64

Comment 20742

Date: 2015-03-26 12:59:12 +0100
From: @swingbit

Created attachment 326
SQL script to reproduce the bug

Attached file: BUG-3690.sql (application/sql, 9055 bytes)
Description: SQL script to reproduce the bug

Comment 20772

Date: 2015-04-10 11:04:47 +0200
From: @njnes

Fixed added to stable. Added protection agains missing OID columns.

Comment 20773

Date: 2015-04-10 11:42:07 +0200
From: MonetDB Mercurial Repository <>

Changeset 2e15db9d79b4 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=2e15db9d79b4

Changeset description:

fixes for Bug #3690, ie protect against missing OID columns
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