- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
在 previous question 上花了一些时间之后,一位用户向我介绍了有关以下问题的电子邮件线程:
[PATCH] ftrace/x86: Fix function graph tracer reset path
On my system, simply enabling and disabling function graph tracer can crash the kernel. I don't know how it worked until now.
The
ftrace_disable_ftrace_graph_caller()
modifies jmp instruction atftrace_graph_call
assuming it's a 5 bytes near jmp (e9 ). However it's a short jmp consisting of 2 bytes only (eb ). Andftrace_stub()
is located just below theftrace_graph_caller
so modification above breaks the instruction resulting in kernel oops on theftrace_stub()
with the invalid opcode like below:
此问题的一个解决方案是以下补丁:
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
index ed48a9f465f8..e13a695c3084 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -182,7 +182,8 @@ GLOBAL(ftrace_graph_call)
jmp ftrace_stub
#endif
-GLOBAL(ftrace_stub)
+/* This is weak to keep gas from relaxing the jumps */
+WEAK(ftrace_stub)
retq
END(ftrace_caller)
通过https://lkml.org/lkml/2016/5/16/493
我不明白将 GLOBAL(ftrace_stub)
替换为 WEAK(ftrace_stub)
会产生什么影响。补丁中既没有评论也没有调查 GLOBAL()和 WEAK()帮助我理解了为什么这个解决方案有效。
如标题所示,我的问题是:将符号从 .globl 更改为 .weak 会产生什么后果?我将不胜感激考虑如何将 GLOBAL(ftrace_stub)
替换为 WEAK(ftrace_stub)
可以解决所引用问题的答案。
最佳答案
由于 ftrace_stub
是在当前文件中定义的,因此汇编器知道距离并且可以使用范围有限的 jmp
的较短版本。
如果它更改为 weak
这意味着该符号可能无法解析为当前文件中的符号,因为其他模块可能会覆盖它。不知道该潜在覆盖的偏移量,因此汇编器必须使用完整范围的 jmp
,这是修补代码所期望的。
关于c - 将符号从 .global 更改为 .weak 会产生什么后果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37812507/
我已经在我的电脑上安装了 node.js,当我运行这个命令时它给了我这个错误,我该怎么办??? npm WARN config global `--global`, `--local` are dep
在 PHP 中,我想知道 GLOBAL 和 GLOBALS 之间的区别。 一些例子: print_r($GLOBALS); 最佳答案 这是与同一事物相关的两个不同事物:全局变量。 $GLOBALS -
在某些 SCSS 文件中,我看到以下内容: :global { /* ... */ } 不知道是SCSS特性还是CSS特性。我尝试搜索它,但第一眼找不到任何好的结果。 最佳答案 此运算符用于 CS
我正在考虑向 JSON 添加注释并找到 this script在处理使 JSON 有效之前将它们去除。我只是想了解如何使 JSON.minify() 函数可用? 开始于 (function(globa
在我的 React 应用程序中,我尝试使用 react-widgets package 中包含的 DateTimePicker 组件.我还通过 reactstrap 使用 Bootstrap 4 组件
全局变量的作用域是所有文件,而静态全局变量的作用域只是它所在的文件被宣布。为什么这样? 全局或静态全局变量存储在内存中的什么位置? 最佳答案 有一些混淆,因为 C 中的 static 可能意味着两种不
我尝试从 Marko 组件访问全局变量,但收到 Uncaught ReferenceError: out is not Defined。 class { onClick(event) {
这个 fiddle 在 IE 和 FF 中返回正确的值“5,5”,但在 Chrome 中它返回“5.5” fiddle :http://jsfiddle.net/4tvSH/ Globalize.cu
我对 python 很陌生,我尝试制作一个简单的 GUI 程序。但是,我遇到了一个“问题”,确切地说是一个警告,上面写着:“m”未在全局范围内定义(Python(变量未定义全局))。 我知道如果你想在
将变量初始化为 global var 或调用 globals().update(var) 有什么区别。 谢谢 最佳答案 当你说 global var 您是在告诉 Python var 与在全局上下文中
我正在开发 ASP.NET Web 应用程序,对于未处理的异常,我正在使用Global.asax 文件 我在其中编写了将错误日志写为 的逻辑 Sub Application_Error(ByVal s
这是我的第一篇 StackOverflow 帖子。提前致谢!我在这里找到了很多答案,但在网络上的任何地方都找不到有关我当前问题的任何信息。 =( 我有一个 C# 服务,我已经使用 Visual Stu
问题: 我正在尝试将对我的 MongoDB 数据库的查询结果有效地分配给全局数组。我基本上尝试将对全局数组的引用存储在一个数组中,以便我可以将 for 循环中的查询结果分配给所有这些引用。 这似乎是不
我想看看 Node.js 中 global.process 的构造函数是否存储在任何地方。 例如,在网络中,构造函数很容易获得。例如,window 的构造函数是window.Window。所有构造函数
Tell me about the difference between global.asax and global.asax.cs ? 和 If i click the both file in
全局对象作为顶级词法环境(如果你愿意的话,在作用域链的顶部)。这意味着可以通过直接引用(如变量)访问全局属性: // global code this.foo = 1; // creat
如何修复 Depricated 警告消息 (node:6136) DeprecationWarning: 'GLOBAL' is deprecated, use 'global' 在我的代码中,我使用
在我的本地发布文件夹中,我有 Global.asax 和 Global.asax.cs,其中 Global.asax 未更新(日期为一个月前)和 Global.asax .cs 已更新。 我检查了 G
我有下面的代码,自动生成: $ react-native init RepeatAloud 应用程序.tsx /** * Sample React Native App * https://git
在 Node-red 仪表板上,我想以不同的流量显示相机流。背后的想法是在每个流上显示相机。 为了显示相机流,我使用了 iFrame。一切正常,但我必须为每个单独的 iFrame 提供流的 URL。
我是一名优秀的程序员,十分优秀!