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

uninitialized memory causing bad output in query plans #3360

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

uninitialized memory causing bad output in query plans #3360

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

Comments

@monetdb-team
Copy link

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

Date: 2013-09-07 06:41:59 +0200
From: Tim H. <<monetdb.bug.reporter>>
To: SQL devs <>
Version: 11.15.7 (Feb2013-SP2)
CC: @njnes

Last updated: 2013-09-27 13:47:14 +0200

Comment 19139

Date: 2013-09-07 06:41:59 +0200
From: Tim H. <<monetdb.bug.reporter>>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36
Build Identifier:

Start mserver5 so that it initializes a new database. Then load the TPCH schema plus keys. Finally, plan the TPCH queries. Do this twice, each time with a newly initialized database. Diffing the two outputs will show where uninitialized memory is written as a string in the plan.

Reproducible: Always

Steps to Reproduce:

mkdir /tmp/mtest-19378/
rm -rf /tmp/db-19378
mserver5 --dbpath=/tmp/db-19378 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=35809 --set mapi_usock=/tmp/mtest-19378/.s.monetdb.35809 --set monet_prompt= --forcemito --set mal_listing=2 &
mclient -lsql -ftest -Eutf-8 -i -e --port=35809 < tpch_query_plans.sql > run1
pkill mserver5
rm -rf /tmp/db-19378
mserver5 --dbpath=/tmp/db-19378 --debug=10 --set gdk_nr_threads=0 --set mapi_open=true --set mapi_port=35809 --set mapi_usock=/tmp/mtest-19378/.s.monetdb.35809 --set monet_prompt= --forcemito --set mal_listing=2 &
mclient -lsql -ftest -Eutf-8 -i -e --port=35809 < tpch_query_plans.sql > run2
diff run1 run2

Actual Results:

568,570c568,570
< | | | | | table(sys.customer) [ customer.c_custkey NOT NULL HASHCOL as �.c_custkey, customer.c_name NOT NULL as �.c_name, customer.%TID% NOT NULL as �.%TID%, customer.%customer_c_custkey_pkey NOT NULL HASHIDX as �.%customer_c_custkey_pkey, customer.%customer_c_nationkey_fkey NOT NULL JOINIDX sys.customer.customer_c_nationkey_fkey as �.%customer_c_nationkey_fkey ] COUNT
< | | | | ) [ customer.c_custkey NOT NULL HASHCOL = �.c_custkey NOT NULL HASHCOL FETCH ]
< | | | ) [ customer.c_custkey NOT NULL HASHCOL , orders.o_orderkey NOT NULL HASHCOL , L6.L6 NOT NULL, �.c_custkey NOT NULL, �.c_name NOT NULL as customer.c_name ],

| | | | | table(sys.customer) [ customer.c_custkey NOT NULL HASHCOL as �.c_custkey, customer.c_name NOT NULL as �.c_name, customer.%TID% NOT NULL as �.%TID%, customer.%customer_c_custkey_pkey NOT NULL HASHIDX as �.%customer_c_custkey_pkey, customer.%customer_c_nationkey_fkey NOT NULL JOINIDX sys.customer.customer_c_nationkey_fkey as �.%customer_c_nationkey_fkey ] COUNT
| | | | ) [ customer.c_custkey NOT NULL HASHCOL = �.c_custkey NOT NULL HASHCOL FETCH ]
| | | ) [ customer.c_custkey NOT NULL HASHCOL , orders.o_orderkey NOT NULL HASHCOL , L6.L6 NOT NULL, �.c_custkey NOT NULL, �.c_name NOT NULL as customer.c_name ],

Expected Results:

This is with a build of the MonetDB repository Feb2013 branch @48758, configured with all the defaults. I.e. just ./configure. Note that there is a SQL file referenced in the repro steps. I will attach it to this bug.

I'm marking this as critical because memory issues in C programs can cause bad things to happen.

Comment 19140

Date: 2013-09-07 06:42:54 +0200
From: Tim H. <<monetdb.bug.reporter>>

Created attachment 232
SQL file referenced in the repro steps

Attached file: tpch_query_plans.sql (application/octet-stream, 13914 bytes)
Description: SQL file referenced in the repro steps

Comment 19141

Date: 2013-09-09 02:36:00 +0200
From: @njnes

fixed, added missing strdup

Comment 19142

Date: 2013-09-09 02:36:58 +0200
From: MonetDB Mercurial Repository <>

Changeset 23a797ab1392 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=23a797ab1392

Changeset description:

fixed strdup issue, ie bug #3360
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