Skip to content

Assertion failure when using INNER JOIN on STARTSWITH #7553

Description

@suyZhong

Describe the bug

The following test case crashed the monetdb server.

Reproduction steps

DROP TABLE IF EXISTS t0 CASCADE;
DROP TABLE IF EXISTS t1 CASCADE;

CREATE TABLE  t0 (c0 VARCHAR(500) , c1 INT ) ; 
CREATE TABLE  t1 (c0 BOOLEAN ) ;

SELECT * FROM t1 INNER  JOIN t0 ON STARTSWITH(((t0.c1)>=(t0.c0)), t1.c0, ('a' NOT LIKE(t0.c1))); -- unexpected end of file

Expected behavior

No crash.

MonetDB release

11.52.0 6ed27ae

Executables source

Self compiled and installed

Operating System

Ubuntu 22.04

Additional context

Build from source https://www.monetdb.org/documentation-Aug2024/dev-guide/installation-from-source/#summary

Backtrace:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140397876250176)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140397876250176) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140397876250176, signo=signo@entry=6)
    at ./nptl/pthread_kill.c:89
#3  0x00007fb0fed48476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007fb0fed2e7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007fb0fed2e71b in __assert_fail_base (
    fmt=0x7fb0feee3130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x7fb0fe349747 "sql->session->status == -10", 
    file=0x7fb0fe349100 "/app/MonetDB/sql/backends/monet5/rel_bin.c", line=3271, 
    function=<optimized out>) at ./assert/assert.c:92
#6  0x00007fb0fed3fe96 in __GI___assert_fail (
    assertion=0x7fb0fe349747 "sql->session->status == -10", 
    file=0x7fb0fe349100 "/app/MonetDB/sql/backends/monet5/rel_bin.c", line=3271, 
    function=0x7fb0fe34a248 <__PRETTY_FUNCTION__.41> "rel2bin_join")
    at ./assert/assert.c:101
#7  0x00007fb0fe064fdd in rel2bin_join () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#8  0x00007fb0fe07a425 in subrel_bin () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#9  0x00007fb0fe06ae75 in rel2bin_project ()
   from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#10 0x00007fb0fe07a569 in subrel_bin () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#11 0x00007fb0fe07a9c3 in output_rel_bin () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#12 0x00007fb0fe0b051e in sql_relation2stmt ()
   from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#13 0x00007fb0fe0b0753 in backend_dumpstmt_body ()
   from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#14 0x00007fb0fe0b0b3a in backend_dumpstmt ()
   from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#15 0x00007fb0fe03d7ed in SQLparser_body () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#16 0x00007fb0fe03e3d1 in SQLparser () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#17 0x00007fb0fe03e570 in SQLengine_ () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#18 0x00007fb0fe03e646 in SQLengine () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#19 0x00007fb10058fd5f in runScenarioBody () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#20 0x00007fb10058fe6d in runScenario () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#21 0x00007fb100591eaf in MSserveClient () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#22 0x00007fb1005916ba in MSscheduleClient () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#23 0x00007fb100693e22 in doChallenge () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#24 0x00007fb0ff84b019 in thread_starter () from /usr/local/lib/libbat-11.52.0.so.28
#25 0x00007fb0fed9aac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#26 0x00007fb0fee2ba04 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions