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

segv on rel_order_by_column_exp #3630

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

segv on rel_order_by_column_exp #3630

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

Comments

@monetdb-team
Copy link

Date: 2014-11-28 01:53:18 +0100
From: @skinkie
To: SQL devs <>
Version: 11.19.3 (Oct2014)
CC: @njnes

Last updated: 2015-01-29 14:07:19 +0100

Comment 20463

Date: 2014-11-28 01:53:18 +0100
From: @skinkie

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

CREATE TABLE "sys"."sirivm" (
"vehiclenumber" INTEGER,
"recordedattime" TIMESTAMP,
"linkdistance" INTEGER,
"percentage" DECIMAL(5,2),
"lineref" CHARACTER LARGE OBJECT,
"dataframeref" CHARACTER LARGE OBJECT,
"datedvehiclejourneyref" CHARACTER LARGE OBJECT,
"monitored" BOOLEAN,
"mon_error" CHARACTER LARGE OBJECT,
"blockref" CHARACTER LARGE OBJECT,
"delay" INTEGER,
"lon" DOUBLE,
"lat" DOUBLE,
"laststopref" CHARACTER LARGE OBJECT,
"laststoporder" INTEGER,
"lastaimedarr" TIMESTAMP,
"lastaimeddep" TIMESTAMP,
"monstopref" CHARACTER LARGE OBJECT,
"monstoporder" INTEGER,
"monaimedarr" TIMESTAMP,
"monaimeddep" TIMESTAMP,
"monatstop" CHARACTER LARGE OBJECT,
"monexpectedarr" TIMESTAMP,
"monexpecteddep" TIMESTAMP,
"nextstopref" CHARACTER LARGE OBJECT,
"nextstoporder" INTEGER,
"nextaimedarr" TIMESTAMP,
"nextaimeddep" TIMESTAMP,
"nextexpectedarr" TIMESTAMP,
"nextexpecteddep" TIMESTAMP,
"journeypattern" CHARACTER LARGE OBJECT
);

select a.recordedattime, a.monexpectedarr, a.monexpecteddep, a.monaimedarr, b.monaimeddep, a.delay, b.delay, (b.recordedattime - a.monaimedarr)/1000 as ourdelay, b.recordedattime, b.monexpectedarr, b.monexpecteddep, monstopref from sirivm as a join sirivm as b using (vehiclenumber, lineref, datedvehiclejourneyref, monstopref) where a.monatstop = 'false' and b.monatstop = 'true' order by abs(ourdelay) desc limit 10;

0x00007ffff2c96cf3 in rel_order_by_column_exp (sql=0x7fffe4005430, R=0x7ffff0215a10, column_r=0x7fffe4108c60, f=4) at rel_select.c:4509
4509 if (is_processed(r) && e) {
(gdb) bt
0 0x00007ffff2c96cf3 in rel_order_by_column_exp (sql=0x7fffe4005430, R=0x7ffff0215a10, column_r=0x7fffe4108c60, f=4) at rel_select.c:4509
1 0x00007ffff2c972cc in rel_order_by (sql=0x7fffe4005430, R=0x7ffff0215ab0, orderby=0x7fffe4108d40, f=4) at rel_select.c:4604
2 0x00007ffff2c999cb in rel_select_exp (sql=0x7fffe4005430, rel=0x7fffe413c6f0, sn=0x7fffe4108a80, ek=...) at rel_select.c:5208
3 0x00007ffff2c9a1c2 in rel_query (sql=0x7fffe4005430, rel=0x0, sq=0x7fffe4108a80, toplevel=1, ek=..., apply=8) at rel_select.c:5335
4 0x00007ffff2c9bb3d in rel_subquery (sql=0x7fffe4005430, rel=0x0, sq=0x7fffe4108a80, ek=..., apply=8) at rel_select.c:5714
5 0x00007ffff2c9bc15 in rel_selects (sql=0x7fffe4005430, s=0x7fffe4108a80) at rel_select.c:5731
6 0x00007ffff2c83eb9 in rel_semantic (sql=0x7fffe4005430, s=0x7fffe4108a80) at rel_semantic.c:264
7 0x00007ffff2bc80c8 in sql_symbol2relation (c=0x7fffe4005430, sym=0x7fffe4108a80) at sql.c:125
8 0x00007ffff2bf0f42 in SQLparser (c=0x7097c0) at sql_scenario.c:2308
9 0x00007ffff78f60d6 in runPhase (c=0x7097c0, phase=1) at mal_scenario.c:526
10 0x00007ffff78f6278 in runScenarioBody (c=0x7097c0) at mal_scenario.c:561
11 0x00007ffff78f6432 in runScenario (c=0x7097c0) at mal_scenario.c:590
12 0x00007ffff78f7dd8 in MSserveClient (dummy=0x7097c0) at mal_session.c:459
13 0x00007ffff7384920 in thread_starter (arg=0x7fffec000a20) at gdk_system.c:505
14 0x00007ffff4de9f3a in start_thread () from /lib64/libpthread.so.0
15 0x00007ffff4b23dad in clone () from /lib64/libc.so.6

Removing the abs from the query solves the issue.

Reproducible: Always

MonetDB 5 server v11.19.4 (64-bit, 64-bit oids)
This is an unreleased version
Copyright (c) 1993-July 2008 CWI
Copyright (c) August 2008-2014 MonetDB B.V., all rights reserved
Visit http://www.monetdb.org/ for further information
Found 31.4GiB available memory, 8 available cpu cores
Libraries:
libpcre: 8.33 2013-05-28 (compiled with 8.33)
openssl: OpenSSL 1.0.1h 5 Jun 2014 (compiled with OpenSSL 1.0.1h 5 Jun 2014)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: skinkie@bigdata.openebs.nl (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/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64

Comment 20490

Date: 2014-11-30 15:35:59 +0100
From: @njnes

improved error message (and fixed crash)

Comment 20491

Date: 2014-11-30 15:36:22 +0100
From: @njnes

test added order_by_incorrect_error.Bug-3630.sql

Comment 20492

Date: 2014-11-30 15:52:54 +0100
From: MonetDB Mercurial Repository <>

Changeset 44aa50bb3051 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=44aa50bb3051

Changeset description:

fixed bug #3630 and added a test

Comment 20596

Date: 2015-01-29 14:07:19 +0100
From: @sjoerdmullender

Oct2014-SP2 has been released.

@monetdb-team monetdb-team added bug Something isn't working normal 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 normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants