Closed morgando closed 5 months ago
dbtable passed to sc_del_unused_files
has a completely uninitialized handle:
(gdb) p *(s->db->handle)
$5 = {pthread_attr_detach = {__size = '\377' <repeats 56 times>, __align = -1}, seqnum_info = 0xffffffffffffffff,
attr = 0xffffffffffffffff, callback = 0xffffffffffffffff, dbenv = 0xffffffffffffffff, read_write = -1, repinfo = 0xffffffffffffffff,
numdtafiles = -1 '\377', dbp_data = {{0xffffffffffffffff <repeats 16 times>} <repeats 16 times>}, dbp_ix = {
0xffffffffffffffff <repeats 50 times>}, tid_key = 4294967295, numthreads = -1, numthreads_lock = {__data = {__lock = -1,
__count = 4294967295, __owner = -1, __nusers = 4294967295, __kind = -1, __spins = -1, __elision = -1, __list = {
__prev = 0xffffffffffffffff, __next = 0xffffffffffffffff}}, __size = '\377' <repeats 40 times>, __align = -1},
name = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>,
txndir = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>,
tmpdir = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>,
dir = 0xffffffffffffffff <error: Cannot access memory at address 0xffffffffffffffff>, lrl = -1, numix = -1, ixlen = {
-1 <repeats 50 times>}, ixdta = '\377' <repeats 50 times>, ixdtalen = {-1 <repeats 50 times>}, ixcollattr = '\377' <repeats 50 times>,
ixnulls = '\377' <repeats 50 times>, ixdups = '\377' <repeats 50 times>, ixrecnum = '\377' <repeats 50 times>, keymaxsz = -1,
checkpoint_thread = 18446744073709551615, watcher_thread = 18446744073709551615, memp_trickle_thread = 18446744073709551615,
logdelete_thread = 18446744073709551615, lock_detect_thread = 18446744073709551615, coherency_lease_thread = 18446744073709551615,
master_lease_thread = 18446744073709551615, parent = 0xffffffffffffffff, numchildren = -1, children = {
0xffffffffffffffff <repeats 3078 times>}, bdb_lock = 0xffffffffffffffff, bdb_lock_desired = -1 '\377', usr_ptr = 0xffffffffffffffff,
bdb_lock_write_holder = 18446744073709551615, bdb_lock_write_holder_ptr = 0xffffffffffffffff,
bdb_lock_write_idstr = '\377' <repeats 80 times>, seed = -1, last_genid_epoch = 4294967295, seed_lock = {__data = {__lock = -1,
__count = 4294967295, __owner = -1, __nusers = 4294967295, __kind = -1, __spins = -1, __elision = -1, __list = {
__prev = 0xffffffffffffffff, __next = 0xffffffffffffffff}}, __size = '\377' <repeats 40 times>, __align = -1}, bdbtype = -1,
...
Crash occurs when the attr
attribute is accessed.
Error prior to crash:
2024/05/09 18:24:36 [ERROR] >>> SCHEMA CHANGE ERROR: TABLE t, RC 12
2024/05/09 18:24:36 sc_set_running(table=t running=0): from bplog_schemachange:1314 rc=0
2024/05/09 18:24:36 >>> DDL SCHEMA CHANGE RC 240 <<<
backout_schema_changes iq 0x5612fc013b28 clone
2024/05/09 18:24:36 [ERROR] change_schemas_recover: invalid table t
2024/05/09 18:24:36 Old file deletion in progress("schemachange")
2024/05/09 18:24:36 sc_del_unused_files_tran: errors listing old files
Describe the bug The database segfaults when it accesses
bdb_state->attr
, which is not set to a valid address.This is the crash backtrace, for reference:
To Reproduce Run the schemalk test in clustered mode on a loop.