[issue1597] panic: assertion: parent != NULL in hammer_cursor_removed_node (v2.5.1.187.gc1543-DEV, X86_64)

Antonio Huete Jimenez ahuete.devel at gmail.com
Thu Nov 12 03:49:26 PST 2009


Hi all,

This is the patch I applied:

diff --git a/sys/vfs/hammer/hammer_btree.c b/sys/vfs/hammer/hammer_btree.c
index 6ee1e1a..7b65610 100644
--- a/sys/vfs/hammer/hammer_btree.c
+++ b/sys/vfs/hammer/hammer_btree.c
@@ -2226,9 +2226,10 @@ btree_remove(hammer_cursor_t cursor)
                       hammer_cursor_deleted_element(cursor->node, 0);
                       error = btree_remove(cursor);
                       if (error == 0) {
+                               KKASSERT(node != cursor->node);
                               hammer_cursor_removed_node(
-                                       node, cursor->parent,
-                                       cursor->parent_index);
+                                      node, cursor->parent,
+                                      cursor->parent_index);
                               hammer_modify_node_all(cursor->trans, node);
                               ondisk = node->ondisk;
                               ondisk->type = HAMMER_BTREE_TYPE_DELETED;

See below for more details. Kernel core dump on
http://leaf.dragonflybsd.org/~tuxillo/bugs/1597/

Unread portion of the kernel message buffer:
panic: assertion: parent != NULL in hammer_cursor_removed_node
Trace beginning at frame 0xccf6a68c
panic(ccf6a6b0,0,0,ccf9d238,ccf6a6c8) at panic+0x8c
panic(c057dc43,c059c7ab,c05693b3,1f,0) at panic+0x8c
hammer_cursor_removed_node(ccf9d238,0,0,ccf6a818,ccf9df58) at
hammer_cursor_removed_node+0x27
btree_remove(ccf9d238,0,ccf6a818,c1b07000,0) at btree_remove+0x14d
btree_remove(0,0,c1b07040,c16bf898,ccf6a7b0) at btree_remove+0x115
hammer_btree_delete(ccf6a818) at hammer_btree_delete+0x1ab
hammer_delete_at_cursor(ccf6a818,2,0,0,4afbe918) at
hammer_delete_at_cursor+0x327
hammer_ioc_prune(ccf6aa74,c9c1d450,c16bf800,4,ccf6a956) at
hammer_ioc_prune+0x4c1
hammer_ioctl(c9c1d450,c0fc6801,c16bf800,1,c15876f8) at hammer_ioctl+0x1b8
hammer_vop_ioctl(ccf6aad0,c0649260,c16d1eb0,ccf6ab00,c032a999) at
hammer_vop_ioctl+0x2f
vop_ioctl(c16d1eb0,c16f5128,c0fc6801,c16bf800,1) at vop_ioctl+0x3e
vn_ioctl(c8eadcf8,c0fc6801,c16bf800,c15876f8,ccf6acf0) at vn_ioctl+0xe0
mapped_ioctl(3,c0fc6801,280b0188,0,ccf6acf0) at mapped_ioctl+0x3e7
sys_ioctl(ccf6acf0,6,9574,0,c9b8e898) at sys_ioctl+0x17
syscall2(ccf6ad40) at syscall2+0x1ef
Xint0x80_syscall() at Xint0x80_syscall+0x36
Debugger("panic")
Uptime: 5m2s

dumping to dev ad0s1b, blockno 262144
dump 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241
240 239 238 237 236 235 234 233 232 231 230 22
                                     9 228 227 226 225 224 223 222 221
220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204
203 202 201 2
    00 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184
183 182 181 180 179 178 177 176 175 174 173 172
                                       171 170 169 168 167 166 165 164
163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147
146 145 144 143
       142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127
126 125 124 123 122 121 120 119 118 117 116 115 11
                                         4 113 112 111 110 109 108 107
106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86
85 84 83 82 81
      80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60
59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 4
                                           2 41 40 39 38 37 36 35 34
33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11
10 9 8 7 6 5 4 3 2 1

And the backtrace from KGDB:

(kgdb) bt
#0  _get_mycpu () at ./machine/thread.h:83
#1  dumpsys () at /build/home/tuxillo/dfbsd/sys/kern/kern_shutdown.c:657
#2  0xc031e0a2 in boot (howto=260) at
/build/home/tuxillo/dfbsd/sys/kern/kern_shutdown.c:378
#3  0xc031e1c3 in panic (fmt=0xc057dc43 "assertion: %s in %s")
    at /build/home/tuxillo/dfbsd/sys/kern/kern_shutdown.c:813
#4  0xc048aa26 in hammer_cursor_removed_node (node=0xccf9d238,
parent=0x0, index=0)
    at /build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_cursor.c:722
#5  0xc04885bf in btree_remove (cursor=0xccf6a818) at
/build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_btree.c:2230
#6  0xc0488587 in btree_remove (cursor=0xccf6a818) at
/build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_btree.c:2227
#7  0xc048899b in hammer_btree_delete (cursor=0xccf6a818)
    at /build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_btree.c:896
#8  0xc049809e in hammer_delete_at_cursor (cursor=0xccf6a818,
delete_flags=<value optimized out>, delete_tid=0,
    delete_ts=1258023192, track=0, stat_bytes=0xc16bf8b0)
    at /build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_object.c:2488
#9  0xc049d209 in hammer_ioc_prune (trans=0xccf6aa74, ip=0xc9c1d450,
prune=0xc16bf800)
    at /build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_prune.c:184
#10 0xc0493894 in hammer_ioctl (ip=0xc9c1d450, com=3237767169,
data=0xc16bf800 "\001", fflag=1, cred=0xc15876f8)
    at /build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_ioctl.c:76
#11 0xc04a5181 in hammer_vop_ioctl (ap=0xccf6aad0) at
/build/home/tuxillo/dfbsd/sys/vfs/hammer/hammer_vnops.c:2304
#12 0xc0375bd1 in vop_ioctl (ops=0xc16d1eb0, vp=0xc16f5128,
command=3237767169, data=0xc16bf800 "\001", fflag=1,
    cred=0xc15876f8, msg=0xccf6acf0) at
/build/home/tuxillo/dfbsd/sys/kern/vfs_vopops.c:389
#13 0xc03756f5 in vn_ioctl (fp=0xc8eadcf8, com=3237767169,
data=0xc16bf800 "\001", ucred=0xc15876f8,
    msg=0xccf6acf0) at /build/home/tuxillo/dfbsd/sys/kern/vfs_vnops.c:938
#14 0xc033e8af in fo_ioctl (fd=3, com=3237767169, uspc_data=0x280b0188
<Address 0x280b0188 out of bounds>,
    map=0x0, msg=0xccf6acf0) at /build/home/tuxillo/dfbsd/sys/sys/file2. h:88
#15 mapped_ioctl (fd=3, com=3237767169, uspc_data=0x280b0188 <Address
0x280b0188 out of bounds>, map=0x0,
    msg=0xccf6acf0) at /build/home/tuxillo/dfbsd/sys/kern/sys_generic.c:697
#16 0xc033e938 in sys_ioctl (uap=0xccf6acf0) at
/build/home/tuxillo/dfbsd/sys/kern/sys_generic.c:521
#17 0xc0530dd3 in syscall2 (frame=0xccf6ad40) at
/build/home/tuxillo/dfbsd/sys/platform/pc32/i386/trap.c:1339
#18 0xc05212a6 in Xint0x80_syscall () at
/build/home/tuxillo/dfbsd/sys/platform/pc32/i386/exception.s:876
#19 0xccf6ad40 in ?? ()
#20 0x0000007b in ?? ()
#21 0x0000002f in ?? ()
#22 0x0000002f in ?? ()
#23 0x0000002f in ?? ()
#24 0x280b0080 in ?? ()

Please let me know if you need me to test anything else.

Cheers,
Antonio Huete





More information about the Bugs mailing list