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

times.sql: procedure times() crashes the server #2586

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

times.sql: procedure times() crashes the server #2586

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

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2010-07-07 13:05:55 +0200
From: @grobian
To: SQL devs <>
Version: 2.40.1 (Oct2010) [obsolete]
CC: @njnes, @drstmane

Last updated: 2011-03-28 17:31:40 +0200

Comment 14242

Date: 2010-07-07 13:05:55 +0200
From: @grobian

execute the contents of times.sql:

create procedure times()
external name sql.times;

then issue the following query:

select times();

the server will segfault with:
rogram received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff6eff7710 (LWP 8725)]
0x00007fffdead4881 in _dumpstmt (sql=0x7fff48efa528, mb=0x7fff491c23d8,
s=0x7fff482f7e18)
at /ufs/fabian/scratch/monetdb/Jun2010/sql/src/backends/monet5/sql_gencode.mx:1746
1746 q = pushStr(mb, q, t->type->sqlname);
(gdb) p mb
$1 = (MalBlkPtr) 0x7fff491c23d8
(gdb) p q
$2 = (InstrPtr) 0x7fff4a625188
(gdb) p t->type->sqlname
Cannot access memory at address 0x18
(gdb) p t->type
$3 = (sql_type *) 0x0
(gdb) p t
$4 = (sql_subtype *) 0x7fff48678b68
(gdb)

Comment 14243

Date: 2010-07-07 13:07:15 +0200
From: @grobian

it seems to be any function that is called like this, not just times().

Comment 14603

Date: 2010-08-02 16:42:06 +0200
From: @drstmane

here's a quick gdb log (with Jun2010 branch as of today, Mon Aug 02 2010):

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdf496710 (LWP 18709)]
0x00007fffe02d7853 in dumpstmt (sql=0x7fffd004abf8, mb=0x7fffd0065b58, s=0x7fffd006e1d8) at /ufs/manegold//scratch0/Monet/HG/Jun2010/source/sql/src/backends/monet5/sql_gencode.mx:1746
1746 q = pushStr(mb, q, t->type->sqlname);
Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.5-6.fc12.x86_64 cyrus-sasl-lib-2.1.23-9.fc12.x86_64 geos-3.2.1-1.fc12.x86_64 glibc-2.11.2-1.x86_64 keyutils-libs-1.2-6.fc12.x86_64 krb5-libs-1.7.1-9.fc12.x86_64 libcom_err-1.41.9-7.fc12.x86_64 libcurl-7.19.7-10.fc12.x86_64 libgcc-4.4.4-10.fc12.x86_64 libidn-1.9-5.x86_64 libselinux-2.0.90-5.fc12.x86_64 libssh2-1.2.4-1.fc12.x86_64 libstdc++-4.4.4-10.fc12.x86_64 libuuid-2.16.2-9.fc12.x86_64 libxml2-2.7.6-2.fc12.x86_64 libxslt-1.1.26-1.fc12.x86_64 ncurses-libs-5.7-3.20090207.fc12.x86_64 nspr-4.8.4-2.fc12.x86_64 nss-3.12.6-7.fc12.x86_64 nss-softokn-freebl-3.12.6-2.fc12.1.x86_64 nss-util-3.12.6-1.fc12.x86_64 openldap-2.4.19-4.fc12.x86_64 openssl-1.0.0a-1.fc12.x86_64 pcre-7.8-3.fc12.x86_64 raptor-1.4.18-5.fc12.x86_64 readline-6.0-3.fc12.x86_64 zlib-1.2.3-23.fc12.x86_64
(gdb) bt
0 0x00007fffe02d7853 in dumpstmt (sql=0x7fffd004abf8, mb=0x7fffd0065b58, s=0x7fffd006e1d8) at /ufs/manegold//scratch0/Monet/HG/Jun2010/source/sql/src/backends/monet5/sql_gencode.mx:1746
1 0x00007fffe02d89a2 in backend_dumpstmt (be=0x7fffd004abf8, mb=0x7fffd0065b58, s=0x7fffd006e1d8) at /ufs/manegold//scratch0/Monet/HG/Jun2010/source/sql/src/backends/monet5/sql_gencode.mx:2010
2 0x00007fffe02d91be in backend_dumpproc (be=0x7fffd004abf8, c=0x605b38, cq=0x7fffd0065c58, s=0x7fffd006e1d8) at /ufs/manegold/
/scratch0/Monet/HG/Jun2010/source/sql/src/backends/monet5/sql_gencode.mx:2131
3 0x00007fffe02cea11 in SQLparser (c=0x605b38) at /ufs/manegold//scratch0/Monet/HG/Jun2010/source/sql/src/backends/monet5/sql_scenario.mx:1210
4 0x00007ffff7d223fa in runPhase (c=0x605b38, phase=1) at /ufs/manegold/
/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/mal/mal_scenario.mx:604
5 0x00007ffff7d22532 in runScenarioBody (c=0x605b38) at /ufs/manegold//scratch0/Monet/HG/Jun2010/source/MonetDB5/src/mal/mal_scenario.mx:646
6 0x00007ffff7d227b9 in runScenario (c=0x605b38) at /ufs/manegold/
/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/mal/mal_scenario.mx:682
7 0x00007ffff7cd5ef9 in MSserveClient (dummy=0x605b38) at /ufs/manegold/_/scratch0/Monet/HG/Jun2010/source/MonetDB5/src/mal/mal_session.mx:473
8 0x000000347c406a3a in start_thread () from /lib64/libpthread.so.0
9 0x000000347b8de77d in clone () from /lib64/libc.so.6
10 0x0000000000000000 in ?? ()
(gdb) li
1741 q = newStmt2(mb, sqlRef, exportValueRef);
1742 s->nr = getDestVar(q);
1743 q = pushInt(mb, q, sql->mvc->type);
1744 q = pushStr(mb, q, fqtn);
1745 q = pushStr(mb, q, cn);
1746 q = pushStr(mb, q, t->type->sqlname);
1747 q = pushInt(mb, q, t->digits);
1748 q = pushInt(mb, q, t->scale);
1749 q = pushInt(mb, q, t->type->eclass);
1750 q = pushArgument(mb, q, c->nr);
(gdb) p mb
$1 = (MalBlkPtr) 0x7fffd0065b58
(gdb) p *mb
$2 = {binding = 0x0, help = 0x0, alternative = 0x0, vtop = 8, vsize = 32, var = 0x7fffd00584e8, stop = 4, ssize = 32, stmt = 0x7fffd008b808, ptop = 1, psize = 32, prps = 0x7fffd007a6e8, errors = 0, typefixed = 0, flowfixed = 0, profiler = 0x0, history = 0x0, keephistory = 0, marker = 0x0, maxarg = 8,
replica = 0x0, recycle = 0, recid = 0, octid = -2604246222170760229, trap = 0}
(gdb) p q
$3 = (InstrPtr) 0x7fffd0066c68
(gdb) p *q
$4 = {token = 40 '(', barrier = 0 '\000', typechk = 0 '\000', gc = 0 '\000', polymorphic = 0 '\000', varargs = 0 '\000', recycle = 0, jump = 0, fcn = 0, blk = 0x0, modname = 0xb48e58 "sql", fcnname = 0xf33568 "exportValue", argc = 4, retc = 1, maxarg = 8, argv = 0x7fffd0066ca4}
(gdb) p t
$5 = (sql_subtype *) 0x7fffd00798d8
(gdb) p *t
$6 = {type = 0x0, digits = 0, scale = 0, comp_type = 0x0}
(gdb) p t->type
$7 = (sql_type *) 0x0
(gdb) p *t->type
Cannot access memory at address 0x0

Comment 14843

Date: 2010-08-30 09:23:20 +0200
From: @sjoerdmullender

The Jun2010-SP2 version has been released.

Comment 15001

Date: 2010-10-06 15:49:19 +0200
From: @sjoerdmullender

Changeset 0b75646be89a made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=0b75646be89a

Changeset description:

Added test for bug #2586.

Comment 15066

Date: 2010-10-19 09:13:37 +0200
From: @njnes

Changeset 333e14ad51c7 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=333e14ad51c7

Changeset description:

fixes bugs in limit (don't push topn under project, is handled in rel_bin
allready) Bug #2622 and Bug #2676

fix crash in Bug #2672 , ie complex between is now handled correctly

fix bug #2586, test for return types when using functions.
(and check for empty results on procedure calls)

Comment 15261

Date: 2010-12-03 21:38:22 +0100
From: @njnes

fixed. ie closing.

Comment 15648

Date: 2011-03-28 17:31:40 +0200
From: @sjoerdmullender

The Mar2011 version has been released.

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