panic

Multiple kernel modules intercepting same system call and crash during unload

大城市里の小女人 提交于 2019-12-01 22:52:41
I'm working on system call interception (for open() system call) and I got one problem: I have two kernel modules ( mod1 and mod2 ) and both of them are trying to intercept open() syscall. I've loaded mod1 first and then mod2 . The mod1 intercepted open() by: original_open1 = sys_call_table[__NR_open]; sys_call_table[__NR_open] = mod1_open; Here original_open1 would be sys_open . After this, mod2 intercepted open() by: original_open2 = sys_call_table[__NR_open]; sys_call_table[__NR_open] = mod2_open; Here, original_open2 would be mod1_open() since mod1 was loaded first. Now, the problem is:

“Starting emulator for AVD” then Panic: could not open…\"

折月煮酒 提交于 2019-11-30 11:38:04
I'm new to android app dev. When I created a new AVD, when I click start on this AVD: I get the following: Starting emulator for AVD 'Nexus_4_16_AVD' PANIC: Could not open: Nexus_4_16_AVD Umer Farooq This is a bug in the ADT Plugin. For a workaround until it is fixed use a NTFS symbolic link. I have a C: drive for windows 7 and a D: drive for all my work and data. After installing windows 7 I relocate all my special folders from C:\Users\John Doe to D:\John Doe. The ADT Plugin is trying to load the emulator from C: when it and the configure files are on D: (PANIC: Could not open etc.). NTFS

Capturing panic() in golang

风流意气都作罢 提交于 2019-11-30 03:46:16
We have a large-ish golang application that uses the logger (actually, a custom logger), to write output to a log file that is periodically rotated. However, when an application crashes or panic()'s, those messages go to standard error. Is there any way to override the panic functionality to use our logger? Nick Craig-Wood As far as I know, you can't redirect the output from panic away from standard error, or to your logger. The best thing you can do is redirect standard error to a file which you can do externally, or inside your program. For my rclone program I redirected standard error to

What is the meaning of question marks '?' in Linux kernel panic call traces?

孤街醉人 提交于 2019-11-29 22:51:51
The Call Trace contains entries like that: [<deadbeef>] FunctionName+0xAB/0xCD [module_name] [<f00fface>] ? AnotherFunctionName+0x12/0x40 [module_name] [<deaffeed>] ClearFunctionName+0x88/0x88 [module_name] What is the meaning of the '?' mark before AnotherFunctionName? Eugene '?' means that the information about this stack entry is probably not reliable. The stack output mechanism (see the implementation of dump_trace() function ) was unable to prove that the address it has found is a valid return address in the call stack. '?' itself is output by printk_stack_address() . The stack entry may

Go: returning from defer

旧城冷巷雨未停 提交于 2019-11-29 21:00:59
I want to return an error from a function if it panics (in Go): func getReport(filename string) (rep report, err error) { rep.data = make(map[string]float64) defer func() { if r := recover(); r != nil { fmt.Println("Recovered in f", r) err, _ = r.(error) return nil, err } }() panic("Report format not recognized.") // rest of the getReport function, which can try to out-of-bound-access a slice ... } I appear to have misunderstood the very concept of panic and defer. Can anybody enlighten me? In a deferred function you can alter the returned parameters, but you can't return a new set. So a

How to read, understand, analyze and debug a Linux kernel panic?

大城市里の小女人 提交于 2019-11-29 19:12:51
Consider the following linux kernel dump stack trace, you can trigger a panic from the kernel source code by calling panic("debugging a linux kernel panic"); : [<001360ac>] (unwind_backtrace+0x0/0xf8) from [<00147b7c>] (warn_slowpath_common+0x50/0x60) [<00147b7c>] (warn_slowpath_common+0x50/0x60) from [<00147c40>] (warn_slowpath_null+0x1c/0x24) [<00147c40>] (warn_slowpath_null+0x1c/0x24) from [<0014de44>] (local_bh_enable_ip+0xa0/0xac) [<0014de44>] (local_bh_enable_ip+0xa0/0xac) from [<0019594c>] (bdi_register+0xec/0x150) In unwind_backtrace+0x0/0xf8 what the +0x0/0xf8 stands for? How can I

“Starting emulator for AVD” then Panic: could not open…"

烂漫一生 提交于 2019-11-29 17:33:53
问题 I'm new to android app dev. When I created a new AVD, when I click start on this AVD: I get the following: Starting emulator for AVD 'Nexus_4_16_AVD' PANIC: Could not open: Nexus_4_16_AVD 回答1: This is a bug in the ADT Plugin. For a workaround until it is fixed use a NTFS symbolic link. I have a C: drive for windows 7 and a D: drive for all my work and data. After installing windows 7 I relocate all my special folders from C:\Users\John Doe to D:\John Doe. The ADT Plugin is trying to load the

6 go中defer关键字的用法

陌路散爱 提交于 2019-11-29 11:39:19
defer关键字 defer是go里面处理异常的一个关键字,应用场景类似于java里面的finally,使用的时候就是所有的其他的正常的函数进程执行完毕之后都要执行defer。 也就是被defer修饰的函数或者语句都是等到所有的作用域内部的函数执行完毕才会执行。 而且defer修饰的语句应该是以压栈的方式存储在某一个指令栈里面,先放进去的后执行。 func main{ for i := 1; i < 5 ; i++{ defer fmt.Printf("%d" , i) } fmt.Printf("AAA") } //输出 AAA12345 defer 与匿名函数搭配使用 func main{ defer func(a,b int){ fmt.Println(a+b) }() f := func(a,b string){ fmt.Println(a+b) } defer f("a" , "b") } defer与panic panic你可以理解为抛出异常,然后panic执行之后,如果没有recover的话程序就会abort,但是在之前defer仍然会执行,释放资源做一些收尾的工作。如果是在panic调用之后再调用defer那肯定是来不及的。先做预防 package main import ( "fmt" ) func main(){ defer fmt.Println("defer

How to solve “Kernel panic - not syncing - Attempted to kill init” — without erasing any user data [closed]

拈花ヽ惹草 提交于 2019-11-28 20:15:27
I was trying to update libc in our Ubuntu server but it failed and now when I reboot the server I get a error message: Kernel panic - not syncing - Attempted to kill init! and it just hangs. What is the solution to this problem? The server is used by 10 people so I don't want to reinstall erasing their data. if the full message is: kernel panic - not syncing: Attempted to kill inint ! PId: 1, comm: init not tainted 2.6.32.-279-5.2.e16.x86_64 #1 then you should have disabled selinux and after that you have rebooted the system. The easier is to use a live OS and re-enable it vim /etc/selinux