Two new juicy assertions in the SQL front-end

Dean De Leo D.De.Leo at cwi.nl
Tue Nov 8 23:11:05 CET 2016


Dear MonetDB developers,

I'm reporting two other assertions I hit in the front-end. The first is 
related to scalar subqueries, see query3.sql for a repro and 
backtrace3.txt. I guess it could be rather considered a feature 
request... BTW I appreciate this style of treating unsupported features, 
I'm starting to use in my changes as well :)

The second occurs somewhere in the query rewriter when issuing the whole 
query, see query4.sql and backtrace4.txt.

On Linux, tip of the default branch, debug build, empty tables, schema 
attached.

Thanks,
Dean

-------------- next part --------------
A non-text attachment was scrubbed...
Name: query3.sql
Type: application/sql
Size: 520 bytes
Desc: not available
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20161108/f116d84e/attachment.sql>
-------------- next part --------------
* thread #5: tid = 21381, 0x00007f98c557904f libc.so.6`__GI_raise + 207, name = 'mserver5', stop reason = signal SIGABRT
    frame #0: 0x00007f98c557904f libc.so.6`__GI_raise + 207
libc.so.6`__GI_raise:
->  0x7f98c557904f <+207>: addq   $0x88, %rsp
    0x7f98c5579056 <+214>: movl   %r8d, %eax
    0x7f98c5579059 <+217>: popq   %rbx
    0x7f98c557905a <+218>: retq   
(lldb) bt
* thread #5: tid = 21381, 0x00007f98c557904f libc.so.6`__GI_raise + 207, name = 'mserver5', stop reason = signal SIGABRT
    frame #0: 0x00007f98c557904f libc.so.6`__GI_raise + 207
    frame #1: 0x00007f98c557a47a libc.so.6`__GI_abort + 362
    frame #2: 0x00007f98c5571ea7 libc.so.6`__assert_fail_base + 279
    frame #3: 0x00007f98c5571f52 libc.so.6`__GI___assert_fail + 66
  * frame #4: 0x00007f98c384578d lib_sql.so`rel2bin_semijoin(be=0x00007f98b40c1a90, rel=0x00007f98b40d6d90, refs=0x00007f98b40de4e0) + 770 at rel_bin.c:1905
    frame #5: 0x00007f98c3852065 lib_sql.so`subrel_bin(be=0x00007f98b40c1a90, rel=0x00007f98b40d6d90, refs=0x00007f98b40de4e0) + 379 at rel_bin.c:4724
    frame #6: 0x00007f98c384552c lib_sql.so`rel2bin_semijoin(be=0x00007f98b40c1a90, rel=0x00007f98b40d77e0, refs=0x00007f98b40de4e0) + 161 at rel_bin.c:1869
    frame #7: 0x00007f98c3852065 lib_sql.so`subrel_bin(be=0x00007f98b40c1a90, rel=0x00007f98b40d77e0, refs=0x00007f98b40de4e0) + 379 at rel_bin.c:4724
    frame #8: 0x00007f98c3847b6c lib_sql.so`rel2bin_project(be=0x00007f98b40c1a90, rel=0x00007f98b40da850, refs=0x00007f98b40de4e0, topn=0x0000000000000000) + 635 at rel_bin.c:2382
    frame #9: 0x00007f98c385211f lib_sql.so`subrel_bin(be=0x00007f98b40c1a90, rel=0x00007f98b40da850, refs=0x00007f98b40de4e0) + 565 at rel_bin.c:4740
    frame #10: 0x00007f98c3847b6c lib_sql.so`rel2bin_project(be=0x00007f98b40c1a90, rel=0x00007f98b40da950, refs=0x00007f98b40de4e0, topn=0x0000000000000000) + 635 at rel_bin.c:2382
    frame #11: 0x00007f98c385211f lib_sql.so`subrel_bin(be=0x00007f98b40c1a90, rel=0x00007f98b40da950, refs=0x00007f98b40de4e0) + 565 at rel_bin.c:4740
    frame #12: 0x00007f98c3852416 lib_sql.so`output_rel_bin(be=0x00007f98b40c1a90, rel=0x00007f98b40da950) + 102 at rel_bin.c:4805
    frame #13: 0x00007f98c3863390 lib_sql.so`sql_relation2stmt(be=0x00007f98b40c1a90, r=0x00007f98b40da950) + 125 at sql_gencode.c:467
    frame #14: 0x00007f98c3863489 lib_sql.so`backend_dumpstmt(be=0x00007f98b40c1a90, mb=0x00007f98b40c1e70, r=0x00007f98b40da950, top=1, add_end=1) + 219 at sql_gencode.c:488
    frame #15: 0x00007f98c3863ff2 lib_sql.so`backend_dumpproc(be=0x00007f98b40c1a90, c=0x00007f98c3e88328, cq=0x00007f98b411cee0, r=0x00007f98b40da950) + 1246 at sql_gencode.c:637
    frame #16: 0x00007f98c3830297 lib_sql.so`SQLparser(c=0x00007f98c3e88328) + 4602 at sql_scenario.c:1113
    frame #17: 0x00007f98c863ec65 libmonetdb5.so.21`runPhase(c=0x00007f98c3e88328, phase=1) + 122 at mal_scenario.c:517
    frame #18: 0x00007f98c863eda9 libmonetdb5.so.21`runScenarioBody(c=0x00007f98c3e88328) + 288 at mal_scenario.c:550
    frame #19: 0x00007f98c863ef4c libmonetdb5.so.21`runScenario(c=0x00007f98c3e88328) + 76 at mal_scenario.c:579
    frame #20: 0x00007f98c8640a92 libmonetdb5.so.21`MSserveClient(dummy=0x00007f98c3e88328) + 488 at mal_session.c:448
    frame #21: 0x00007f98c864053c libmonetdb5.so.21`MSscheduleClient(command="\xb0\xb9\v\xb4\x98\x7f", challenge="IXs33hCnElR", fin=0x00007f98b4002980, fout=0x00007f98b0002b60) + 3472 at mal_session.c:339
    frame #22: 0x00007f98c86dfe60 libmonetdb5.so.21`doChallenge(data=0x00007f98b00008d0) + 1209 at mal_mapi.c:197
    frame #23: 0x00007f98c8141d36 libbat.so.13`thread_starter(arg=0x00007f98b0004c50) + 68 at gdk_system.c:485
    frame #24: 0x00007f98c58ed454 libpthread.so.0`start_thread + 196
    frame #25: 0x00007f98c562e7df libc.so.6`__GI___clone + 95
(lldb) frame select 4
frame #4: 0x00007f98c384578d lib_sql.so`rel2bin_semijoin(be=0x00007f98b40c1a90, rel=0x00007f98b40d6d90, refs=0x00007f98b40de4e0) + 770 at rel_bin.c:1905
   1902					join = s;
   1903				} else if (s->type != st_join && s->type != st_join2 && s->type != st_joinN) {
   1904					/* handle select expressions */
-> 1905					assert(0);
   1906					return NULL;
   1907				}
   1908				if (s->type == st_join || s->type == st_join2 || s->type == st_joinN) { 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query4.sql
Type: application/sql
Size: 897 bytes
Desc: not available
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20161108/f116d84e/attachment-0001.sql>
-------------- next part --------------
* thread #13: tid = 21761, 0x00007fa0cea8104f libc.so.6`__GI_raise + 207, name = 'mserver5', stop reason = signal SIGABRT
    frame #0: 0x00007fa0cea8104f libc.so.6`__GI_raise + 207
libc.so.6`__GI_raise:
->  0x7fa0cea8104f <+207>: addq   $0x88, %rsp
    0x7fa0cea81056 <+214>: movl   %r8d, %eax
    0x7fa0cea81059 <+217>: popq   %rbx
    0x7fa0cea8105a <+218>: retq   
(lldb) bt
* thread #13: tid = 21761, 0x00007fa0cea8104f libc.so.6`__GI_raise + 207, name = 'mserver5', stop reason = signal SIGABRT
  * frame #0: 0x00007fa0cea8104f libc.so.6`__GI_raise + 207
    frame #1: 0x00007fa0cea8247a libc.so.6`__GI_abort + 362
    frame #2: 0x00007fa0cea79ea7 libc.so.6`__assert_fail_base + 279
    frame #3: 0x00007fa0cea79f52 libc.so.6`__GI___assert_fail + 66
    frame #4: 0x00007fa0cce05c4a lib_sql.so`rel_rename_exps(sql=0x00007fa0a800ea80, exps1=0x00007fa0a80cee10, exps2=0x00007fa0a80d16a0) + 431 at rel_optimizer.c:1798
    frame #5: 0x00007fa0cce12f9b lib_sql.so`rel_push_project_down_union(changes=0x00007fa0c6d70a08, sql=0x00007fa0a800ea80, rel=0x00007fa0a80cf750) + 897 at rel_optimizer.c:4641
    frame #6: 0x00007fa0cce2238d lib_sql.so`rewrite_topdown(sql=0x00007fa0a800ea80, rel=0x00007fa0a80cf750, rewriter=(lib_sql.so`rel_push_project_down_union at rel_optimizer.c:4609), has_changes=0x00007fa0c6d70a08) + 76 at rel_optimizer.c:8305
    frame #7: 0x00007fa0cce224c0 lib_sql.so`rewrite_topdown(sql=0x00007fa0a800ea80, rel=0x00007fa0a80cf850, rewriter=(lib_sql.so`rel_push_project_down_union at rel_optimizer.c:4609), has_changes=0x00007fa0c6d70a08) + 383 at rel_optimizer.c:8334
    frame #8: 0x00007fa0cce22d22 lib_sql.so`_rel_optimizer(sql=0x00007fa0a800ea80, rel=0x00007fa0a80cf850, level=0) + 1927 at rel_optimizer.c:8492
    frame #9: 0x00007fa0cce22f28 lib_sql.so`rel_optimizer(sql=0x00007fa0a800ea80, rel=0x00007fa0a80cf850) + 55 at rel_optimizer.c:8530
    frame #10: 0x00007fa0ccd12df4 lib_sql.so`sql_symbol2relation(c=0x00007fa0a800ea80, sym=0x00007fa0a80c5c70) + 94 at sql.c:121
    frame #11: 0x00007fa0ccd37efa lib_sql.so`SQLparser(c=0x00007fa0cd396630) + 3677 at sql_scenario.c:1077
    frame #12: 0x00007fa0d1b46c65 libmonetdb5.so.21`runPhase(c=0x00007fa0cd396630, phase=1) + 122 at mal_scenario.c:517
    frame #13: 0x00007fa0d1b46da9 libmonetdb5.so.21`runScenarioBody(c=0x00007fa0cd396630) + 288 at mal_scenario.c:550
    frame #14: 0x00007fa0d1b46f4c libmonetdb5.so.21`runScenario(c=0x00007fa0cd396630) + 76 at mal_scenario.c:579
    frame #15: 0x00007fa0d1b48a92 libmonetdb5.so.21`MSserveClient(dummy=0x00007fa0cd396630) + 488 at mal_session.c:448
    frame #16: 0x00007fa0d1b4853c libmonetdb5.so.21`MSscheduleClient(command="\x80$\f\xa8\xa0\x7f", challenge="Ch6i1CmPe", fin=0x00007fa0a80069e0, fout=0x00007fa0b8007030) + 3472 at mal_session.c:339
    frame #17: 0x00007fa0d1be7e60 libmonetdb5.so.21`doChallenge(data=0x00007fa0b80008d0) + 1209 at mal_mapi.c:197
    frame #18: 0x00007fa0d1649d36 libbat.so.13`thread_starter(arg=0x00007fa0b8009120) + 68 at gdk_system.c:485
    frame #19: 0x00007fa0cedf5454 libpthread.so.0`start_thread + 196
    frame #20: 0x00007fa0ceb367df libc.so.6`__GI___clone + 95
(lldb) frame select 4
frame #4: 0x00007fa0cce05c4a lib_sql.so`rel_rename_exps(sql=0x00007fa0a800ea80, exps1=0x00007fa0a80cee10, exps2=0x00007fa0a80d16a0) + 431 at rel_optimizer.c:1798
   1795			}
   1796		}
   1797	
-> 1798		assert(list_length(exps1) == list_length(exps2)); 
   1799		for (n = exps1->h, m = exps2->h; n && m; n = n->next, m = m->next) {
   1800			sql_exp *e1 = n->data;
   1801			sql_exp *e2 = m->data;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: schema.sql
Type: application/sql
Size: 7731 bytes
Desc: not available
URL: <http://www.monetdb.org/pipermail/developers-list/attachments/20161108/f116d84e/attachment-0002.sql>


More information about the developers-list mailing list