[ 103.311961] The buggy address belongs to the object at ffff888000949d00 [ 103.311961] which belongs to the cache kmalloc-128 of size 128
从1开始计数,ffff888000949d64在这个区间的第100个byte地址处(0x49d64 - 0x49d00 = 100) [ 103.313130] The buggy address is located 100 bytes inside of [ 103.313130] 128-byte region [ffff888000949d00, ffff888000949d80) [ 103.314341]
[ 103.314742] The buggy address belongs to the physical page: [ 103.315549] page:00000000975ebcd3 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x949 [ 103.317102] flags: 0x200(slab|node=0|zone=0) [ 103.318836] raw: 0000000000000200 ffffea0000022240 dead000000000004 ffff8880048418c0 [ 103.319675] raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 [ 103.320536] page dumped because: kasan: bad access detected [ 103.321099] [ 103.321319] Memory state around the buggy address: [ 103.322273] ffff888000949c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 103.323105] ffff888000949c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
而我们代码1216行,通过for循环会访问到第5个字节,所以触发异常。 [ 103.323937] >ffff888000949d00: 00 00 00 00 00 00 00 00 00 00 00 00 04 fc fc fc [ 103.324687] ^ [ 103.325414] ffff888000949d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 103.326049] ffff888000949e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc [ 103.326727]
================================================================== [ 103.328184] Disabling lock debugging due to kernel taint [ 103.329028] do_sys_openat2 1218: kasan test finish
[ICPC2018 Qingdao R] Plants vs. Zombies
传送门
题面翻译
给定 n n n 个植物和 m m m 的步数限制,每个植物在位置 1 … n 1\dots n 1…n 上。你初始时在位置 0 0 0,每次可以移动到相邻的位置上。
每次设你走完一步后到达的位置是 i i i&#…
读取txt文件,将匹配条件的多列绘制成曲线展示:
import matplotlib.pyplot as plt
import re
from datetime import datetime
from pylab import mplmpl.rcParams["font.sans-serif"] ["SimHei"] # 设置显示中文字体
mpl.rcParam…