Line 1034: Char 9: runtime error: reference binding to misaligned address 0xbebebebebebebebe for type ‘int’, which requires 4 byte alignment (stl_vector.h) 0xbebebebebebebebe: note: pointer points here SUMMARY: UndefinedBehavior
翻译:
第1034行:字符9:运行时错误:引用绑定到类型“int”的未对齐地址0xbebebebebebebebe,它需要4字节对齐(stl_vector.h)
0xbebebebebebebebe:注意:指针指向此处
错误原因:数组越界。比如当二维数组为空时,访问matrix[0].size()就会发生报错。
Line 23: Char 13: runtime error: index 50 out of bounds for type ‘std::string [10]’ (solution.cpp)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:32:13
错误原因:数组越界,‘2’对应的ASCII是20,在访问之前应该线转换成整型, -‘0’
runtime error: addition of unsigned offset to 0x602000000130 overflowed to 0x60200000012c (stl_vector.h)
向0x602000000130添加无符号偏移量溢出到0x60200000012c(stl_vector.h)意思是,vector下标出现了小于0的数字
AddressSanitizer:DEADLYSIGNAL
原因是进入了无限循环,比如在写并查集findfather的时候father[x] = findfather(father[x]) 写成了father[x] = findfather(x)
AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on 0x603000000460
原因是申请和释放不匹配:把new free改成 new delete