general-protection-fault

how to handle general protection fault in linux kernel

一世执手 提交于 2021-01-29 15:59:31
问题 I have a piece of kernel module as the following, which tries to read msr register, no doubt it would crash as the msr 0x2 is not exist, a geneal protection fault will happens. My question is how could I bypass this fault, like define my GP handler? if I cannot read a msr, just let it go... The following is my module code: #include <linux/init.h> #include <linux/module.h> #define LBR 0x2 static unsigned long long x86_get_msr(int msr) { unsigned long msrl = -1, msrh = -1; /* NOTE: rdmsr is

objc_setAssociatedObject function error in 64bit mode not in 32bit

ε祈祈猫儿з 提交于 2019-12-29 04:48:05
问题 I am using a neat table view controller called SKSTableView in my project which allows each table row to have a number of sub rows. This code works perfectly in 32bit mode but when I run it on my iPhone 5S or in the Simulator in 4-inch 64bit mode, when you tap on a row to get the sub rows it crashes. I do not have any knowledge of the differences of 64bit and 32bit iOS systems. I would love to understand what it happening here. You will notice that the *SubRowObjectKey is set to void- the

objc_setAssociatedObject function error in 64bit mode not in 32bit

為{幸葍}努か 提交于 2019-11-29 00:09:57
I am using a neat table view controller called SKSTableView in my project which allows each table row to have a number of sub rows. This code works perfectly in 32bit mode but when I run it on my iPhone 5S or in the Simulator in 4-inch 64bit mode, when you tap on a row to get the sub rows it crashes. I do not have any knowledge of the differences of 64bit and 32bit iOS systems. I would love to understand what it happening here. You will notice that the *SubRowObjectKey is set to void- the error I get is: EXC_BAD_ACCESS_(code=EXC_I386_GPFLT) Which is a general protection fault trying to access