(Illustration by Gaich Muramatsu)
In working with trying to put private mapping in RVM, I have run up against the following problem. rvm_basher aborts with an assert error: (length >= 0) && (length < SECTOR_SIZE) assert failure at rvm-src/rvm/rvm_logflush.c, line=92 Here is a gdb session where I looked at some of the offending data. This appears to happen with both anonymous and private mappings. (NetBSD 1.4.1) Any chance one of you can easily spot the problem? Script started on Tue Nov 30 09:30:31 1999 ---->~/wd0e/Coda/trees/coda/obj.1.4/rvm-src/tests nooksack[1]$ gdb rvm_basher GNU gdb 4.17 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386--netbsd"... (gdb) attach 27812 Attaching to program `/wd0e/phil/Coda/trees/coda/obj.1.4/rvm-src/tests/rvm_basher', process 27812 Reading symbols from /usr/libexec/ld.so...done. Reading symbols from /usr/lib/libc.so.12.40...done. 0x40074123 in nanosleep () (gdb) where #0 0x40074123 in nanosleep () #1 0x400740f9 in sleep () #2 0x1b623 in coda_assert ( pred=0xcdc9 "(length >= 0) && (length < SECTOR_SIZE)", file=0xcda5 "../../../rvm-src/rvm/rvm_logflush.c", line=92) at ../../../lib-src/base/coda_assert.c:45 #3 0xce2c in make_pad_buf (dev=0x3f01c, length=608768) at ../../../rvm-src/rvm/rvm_logflush.c:92 #4 0xcf39 in write_log_wrap (log=0x3f000) at ../../../rvm-src/rvm/rvm_logflush.c:126 #5 0xd660 in write_tid (tid=0x37c00) at ../../../rvm-src/rvm/rvm_logflush.c:358 #6 0xd903 in log_tid (log=0x3f000, tid=0x37c00) at ../../../rvm-src/rvm/rvm_logflush.c:454 #7 0xdc6b in flush_log (log=0x3f000, count=0x3f124) at ../../../rvm-src/rvm/rvm_logflush.c:623 #8 0xabd6 in queue_tid (tid=0x39000) at ../../../rvm-src/rvm/rvm_trans.c:894 #9 0xae0a in rvm_end_transaction (rvm_tid=0xefbfd5dc, mode=flush) at ../../../rvm-src/rvm/rvm_trans.c:999 #10 0x23ca in do_trans (block=0x11ac40, range_list=0xefbfd624, do_flush=rvm_true, id=0) at ../../../rvm-src/tests/rvm_basher.c:667 #11 0x24cf in do_modify (id=0) at ../../../rvm-src/tests/rvm_basher.c:705 #12 0x32bb in worker (id=0) at ../../../rvm-src/tests/rvm_basher.c:1091 #13 0x55a1 in main (argc=2, argv=0xefbfd71c) at ../../../rvm-src/tests/rvm_basher.c:2043 (gdb) up #1 0x400740f9 in sleep () (gdb) up #2 0x1b623 in coda_assert ( pred=0xcdc9 "(length >= 0) && (length < SECTOR_SIZE)", file=0xcda5 "../../../rvm-src/rvm/rvm_logflush.c", line=92) at ../../../lib-src/base/coda_assert.c:45 45 sleep(1); (gdb) up #3 0xce2c in make_pad_buf (dev=0x3f01c, length=608768) at ../../../rvm-src/rvm/rvm_logflush.c:92 92 CODA_ASSERT((length >= 0) && (length < SECTOR_SIZE)); (gdb) list 87 static void make_pad_buf(dev,length) 88 device_t *dev; /* device descriptor */ 89 long length; /* entries needed */ 90 { 91 92 CODA_ASSERT((length >= 0) && (length < SECTOR_SIZE)); 93 94 /* see if must reallocate */ 95 if (length > dev->pad_buf_len) 96 { (gdb) print length $1 = 608768 (gdb) up #4 0xcf39 in write_log_wrap (log=0x3f000) at ../../../rvm-src/rvm/rvm_logflush.c:126 126 make_pad_buf(dev,RVM_OFFSET_TO_LENGTH(pad_len)); (gdb) list 121 122 /* pad last sector with all 1's to kill previous wrap mark */ 123 pad_len = RVM_ADD_LENGTH_TO_OFFSET(log->status.log_tail, 124 dev->io_length); 125 pad_len = RVM_SUB_OFFSETS(dev->num_bytes,pad_len); 126 make_pad_buf(dev,RVM_OFFSET_TO_LENGTH(pad_len)); 127 dev->iov[dev->iov_cnt].vmaddr = dev->pad_buf; 128 dev->iov[dev->iov_cnt++].length = RVM_OFFSET_TO_LENGTH(pad_len); 129 dev->io_length += RVM_OFFSET_TO_LENGTH(pad_len); 130 (gdb) print pad_len $2 = {high = 0, low = 608768} (gdb) print log->status.log_tail $3 = {high = 0, low = 5980} (gdb) print dev->io_length $4 = 1188 (gdb) print dev->num_bytes $5 = {high = 0, low = 615936} (gdb) print *log $6 = {links = {nextentry = 0x22340, preventry = 0x22340, list = { name = 0x22340, length = 140096}, struct_id = log_id, is_hdr = rvm_false}, ref_cnt = 1, dev_lock = {x = 1}, dev = { name = 0x3e300 "/wd0e/phil/Coda/trees/coda/obj.1.4/rvm-src/tests/basher_log", name_len = 60, handle = 4, num_bytes = {high = 0, low = 615936}, raw_io = rvm_false, type = 32768, read_only = rvm_false, iov = 0x99000, iov_len = 190, iov_cnt = 5, io_length = 1188, last_position = {high = 0, low = 5980}, wrt_buf = 0x0, wrt_buf_len = 0, ptr = 0x0, buf_start = 0x0, buf_end = 0x0, sync_offset = {high = 0, low = 1536}, pad_buf = 0x3c100 'ÿ' <repeats 92 times>, "\001", pad_buf_len = 92}, status = {update_cnt = 98, valid = rvm_true, log_empty = rvm_false, log_start = {high = 0, low = 1536}, log_size = {high = 0, low = 614400}, log_head = {high = 0, low = 7348}, log_tail = {high = 0, low = 5980}, prev_log_head = {high = 0, low = 0}, prev_log_tail = {high = 0, low = 0}, status_init = {tv_sec = 943905438, tv_usec = 735146}, status_write = { tv_sec = 943982541, tv_usec = 896684}, last_trunc = {tv_sec = 943982540, tv_usec = 758979}, prev_trunc = {tv_sec = 943982540, tv_usec = 758979}, first_write = {tv_sec = 943982540, tv_usec = 758982}, last_write = { tv_sec = 943982541, tv_usec = 913870}, first_uname = { tv_sec = 943982540, tv_usec = 744859}, last_uname = {tv_sec = 943982541, tv_usec = 896686}, last_commit = {tv_sec = 943982541, tv_usec = 920584}, wrap_time = {tv_sec = 0, tv_usec = 0}, first_rec_num = 551048, last_rec_num = 0, next_rec_num = 551117, n_abort = 26, n_flush_commit = 66, n_no_flush_commit = 378, n_split = 2, n_truncation_wait = 1, n_flush = 64, n_rvm_flush = 0, n_special = 1, range_overlap = {high = 0, low = 819851}, trans_overlap = {high = 0, low = 468539}, n_range_elim = 12720, n_trans_elim = 3387, n_trans_coalesced = 461, flush_time = {tv_sec = 0, tv_usec = 850168}, last_flush_time = 5, last_truncation_time = 0, last_tree_build_time = 0, last_tree_apply_time = 0, flush_times = {63, 0, 0, 0, 1, 0, 0, 0, 0, 0}, range_lengths = {0, 52, 210, 131, 68, 105, 121, 176, 96, 62, 40, 36, 37}, range_elims = {0, 2, 0, 7, 17, 38}, trans_elims = {8, 10, 2, 20, 12, 12}, range_overlaps = {0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 1, 6, 52}, trans_overlaps = {8, 0, 0, 0, 0, 2, 1, 2, 4, 2, 5, 9, 31}, tot_abort = 13702, tot_flush_commit = 187014, tot_no_flush_commit = 123333074, tot_split = 87668, tot_flush = 350752, tot_rvm_flush = 0, tot_special = 176598, tot_wrap = 87777, log_dev_max = 99, tot_log_written = {high = 12, low = 2480790428}, tot_range_overlap = {high = 0, low = 2584733985}, tot_trans_overlap = { high = 46, low = 3879526425}, tot_range_elim = 294671442, tot_trans_elim = 455730399, tot_trans_coalesced = 123421009, tot_rvm_truncate = 163985, tot_async_truncation = 0, tot_sync_truncation = 12607, tot_truncation_wait = 12602, tot_recovery = 9, tot_flush_time = {tv_sec = 18454, tv_usec = 546025}, tot_truncation_time = {tv_sec = 30982, tv_usec = 176335}, tot_tree_build_times = {176609, 1, 0, 0, 0}, tot_tree_apply_times = { 176598, 12, 0, 0, 0}, tot_truncation_times = {176591, 19, 0, 0, 0}, tot_flush_times = {199179, 16518, 68040, 54323, 11874, 790, 19, 1, 0, 0}, tot_range_lengths = {0, 680702, 146993, 180016, 34951, 132097, 62253, 104199, 130372, 179190, 99740, 568574, 1580571}, tot_range_elims = { 94382, 488, 364, 2775, 3693, 97239}, tot_trans_elims = {97851, 2665, 1533, 7544, 3993, 85355}, tot_range_overlaps = {94383, 29, 7, 13, 27, 61, 135, 227, 361, 597, 1183, 2284, 99634}, tot_trans_overlaps = {97851, 4, 2, 4, 16, 990, 347, 358, 506, 1172, 2180, 3360, 92151}, ---Type <return> to continue, or q <return> to quit--- tot_trans_coalesces = {97786, 7146, 6132, 5954, 24, 81963}, flush_state = 0, trunc_state = 0}, trans_hdr = {struct_id = trans_hdr_id, rec_length = 1136, timestamp = {tv_sec = 943982541, tv_usec = 920585}, rec_num = 551115, num_ranges = 1, uname = {tv_sec = 943982541, tv_usec = 913871}, commit_stamp = {tv_sec = 943982541, tv_usec = 920584}, n_coalesced = 2, flags = 83}, rec_end = { struct_id = rec_end_id, rec_length = 1136, timestamp = { tv_sec = 943982541, tv_usec = 920585}, rec_num = 551115, rec_type = trans_hdr_id, sub_rec_len = 1088}, log_wrap = { struct_id = log_wrap_id, rec_length = 24, timestamp = {tv_sec = 943982541, tv_usec = 920586}, rec_num = 551116, struct_id2 = log_wrap_id}, log_buf = {buf = 0x400b0000 "", shadow_buf = 0x0, length = 262144, buf_len = {high = 0, low = 262144}, r_length = 227328, offset = {high = 0, low = 274944}, ptr = 19536, timestamp = {tv_sec = 943982539, tv_usec = 859200}, aux_buf = 0x400f0000 '$' <repeats 16 times>, 'H' <repeats 55 times>, aux_length = 131072, aux_offset = {high = 0, low = 96256}, aux_rlength = 4096, prev_timestamp = {tv_sec = 943982539, tv_usec = 859200}, prev_rec_num = 550984, prev_direction = rvm_false, split_ok = rvm_true}, tid_list_lock = {x = 0}, tid_list = { nextentry = 0x3f4d0, preventry = 0x3f4d0, list = {name = 0x0, length = 0}, struct_id = int_tid_id, is_hdr = rvm_true}, flush_list_lock = {x = 0}, flush_list = {nextentry = 0x37c00, preventry = 0x37c00, list = {name = 0x1, length = 1}, struct_id = int_tid_id, is_hdr = rvm_true}, special_list_lock = {x = 0}, special_list = {nextentry = 0x3f500, preventry = 0x3f500, list = {name = 0x0, length = 0}, struct_id = log_special_id, is_hdr = rvm_true}, flush_lock = {mutex = { x = 0}, read_cnt = 0, write_cnt = 1, queue = {nextentry = 0x3f520, preventry = 0x3f520, list = {name = 0x0, length = 0}, struct_id = rw_qentry_id, is_hdr = rvm_true}, lock_mode = w}, daemon = { thread = 0, lock = {x = 0}, code = {x = 0}, flush_flag = {x = 0}, wake_up = {x = 0}, state = rvm_idle, truncate = 0}, truncation_lock = { x = 0}, trunc_thread = 0, in_recovery = rvm_false, seg_dict_vec = 0x40600, seg_dict_len = 1, cur_seg_dev = 0x40018} (gdb) quit The program is running. Quit anyway (and detach it)? (y or n) y Detaching from program: /wd0e/phil/Coda/trees/coda/obj.1.4/rvm-src/tests/rvm_basher process 27812 ---->~/wd0e/Coda/trees/coda/obj.1.4/rvm-src/tests nooksack[2]$ exit exit Script done on Tue Nov 30 09:36:55 1999 ------- End of forwarded message ------- -- Phil Nelson NetBSD: http://www.netbsd.org e-mail: phil@cs.wwu.edu Coda: http://www.coda.cs.cmu.edu http://www.cs.wwu.edu/~philReceived on 1999-11-30 12:54:13