Breakpoint 4, camel_key_table_set_flags (ki=0xa24e274, keyid=7168, flags=1,
    set=1) at camel-partition-table.c:824
824             if (keyid == 0)
(gdb) print keyid
$2 = 7168
(gdb) step
828             index = keyid & (CAMEL_BLOCK_SIZE-1);
(gdb) step
830             bl = camel_block_file_get_block(ki->blocks, blockid);
(gdb) print index
$3 = 0
(gdb) step
camel_block_file_get_block (bs=0xa227f34, id=7168) at camel-block-file.c:539
539             if ((bs->root == NULL && id != 0)
(gdb) print bs->root
$5 = (CamelBlockRoot *) 0xa29d268
(gdb) step
546             CAMEL_BLOCK_FILE_LOCK(bs, cache_lock);
(gdb) step
548             bl = g_hash_table_lookup(bs->blocks, GUINT_TO_POINTER(id));
(gdb) next
552             if (bl == NULL) {
(gdb) print bl
$6 = (CamelBlock *) 0x0
(gdb) next
554                     if (block_file_use(bs) == -1) {
(gdb) step
block_file_use (bs=0xa227f34) at camel-block-file.c:260
260             struct _CamelBlockFilePrivate *nw, *nn, *p = bs->priv;
(gdb) step
273             CAMEL_BLOCK_FILE_LOCK(bs, io_lock);
(gdb) step
275             if (bs->fd != -1)
(gdb) print bs->fd
$7 = -1
(gdb) step
277             else if (p->deleted) {
(gdb) print p->deleted
$8 = 0
(gdb) step
284             if ((bs->fd = open(bs->path, bs->flags, 0600)) == -1) {
(gdb) next
291             LOCK(block_file_lock);
(gdb) print bs->fd
$9 = 29
(gdb) step
292             e_dlist_remove((EDListNode *)p);
(gdb) step
e_dlist_remove (n=0xa1ed538) at e-msgport.c:75
75              n->next->prev = n->prev;
(gdb) print n->prev
$10 = (struct _EDListNode *) 0xa1e3bc0
(gdb) step
76              n->prev->next = n->next;
(gdb) print n->next
$11 = (struct _EDListNode *) 0xa27f148
(gdb) step
78      }
(gdb) step
block_file_use (bs=0xa227f34) at camel-block-file.c:293
293             e_dlist_addtail(&block_file_active_list, (EDListNode *)p);
(gdb) step
e_dlist_addtail (l=0x503db4, n=0xa1ed538) at e-msgport.c:66
66              n->next = (EDListNode *)&l->tail;
(gdb) print (EDListNode *)&l->tail
$12 = (struct _EDListNode *) 0x503db8
(gdb) step
67              n->prev = l->tailpred;
(gdb) print l->tailpred
$13 = (struct _EDListNode *) 0x503db4
(gdb) step
68              l->tailpred->next = n;
(gdb) print n
$14 = (EDListNode *) 0xa1ed538
(gdb) step
69              l->tailpred = n;
(gdb) step
71      }
(gdb) step
block_file_use (bs=0xa227f34) at camel-block-file.c:295
295             block_file_count++;
(gdb) print block_file_count
$15 = 9
(gdb) step
297             nw = (struct _CamelBlockFilePrivate *)block_file_list.head;
(gdb) step
298             nn = nw->next;
(gdb) step
299             while (block_file_count > block_file_threshhold && nn) {
(gdb) step
324             UNLOCK(block_file_lock);
(gdb) step
327     }
(gdb) step
camel_block_file_get_block (bs=0xa227f34, id=7168) at camel-block-file.c:559
559                     bl = g_malloc0(sizeof(*bl));
(gdb) next
560                     bl->id = id;
(gdb) print id
$16 = 7168
(gdb) next
561                     if (lseek(bs->fd, id, SEEK_SET) == -1 ||
(gdb) next
569                     bs->block_cache_count++;
(gdb) print bs->block_cache_count
$17 = 6
(gdb) next
570                     g_hash_table_insert(bs->blocks, GUINT_TO_POINTER(bl->id), bl);
(gdb) next
573                     flush = (CamelBlock *)bs->block_cache.tailpred;
(gdb) next
574                     prev = flush->prev;
(gdb) next
575                     while (bs->block_cache_count > bs->block_cache_limit && prev) {
(gdb) next
588                     block_file_unuse(bs);
(gdb) next
593             e_dlist_addhead(&bs->block_cache, (EDListNode *)bl);
(gdb) next
594             bl->refcount++;
(gdb) next
596             CAMEL_BLOCK_FILE_UNLOCK(bs, cache_lock);
(gdb) print bl->refcount
$19 = 1
(gdb) next
601     }
(gdb) next
camel_key_table_set_flags (ki=0xa24e274, keyid=7168, flags=1, set=1)
    at camel-partition-table.c:831
831             if (bl == NULL)
(gdb) print bl
$20 = (CamelBlock *) 0xa50a190
(gdb) next
833             kb = (CamelKeyBlock *)&bl->data;
(gdb) next
835             g_assert(kb->used < 127);
(gdb) print kb
$21 = (CamelKeyBlock *) 0xa50a1a8
(gdb) print kb->used
$22 = 0
(gdb) next
836             g_assert(index < kb->used);
(gdb) print index
$23 = 0
(gdb) next

camel-ERROR **: file camel-partition-table.c: line 836 (camel_key_table_set_flags): assertion failed: (index < kb->used)
aborting...

Program received signal SIGABRT, Aborted.
0x00156402 in __kernel_vsyscall ()
(gdb)

