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

Segmentation fault using a column inside of a functioncall #2740

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

Segmentation fault using a column inside of a functioncall #2740

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

Comments

@monetdb-team
Copy link

Date: 2010-12-04 21:00:14 +0100
From: @skinkie
To: SQL devs <>
Version: 11.5.1 (Aug2011) [obsolete]
CC: @njnes

Last updated: 2012-01-26 15:32:07 +0100

Comment 15278

Date: 2010-12-04 21:00:14 +0100
From: @skinkie

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.210 Safari/534.10
Build Identifier:

create table tags_tmp (word varchar(265), counts integer not null);
copy 53681 records into tags_tmp from '/tmp/keywords.tsv' delimiters '\t', '\n' null as '';
create table tags (word varchar(265), counts integer not null, doccounts integer not null);
create function sphinx_searchIndexLimit(query string, idx string, "limit" int) returns table (id bigint) external name sphinx."sphinx_searchIndexLimit";
insert into tags select word, counts, (select count(*) from sphinx_searchIndexLimit(word, 'index', 1000)) as doccounts from tags_tmp;

This results in:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe335a710 (LWP 20123)]
0x00007fffe403e8ff in flatten_exps (sql=0x1554758, exps=0x0) at ../../../src/server/rel_select.mx:3395
3395 for (n=exps->h; n; n=n->next) {
(gdb) bt
0 0x00007fffe403e8ff in flatten_exps (sql=0x1554758, exps=0x0) at ../../../src/server/rel_select.mx:3395
1 0x00007fffe403ed83 in _rel_aggr (sql=0x1554758, rel=0x7fffe3359490, distinct=0, aggrstr=0x170d278 "count", sym=0x0, f=3) at ../../../src/server/rel_select.mx:3472
2 0x00007fffe403f1dd in rel_aggr (sql=0x1554758, rel=0x7fffe3359490, se=0x170d338, f=3) at ../../../src/server/rel_select.mx:3534
3 0x00007fffe4041386 in rel_value_exp2 (sql=0x1554758, rel=0x7fffe3359490, se=0x170d338, f=3, ek=..., is_last=0x7fffe3359394) at ../../../src/server/rel_select.mx:4112
4 0x00007fffe4041ac9 in rel_value_exp (sql=0x1554758, rel=0x7fffe3359490, se=0x170d338, f=3, ek=...) at ../../../src/server/rel_select.mx:4247
5 0x00007fffe4041b94 in column_exp (sql=0x1554758, rel=0x7fffe3359490, column_e=0x170d3d8, f=3) at ../../../src/server/rel_select.mx:4260
6 0x00007fffe4041cd8 in rel_column_exp (sql=0x1554758, rel=0x7fffe3359490, column_e=0x170d3d8, f=3) at ../../../src/server/rel_select.mx:4292
7 0x00007fffe4042f82 in rel_select_exp (sql=0x1554758, rel=0xb149b8, outer=0xb2abc8, sn=0x170d9d8, ek=...) at ../../../src/server/rel_select.mx:4598
8 0x00007fffe4043ccb in rel_query (sql=0x1554758, rel=0xb2abc8, sq=0x170d9d8, toplevel=0, ek=...) at ../../../src/server/rel_select.mx:4804
9 0x00007fffe404514a in rel_subquery (sql=0x1554758, rel=0xb2abc8, sq=0x170d9d8, ek=...) at ../../../src/server/rel_select.mx:5147
10 0x00007fffe4041839 in rel_value_exp2 (sql=0x1554758, rel=0x7fffe3359870, se=0x170d9d8, f=3, ek=..., is_last=0x7fffe3359774) at ../../../src/server/rel_select.mx:4183
11 0x00007fffe4041ac9 in rel_value_exp (sql=0x1554758, rel=0x7fffe3359870, se=0x170d9d8, f=3, ek=...) at ../../../src/server/rel_select.mx:4247
12 0x00007fffe4041b94 in column_exp (sql=0x1554758, rel=0x7fffe3359870, column_e=0x170dae8, f=3) at ../../../src/server/rel_select.mx:4260
13 0x00007fffe4041cd8 in rel_column_exp (sql=0x1554758, rel=0x7fffe3359870, column_e=0x170dae8, f=3) at ../../../src/server/rel_select.mx:4292
14 0x00007fffe4042f82 in rel_select_exp (sql=0x1554758, rel=0xb2abc8, outer=0x0, sn=0x170dd88, ek=...) at ../../../src/server/rel_select.mx:4598
15 0x00007fffe4043ccb in rel_query (sql=0x1554758, rel=0x0, sq=0x170dd88, toplevel=1, ek=...) at ../../../src/server/rel_select.mx:4804
16 0x00007fffe404514a in rel_subquery (sql=0x1554758, rel=0x0, sq=0x170dd88, ek=...) at ../../../src/server/rel_select.mx:5147
17 0x00007fffe4045d53 in insert_into (sql=0x1554758, qname=0x170cf68, columns=0x0, val_or_q=0x170dd88) at ../../../src/server/rel_updates.mx:236
18 0x00007fffe40481c3 in rel_updates (sql=0x1554758, s=0x170deb8) at ../../../src/server/rel_updates.mx:761
19 0x00007fffe4032c5c in rel_semantic (sql=0x1554758, s=0x170deb8) at ../../../src/server/rel_semantic.mx:244
20 0x00007fffe3f97a48 in sql_symbol2stmt (c=0x1554758, sym=0x170deb8) at ../../../../src/backends/monet5/sql.mx:1397
21 0x00007fffe3fe3d2f in SQLparser (c=0x605898) at ../../../../src/backends/monet5/sql_scenario.mx:1286
22 0x00007ffff7b05516 in runPhase (c=0x605898, phase=1) at ../../../src/mal/mal_scenario.mx:604
23 0x00007ffff7b0564e in runScenarioBody (c=0x605898) at ../../../src/mal/mal_scenario.mx:646
24 0x00007ffff7b058d5 in runScenario (c=0x605898) at ../../../src/mal/mal_scenario.mx:682
25 0x00007ffff7ab864a in MSserveClient (dummy=0x605898) at ../../../src/mal/mal_session.mx:495
26 0x00007ffff579fc0a in start_thread () from /lib64/libpthread.so.0
27 0x00007ffff48a7a9d in clone () from /lib64/libc.so.6

Something seems to go wrong with the concept that I want to use a 'value' from another table inside a function.

Reproducible: Always

MonetDB server v5.22.2 (64-bit), based on kernel v1.40.2 (64-bit oids)
Not released
Copyright (c) 1993-July 2008 CWI
Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved
Visit http://monetdb.cwi.nl/ for further information
Found 3.9GiB available memory, 2 available cpu cores
Configured for prefix: /opt/monetdb-testing3
Libraries:
libpcre: 8.02 2010-03-19 (compiled with 8.02)
openssl: OpenSSL 1.0.0a 1 Jun 2010 (compiled with OpenSSL 1.0.0a 1 Jun 2010)
libxml2: 2.7.7 (compiled with 2.7.7)
Compiled by: skinkie@openkvk (x86_64-unknown-linux-gnu)
Compilation: gcc -Wall -Wextra -fno-strict-aliasing -g -Werror-implicit-function-declaration -Werror -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2
Linking : /usr/x86_64-pc-linux-gnu/bin/ld -IPA -m elf_x86_64

Comment 15283

Date: 2010-12-05 12:13:07 +0100
From: @njnes

this bug indicates a number of problems. Most important one is that we don't handle table functions with multi row input. Currently it doesn't fit the relations trees we built internally. Requires some more work.

Other problems are that we don't test for this case and because of that crash (trigger an assert).

Comment 16043

Date: 2011-07-29 11:00:07 +0200
From: @sjoerdmullender

Apr2011-SP2 has been released.

Comment 16207

Date: 2011-09-11 22:02:33 +0200
From: @njnes

now supported through union functions. This is still work in progress and extends beyond normal sql standard.

Comment 16208

Date: 2011-09-12 09:45:59 +0200
From: @sjoerdmullender

This will not appear in the Aug2011 release.

Comment 16833

Date: 2012-01-26 15:32:07 +0100
From: @sjoerdmullender

The Dec2011 version has been release, so declaring this bug as FIXED.

@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 Nov 9, 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