Tag: ubsan

未定义的引用`__ubsan_handle_nonnull_arg’

我一直在研究问题集拼写器的最后几天,到目前为止这就是我所拥有的。 不幸的是,它没有编译,我有点迷失。 如果有人可以帮助我告诉我,我做错了什么,我将非常感激。 // Implements a dictionary’s functionality #include #include #include #include #include #include “dictionary.h” #define HASHTABLE_SIZE 65536 // A struct for a node typedef struct node { // Length is up to 45 + 1 for the Null char word[LENGTH + 1]; // A pointer to the next node struct node *next; } node; […]

如何在gdb中打破UBSan报告并继续?

最新版本的GCC和Clang具有Undefined Behavior Sanitizer(UBSan),它是一个编译标志( -fsanitize=undefined ),用于添加运行时检测代码。 出现错误时,会显示如下警告: packet-ber.c:1917:23:运行时错误:左移54645397829836991 8个位置无法在类型’long int’中表示 现在我想调试这个并在所述行上获得调试中断。 对于Address Sanitizer(ASAN), ASAN_OPTIONS=abort_on_error=1会导致可捕获的致命错误。 唯一可用的UBSan选项是UBSAN_OPTIONS=print_stacktrace=1 ,这会导致报告的调用跟踪转储。 但是,这不允许我检查局部变量,然后继续该程序。 因此无法使用-fsanitize-undefined-trap-on-error 。 我应该如何在UBSan报告中打破gdb? 虽然break __sanitizer::SharedPrintfCode似乎有效但名称看起来很内部。