Hi!
I got a crash while dropping index:
#include <assert.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <string.h>
|
|
#include <wiredtiger.h>
|
|
#define WT_HOME "drop_index.db"
|
|
#define WT_CALL(call) \
|
do { \
|
const int __rc = call; \
|
if (__rc != 0) { \
|
fprintf(stderr, # call " at (%s:%d) failed: %s [%d]\n", __FILE__, __LINE__, wiredtiger_strerror(__rc), __rc); \
|
exit(EXIT_FAILURE); \
|
} \
|
} while (0)
|
|
int
|
main(void)
|
{
|
WT_CONNECTION *conn;
|
WT_SESSION *session;
|
|
assert(system("rm -rf \"" WT_HOME "\" && mkdir \"" WT_HOME "\"") == 0);
|
|
WT_CALL(wiredtiger_open(WT_HOME, NULL, "create", &conn));
|
WT_CALL(conn->open_session(conn, NULL, NULL, &session));
|
|
WT_CALL(session->create(session, "table:main", "columns=(k,v)"));
|
WT_CALL(session->create(session, "index:main:index", "columns=(v)"));
|
|
WT_CALL(conn->close(conn, NULL));
|
|
/* Re-open and try to drop index */
|
WT_CALL(wiredtiger_open(WT_HOME, NULL, NULL, &conn));
|
WT_CALL(conn->open_session(conn, NULL, NULL, &session));
|
|
WT_CALL(session->drop(session, "index:main:index", NULL));
|
|
WT_CALL(conn->close(conn, NULL));
|
|
return 0;
|
}
|
GDB session
Program received signal SIGSEGV, Segmentation fault.
|
0x00007ffff7dba7a1 in __drop_index (cfg=0x7fffffffd440, force=<optimized out>, uri=0x400e4f "index:main:index", session=0x6052b0) at src/schema/schema_drop.c:95
|
95 table->idx_complete = 0;
|
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.4.x86_64
|
(gdb) bt
|
#0 0x00007ffff7dba7a1 in __drop_index (cfg=0x7fffffffd440, force=<optimized out>, uri=0x400e4f "index:main:index", session=0x6052b0) at src/schema/schema_drop.c:95
|
WT-1 __wt_schema_drop (session=0x6052b0, uri=<optimized out>, cfg=0x7fffffffd440) at src/schema/schema_drop.c:177
|
WT-2 0x00007ffff7dc85e7 in __session_drop (wt_session=0x6052b0, uri=0x400e4f "index:main:index", config=<optimized out>) at src/session/session_api.c:530
|
WT-3 0x00000000004008e2 in main () at drop_index.c:39
|
(gdb) p table
|
$1 = (WT_TABLE *) 0x0
|
Looks like
function called from
doesn't set
pointer when index isn't opened yet.