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 in seqscan_eq_bte_bte_tloc_void_void #3028

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

Segmentation fault in seqscan_eq_bte_bte_tloc_void_void #3028

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

Comments

@monetdb-team
Copy link

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

Date: 2012-02-19 19:17:09 +0100
From: @skinkie
To: SQL devs <>
Version: -- development
CC: @njnes, @drstmane

Last updated: 2012-05-25 12:58:44 +0200

Comment 16950

Date: 2012-02-19 19:17:09 +0100
From: @skinkie

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

CREATE TABLE "sys"."cache_kv1_3" (
"dataownercode" VARCHAR(10) NOT NULL,
"lineplanningnumber" VARCHAR(10) NOT NULL,
"journeypatterncode" VARCHAR(10) NOT NULL,
"journeynumber" DECIMAL(6) NOT NULL,
"timedemandgroupcode" VARCHAR(10) NOT NULL,
"daytype" SMALLINT NOT NULL,
"departuretime" TIMESTAMP NOT NULL,
"wheelchairaccessible" BOOLEAN NOT NULL,
"validfrom" DATE NOT NULL,
"validthru" DATE NOT NULL
);

select journeypatterncode from cache_kv1_3 where bit_and(cache_kv1_3.daytype, 1) = 1 and '2012-02-20' BETWEEN cache_kv1_3.validfrom AND cache_kv1_3.validthru;

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffebc75700 (LWP 21498)]
0x00007ffff569c98f in seqscan_eq_bte_bte_tloc_void_void (b=0xecbf30, bn=0xeda270, tl=0xef0b60, th=0xef0b60, str_idx=0) at gdk_scanselect_defs.mx:124
124 @7@2_bunfastins(bn, @8, @5);
(gdb) bt
0 0x00007ffff569c98f in seqscan_eq_bte_bte_tloc_void_void (b=0xecbf30, bn=0xeda270, tl=0xef0b60, th=0xef0b60, str_idx=0) at gdk_scanselect_defs.mx:124
1 0x00007ffff5ea70c8 in BAT_scanselect (b=0xecbf30, bn=0xeda270, tl=0xef0b60, th=0xef0b60, li=1 '\001', hi=1 '\001', equi=1, nequi=0, lval=1, hval=1, nocheck=0) at gdk_scanselect.mx:346
2 0x00007ffff5f14f2e in BAT_select_ (b=0xecbf30, tl=0xef0b60, th=0xef0b60, li=1 '\001', hi=1 '\001', tail=0 '\000', anti=0 '\000', preserve_order=0 '\000') at gdk_batop.mx:1272
3 0x00007ffff5f15ab7 in BATuselect (b=0xecbf30, h=0xef0b60, t=0x0) at gdk_batop.mx:1344
4 0x00007ffff73f5ec7 in CMDuselect1 (result=0x7fffebc741c0, b=0xecbf30, value=0xef0b60) at algebra.mx:1416
5 0x00007ffff73fda4f in ALGuselect1 (result=0xef09d0, bid=0xef09c0, value=0xef0b60) at algebra.mx:2263
6 0x00007ffff6b2d95d in runMALsequence (cntxt=0x666578, mb=0x110b160, startpc=1, stoppc=0, stk=0xef0770, env=0x0, pcicaller=0x0) at mal_interpreter.mx:1958
7 0x00007ffff6b1cc9c in callMAL (cntxt=0x666578, mb=0x110b160, env=0x7fffebc74be0, argv=0xdb6990, debug=0 '\000') at mal_interpreter.mx:423
8 0x00007fffec6b4108 in SQLexecutePrepared (c=0x666578, be=0xde4260, q=0x83ab80) at sql_scenario.c:1610
9 0x00007fffec6b43f0 in SQLengineIntern (c=0x666578, be=0xde4260) at sql_scenario.c:1663
10 0x00007fffec6b4992 in SQLengine (c=0x666578) at sql_scenario.c:1788
11 0x00007ffff6b08514 in runPhase (c=0x666578, phase=4) at mal_scenario.c:522
12 0x00007ffff6b0870e in runScenarioBody (c=0x666578) at mal_scenario.c:573
13 0x00007ffff6b08919 in runScenario (c=0x666578) at mal_scenario.c:601
14 0x00007ffff6b099a7 in MSserveClient (dummy=0x666578) at mal_session.c:438
15 0x00007ffff327bd0c in start_thread () from /lib64/libpthread.so.0
16 0x00007ffff2fc1d7d in clone () from /lib64/libc.so.6

Reproducible: Always

Comment 16953

Date: 2012-02-20 00:53:44 +0100
From: @drstmane

Works fine for me, with the Dec2011 release, with the latest Dec2011 release branch (changeset b83377825264), and with the latest default branch (changeset 1f92469b8880) --- all on 64-bit Fedora Linux.

Please provide more information in case it still fails with you.

Comment 16955

Date: 2012-02-20 01:17:06 +0100
From: @skinkie

Details were sent per mail.

Comment 17109

Date: 2012-03-21 04:06:10 +0100
From: @skinkie

select
*
FROM cache_kv1, cache_kv1_2, cache_kv1_3, cache_kv1_4, dest WHERE
cache_kv1.doc_lpn_jpc_tdgc = cache_kv1_2.doc_lpn_jpc_tdgc and
cache_kv1.doc_lpn_jpc_tdgc = cache_kv1_3.doc_lpn_jpc_tdgc and
cache_kv1.doc_lpn_jpc_tdgc = cache_kv1_4.doc_lpn_jpc_tdgc and
cache_kv1_2.doc_dc = dest.doc_dc and
bit_and(cache_kv1_3.daytype, 8) = 8 and
'2012-03-20' BETWEEN cache_kv1_3.validfrom AND cache_kv1_3.validthru AND
cache_kv1_2.quayid = 'CXX:57330221';

0 0x00007ffff5996e03 in seqscan_eq_bte_bte_tloc_void_void (b=0x1615d00,
bn=0x1881610, tl=0x1bb9470, th=0x1bb9470, str_idx=0)
at gdk_scanselect_defs.mx:124
1 0x00007ffff61a153c in BAT_scanselect (b=0x1615d00, bn=0x1881610,
tl=0x1bb9470, th=0x1bb9470, li=1 '\001', hi=1 '\001', equi=1, nequi=0,
lval=1, hval=1, nocheck=0) at gdk_scanselect.mx:346
2 0x00007ffff620f3d8 in BAT_select_ (b=0x1615d00, tl=0x1bb9470,
th=0x1bb9470, li=1 '\001', hi=1 '\001', tail=0 '\000', anti=0 '\000',
preserve_order=0 '\000') at gdk_batop.mx:1272
3 0x00007ffff620ff61 in BATuselect (b=0x1615d00, h=0x1bb9470, t=0x0)
at gdk_batop.mx:1344
4 0x00007ffff76d88db in CMDuselect1 (result=0x7fffeba9ee10, b=0x1615d00,
value=0x1bb9470) at algebra.mx:1417
5 0x00007ffff76e039c in ALGuselect1 (result=0x1bb7bc0, bid=0x1bb7bb0,
value=0x1bb9470) at algebra.mx:2257
6 0x00007ffff6e0b12a in runMALsequence (cntxt=0x668928, mb=0x1237f50,
startpc=1, stoppc=0, stk=0x1bb7590, env=0x0, pcicaller=0x0)
at mal_interpreter.mx:1958
7 0x00007ffff6df9a14 in callMAL (cntxt=0x668928, mb=0x1237f50,
env=0x7fffeba9fbe0, argv=0x1b4aaa0, debug=0 '\000')
at mal_interpreter.mx:423
8 0x00007fffec4df158 in SQLexecutePrepared (c=0x668928, be=0xaa1710,
q=0x121c870) at sql_scenario.c:1642
9 0x00007fffec4df440 in SQLengineIntern (c=0x668928, be=0xaa1710)
at sql_scenario.c:1695
10 0x00007fffec4df9e8 in SQLengine (c=0x668928) at sql_scenario.c:1821
11 0x00007ffff6de512d in runPhase (c=0x668928, phase=4) at mal_scenario.c:522
12 0x00007ffff6de5327 in runScenarioBody (c=0x668928) at mal_scenario.c:573
13 0x00007ffff6de5532 in runScenario (c=0x668928) at mal_scenario.c:601
14 0x00007ffff6de65f8 in MSserveClient (dummy=0x668928) at mal_session.c:438
15 0x00007ffff350bd0c in start_thread () from /lib64/libpthread.so.0
16 0x00007ffff3251d7d in clone () from /lib64/libc.so.6

Its the combination of between and bit_and that fails here;

Simplified:
CREATE TABLE "sys"."cache_kv1" (
"doc_lpn_jpc_tdgc" VARCHAR(43)
);
CREATE TABLE "sys"."cache_kv1_3" (
"daytype" SMALLINT NOT NULL,
"validfrom" DATE NOT NULL,
"validthru" DATE NOT NULL,
"doc_lpn_jpc_tdgc" VARCHAR(43)
);

insert into cache_kv1 values ('1');
insert into cache_kv1_3 values (8, '2012-02-01', '2012-04-01', '1');
query works;
insert into cache_kv1_3 values (8, '2012-02-01', '2012-04-01', '2');
query works;
insert into cache_kv1 values ('4');
query works;
insert into cache_kv1_3 values (8, '2012-01-01', '2012-01-02', '1');
query works;
insert into cache_kv1_3 values (1, '2012-01-01', '2012-01-02', '1');

failure

select *
FROM cache_kv1, cache_kv1_3 WHERE
cache_kv1.doc_lpn_jpc_tdgc = cache_kv1_3.doc_lpn_jpc_tdgc and
bit_and(cache_kv1_3.daytype, 8) = 8 and
'2012-03-20' BETWEEN cache_kv1_3.validfrom AND cache_kv1_3.validthru;

I guess it is now easier to reproduce.

Comment 17197

Date: 2012-04-29 20:26:40 +0200
From: @njnes

fixed. The MTIME functions now properly return oid heads with oid inputs

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