Bugs item #2947763, was opened at 2010-02-08 12:07
Message generated for change (Comment added) made by vzzzbx
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2947763&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: SQL "candidate"
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Wouter Alink (vzzzbx)
Assigned to: Niels Nes (nielsnes)
Summary: SQL: insert into + select on same table
Initial Comment:
Feb2010
When running a script which creates and fills a database exactly the same way
each time, sometimes (but not every time) I get a segfault on a specific point
in the SQL script. It is always in the following query:
INSERT INTO x_1 SELECT a.x as idstr " +
"FROM x as a LEFT JOIN x_1 as b ON a.x=b.idstr " +
"WHERE isnull(b.idstr);
The query basically inserts values into a table which are not yet in the table.
It only seems to happens when x_1 is not empty anymore. (perhaps interesting
detail is that the stringheap of x_1 is probably close to 128k in size)
gdb says:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f498ce12710 (LWP 1817)]
0x00007f49a47039eb in strPut (h=0x7f49805332a8, dst=0x7f498ce0ef80,
v=0x7f49740220a0 "wherea")
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB/src/gdk/gdk_atoms.mx:1986
1986 if (GDK_STRCMP(v, h->base + pos) == 0) {
(gdb) l
1981 if (pad < sizeof(stridx_t))
1982 pad += GDK_VARALIGN; /* if not, pad more */
1983 } else if (*bucket) {
1984 /* large string heap (>=64KB) --
opportunistic/probabilistic double elimination */
1985 pos = elimbase + *bucket + extralen;
1986 if (GDK_STRCMP(v, h->base + pos) == 0) {
1987 return *dst = (var_t) (pos >> GDK_VARSHIFT); /*
already in heap; do not insert! */
1988 }
1989 #if SIZEOF_VAR_T < SIZEOF_VOID_P
1990 pad &= (GDK_VARALIGN-1); /* a full VARALIGN pad can be
omitted */
(gdb) bt
#0 0x00007f49a47039eb in strPut (h=0x7f49805332a8, dst=0x7f498ce0ef80,
v=0x7f49740220a0 "wherea")
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB/src/gdk/gdk_atoms.mx:1986
#1 0x00007f49a44e1359 in BATins (b=0x7f498053a838, n=0x7f49740073a8, force=0
'\000')
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB/src/gdk/gdk_batop.mx:407
#2 0x00007f4991f952eb in MATpackInternal (stk=0x7f49805a8e08, p=0x7f498053ec08)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/modules/mal/mat.mx:181
#3 0x00007f4991f95629 in MATpack (cntxt=0x604e70, mb=0x7f4980534d78,
stk=0x7f49805a8e08, p=0x7f498053ec08)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/modules/mal/mat.mx:241
#4 0x00007f49a50f9e2d in runMALsequence (cntxt=0x604e70, mb=0x7f4980534d78,
startpc=1, stoppc=0, stk=0x7f49805a8e08, env=0x0, pcicaller=0x0)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_interpreter.mx:1904
#5 0x00007f49a50f06e2 in callMAL (cntxt=0x604e70, mb=0x7f4980534d78,
env=0x7f498ce11b88, argv=0x7f498ce11bd0, debug=0 '\000')
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_interpreter.mx:400
#6 0x00007f498e202b2a in SQLexecutePrepared (c=0x604e70, be=0x7f4980039728,
q=0x7f4980562548)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/sql/src/backends/monet5/sql_scenario.mx:1327
#7 0x00007f498e202da9 in SQLengineIntern (c=0x604e70, be=0x7f4980039728)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/sql/src/backends/monet5/sql_scenario.mx:1380
#8 0x00007f498e2032e4 in SQLengine (c=0x604e70)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/sql/src/backends/monet5/sql_scenario.mx:1490
#9 0x00007f49a513990b in runPhase (c=0x604e70, phase=4)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_scenario.mx:602
#10 0x00007f49a5139b01 in runScenarioBody (c=0x604e70) at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_scenario.mx:654
#11 0x00007f49a5139cbe in runScenario (c=0x604e70) at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_scenario.mx:679
#12 0x00007f49a50ee334 in MSserveClient (dummy=0x604e70)
at
/export/scratch0/alink/workspace/MonetDB-installer/MonetDB-Feb2010/MonetDB5/src/mal/mal_session.mx:474
#13 0x00000039f6e06a3a in start_thread () from /lib64/libpthread.so.0
#14 0x00000039f62de67d in clone () from /lib64/libc.so.6
#15 0x0000000000000000 in ?? ()
(gdb) p h->base
$1 = 0x7f4980631008 "\260\257"
(gdb) p pos
$2 = 303315
(gdb) p v
$3 = (str) 0x7f49740220a0 "wherea"
(gdb)
----------------------------------------------------------------------
>Comment By: Wouter Alink (vzzzbx)
Date: 2010-02-08 13:38
Message:
added script and data to reproduce (seems to fail every time, but that
might be timing related, because when running it from java environment the
same script sometimes doesn't crash mserver)
$ sh doCrash.sh
stopping database 'testbug'... FAILED
stop: database is not running: testbug
destroyed database: testbug
created database in maintenance mode: testbug
taken database out of maintenance mode: testbug
starting database 'testbug'... done
MAPI = mone...@localhost:51234
ACTION= read_line
QUERY = START TRANSACTION;
CREATE TABLE "sys"."temp_27_TERM" (
"termid" int NOT NULL,
"term" varchar(1000),
"prob" double,
CONSTRAINT "temp_27_TERM_termid_pkey" PRIMARY KEY ("termid")
);
COPY 2222 RECORDS INTO "sys"."temp_27_TERM" FROM stdin USING
DELIMITERS '\t','\n','"';
0 "#STOPWORD#" 1
1 "a" 1
2 "about" 1
3 "above" 1
4 "across" 1
5 "after" 1
6 "again" 1
7 "against" 1
8 "all" 1
9 "almost" 1
10 "alone" 1
11 "along" 1
12 "already" 1
13 "also" 1
14 "although" 1
15 "always" 1
16 "among" 1
17 "an" 1
ERROR = !Connection terminated
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2947763&group_id=56967
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs