μ报告
μ报告 (microreport )是表示问题的JSON对象:二进制崩溃、内核操作、SELinux AVC拒绝。。。这些报告被设计成小的、机器可读的和完全匿名的,这使得我们可以使用它们进行自动报告。这些报告允许我们跟踪错误的发生,同时不一定为我们的工程师修复错误提供足够的信息。为此,您可能仍需要发送完整的错误报告。
报告究竟包含哪些内容?
在多线程C/C++和java程序的情况下,每个μ报告通常包含堆栈跟踪或多个堆栈跟踪。堆栈跟踪只描述崩溃时程序的调用堆栈,不包含任何变量的内容。
每个μ报告还包含操作系统的标识、与崩溃有关的RPM包的版本,以及程序是否在root用户下运行。
也有针对每个崩溃类型的特定项:对于C/C++崩溃,它们是:Python异常的可执行程序和传递到程序的信号,存在异常类型(没有错误消息,可能包含敏感数据)。对于内核OOPSE,这些是:加载的内核模块列表、污染标志列表;以及内核oops的全文
匿名
μ报告 不能 包含任何私有数据。μ报告被认为是公共的,可以通过webui或webapi访问,转发到其他实例或存档。客户需要考虑他们发送的数据。这些可能包含密码、信用卡号码、私钥等。
示例:为什么不包含来自python异常的消息?思考以下问题:
ValueError: invalid literal for int() with base 10: 'my_secret_password'
规范
对象包含一个数字字段 ureport_version ,它定义了预期的内容。如果缺少该字段,则该版本被视为0。
0及以前
由于快速发展,最初的报告根本没有版本控制。μReport0是其中最后一个的代码名(没有已知的客户端发送过 ureport_version = 0 ). 所有以前的报告都将无法解析。尽管μReport0仍受支持(可以转换为μReport1),但它已过时,不应在客户端应用程序中使用。
μ报告1
μRePr1格式是为满足ARBT(即处理C/C++崩溃、未处理的Python异常和KelnNoops)的需要而设计的。其背景思想是,所有报告都包含一个stacktrace和一些有关环境的元数据(操作系统版本、CPU体系结构、内核版本……)。只允许支持的字段。有些是强制性的,有些不是。任何包含过多字段或缺少强制字段的报告都将无法解析。
支持的字段
ureport_version(int) 必须设置为1为了被μReport1工作流解析和处理type(string) either ofuserspacepythonkerneloopsreason(string) 描述发生了什么的短消息uptime(int) 机器正常运行时间component(string) 受影响部件executable(string) 受影响的可执行文件architecture(string) CPU体系结构crash_thread(int) 崩溃线程的IDkernel_taint_state(string) 内核污染标志proc_status占位符proc_limits占位符oops(string) 写入syslog的原始内核操作user_type(string) either ofrootnologinlocalremoteinstalled_package(obj) 映射到适当的RPM属性name(string)epoch(int)version(string)release(string)architecture(string)
running_package(obj) same asinstalled_packagerelated_packages(list) 下列对象的列表:installed_package(obj) 等同于installed_package在上面running_package(obj) 等同于installed_package在上面
os(obj) 操作系统name(string)version(string)
reporter(obj) 客户端应用程序的标识name(string)version(string)
core_backtrace(list) 帧列表(以下对象):thread(int) 螺纹编号frame(int) 帧编号path(string) 关联文件buildid(string) 文件的内部版本idoffset(int) 文件内的偏移量funcname(string) 函数名funchash(string) 函数哈希
os`state(obj)suspend(string) eitheryesornoboot(string) eitheryesornologin(string) eitheryesornologout(string) eitheryesornoshutdown(string) eitheryesorno
selinux(obj)mode(string) either ofenforcingpermissivedisabledcontext(string) 受影响的环境policy`package(obj) same format asinstalled_package
例子::
{
"ureport_version": 1,
"type": "python",
"reason": "TypeError",
"uptime": 1,
"component": "faf",
"executable": "/usr/bin/faf-btserver-cgi",
"installed_package": { "name": "faf",
"version": "0.4",
"release": "1.fc16",
"epoch": 0,
"architecture": "noarch" },
"related_packages": [ { "installed_package": { "name": "python",
"version": "2.7.2",
"release": "4.fc16",
"epoch": 0,
"architecture": "x86_64" } } ],
"os": { "name": "Fedora", "version": "16" },
"architecture": "x86_64",
"reporter": { "name": "abrt", "version": "2.0.7-2.fc16" },
"crash_thread": 0,
"core_backtrace": [
{ "thread": 0,
"frame": 1,
"buildid": "f76f656ab6e1b558fc78d0496f1960071565b0aa",
"offset": 24,
"path": "/usr/bin/faf-btserver-cgi",
"funcname": "<module>" },
{ "thread": 0,
"frame": 2,
"buildid": "b07daccd370e885bf3d459984a4af09eb889360a",
"offset": 190,
"path": "/usr/lib64/python2.7/re.py",
"funcname": "compile" },
{ "thread": 0,
"frame": 3,
"buildid": "b07daccd370e885bf3d459984a4af09eb889360a",
"offset": 241,
"path": "/usr/lib64/python2.7/re.py",
"funcname": "_compile" }
],
"user_type": "root",
"selinux": { "mode": "permissive",
"context": "unconfined_u:unconfined_r:unconfined_t:s0",
"policy_package": { "name": "selinux-policy",
"version": "3.10.0",
"release": "2.fc16",
"epoch": 0,
"architecture": "noarch" } },
"kernel_taint_state": "G B "
}
问题
虽然μReport1被设计成独立于操作系统,但它与Fedora有着密切的关系。
新类型的问题正在出现,μReport1不够通用,无法处理差异(SELinux AVC denial不包含stacktrace,kerneloops不包含可执行文件…)
所有报告都以相同的方式处理。这要么导致代码中的特殊套管 (
if type != "python"等)或进入较低质量的结果(具有相同参数的聚类KelnOOPS和C/C++)不工作。
μ报告2
μReport2的格式来源于FAF项目新的可插入模型。它只包含一个公共元数据和 [操作系统插件] (https://github.com/abrt/faf/wiki/Operating-System-Plugins)以及 [问题插件] (https://github.com/abrt/faf/wiki/Problem-Plugins). 全局解析器只解析公共部分。 os 和 packages 由操作系统插件处理, problem 由问题插件处理。所有多余的字段都将被忽略。
支持的字段
ureport_version(int) 必须设置为2以便通过μReport2工作流进行解析和处理problem(obj) 问题,传递到问题插件type(string) 必须与name任何安装的问题插件别的
os(obj) 操作系统-传递到操作系统插件name(string) 必须匹配name任何已安装的操作系统插件version(string) 必须与存储中的版本匹配arch(string) CPU体系结构别的
packages(list) 受影响包的列表,“包”的性质由操作系统插件定义reason(string) 描述发生了什么的简短的(人类可读的)信息reporter(obj) 客户端应用程序的标识name(string)version(string)
C/C++崩溃实例:
{
"ureport_version": 2,
"reason": "Program /usr/bin/sleep was terminated by signal 11",
"os": {
"name": "fedora", # OS plugin
"version": "18",
"architecture": "x86_64"
},
"problem": {
"type": "core", # problem plugin
"executable": "/usr/bin/sleep",
"signal": 11,
"component": "coreutils",
"user": {
"local": true,
"root": false
},
"stacktrace": [
{
"crash_thread": true,
"frames": [
{
"build_id": "5f6632d75fd027f5b7b410787f3f06c6bf73eee6",
"build_id_offset": 767024,
"file_name": "/lib64/libc.so.6",
"address": 251315074096,
"fingerprint": "6c1eb9626919a2a5f6a4fc4c2edc9b21b33b7354",
"function_name": "__nanosleep"
},
{
"build_id": "cd379d3bb5d07c96d491712e41c34bcd06b2ce32",
"build_id_offset": 16567,
"file_name": "/usr/bin/sleep",
"address": 4210871,
"fingerprint": "d24433b82a2c751fc580f47154823e0bed641a54",
"function_name": "close_stdout"
},
{
"build_id": "cd379d3bb5d07c96d491712e41c34bcd06b2ce32",
"build_id_offset": 16202,
"file_name": "/usr/bin/sleep",
"address": 4210506,
"fingerprint": "562719fb960d1c4dbf30c04b3cff37c82acc3d2d",
"function_name": "close_stdout"
},
{
"build_id": "cd379d3bb5d07c96d491712e41c34bcd06b2ce32",
"build_id_offset": 6404,
"fingerprint": "2e8fb95adafe21d035b9bcb9993810fecf4be657",
"file_name": "/usr/bin/sleep",
"address": 4200708
},
{
"build_id": "5f6632d75fd027f5b7b410787f3f06c6bf73eee6",
"build_id_offset": 137733,
"file_name": "/lib64/libc.so.6",
"address": 251314444805,
"fingerprint": "075acda5d3230e115cf7c88597eaba416bdaa6bb",
"function_name": "__libc_start_main"
}
]
}
]
},
"packages": [
{
"name": "coreutils",
"epoch": 0,
"version": "8.17",
"architecture": "x86_64",
"package_role": "affected",
"release": "8.fc18",
"install_time": 1371464601
},
{
"name": "glibc",
"epoch": 0,
"version": "2.16",
"architecture": "x86_64",
"release": "31.fc18",
"install_time": 1371464176
},
{
"name": "glibc-common",
"epoch": 0,
"version": "2.16",
"architecture": "x86_64",
"release": "31.fc18",
"install_time": 1371464184
}
],
"reporter": {
"version": "0.3",
"name": "satyr"
}
}
Python异常示例:
{
"ureport_version": 2,
"reason": "ImportError in /usr/bin/faf:55",
"os": {
"name": "fedora", # OS plugin
"version": "18",
"architecture": "x86_64"
},
"problem": {
"type": "python", # problem plugin
"component": "faf",
"exception_name": "ImportError",
"user": {
"local": true,
"root": false
},
"stacktrace": [
{
"file_name": "/usr/lib64/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py",
"file_line": 312,
"line_contents": "psycopg = __import__('psycopg2')",
"function_name": "dbapi"
},
{
"file_name": "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/strategies.py",
"file_line": 64,
"line_contents": "dbapi = dialect_cls.dbapi(**dbapi_args)",
"function_name": "create"
},
{
"file_name": "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/__init__.py",
"file_line": 338,
"line_contents": "return strategy.create(*args, **kwargs)",
"function_name": "create_engine"
},
{
"file_name": "/usr/lib/python2.7/site-packages/pyfaf/storage/__init__.py",
"file_line": 213,
"line_contents": "self._db = create_engine(config['storage.connectstring'])",
"function_name": "__init__"
},
{
"file_name": "/usr/lib/python2.7/site-packages/pyfaf/storage/__init__.py",
"file_line": 199,
"line_contents": "db = Database(debug=debug, dry=dry)",
"function_name": "getDatabase"
},
{
"file_name": "/usr/bin/faf",
"file_line": 29,
"line_contents": "db = getDatabase(debug=cmdline.sql_verbose, dry=cmdline.dry_run)",
"function_name": "main"
},
{
"file_name": "/usr/bin/faf",
"file_line": 55,
"special_function": "module",
"line_contents": "main()"
}
]
},
"packages": [
{
"name": "faf",
"epoch": 0,
"version": "0.9",
"architecture": "noarch",
"package_role": "affected",
"release": "1.fc18"
}
],
"reporter": {
"version": "0.3",
"name": "satyr"
}
}
报告附件
当前用于将Bugzilla票号附加到先前报告的 bthash ::
{
"type": "RHBZ",
"bthash": "5f6632d75fd027f5b7b410787f3f06c6bf73eee6",
"data": "123456"
}