Questions tagged [panic]

A condition of the the operating system when its state is so broken that imminent shutdown is preferred.

A condition of the the operating system when its state is so broken that imminent shutdown is preferred. This may be caused by hardware failure but is also frequently caused by various kernel bugs, driver bugs, misconfigurations and attempts to use incompatible modules.

It often would be possible to continue the work of the operating system in this condition but this could result the data loss. Hence the shutdown is preferred.

279 questions
74
votes
3 answers

How to get the stacktrace of a panic (and store as a variable)

As we all know, panics produce a stacktrace to stdout (Playground link).: panic: runtime error: index out of range goroutine 1 [running]: main.main() /tmp/sandbox579134920/main.go:9 +0x20 And it seems when you recover from a panic, recover()…
hlin117
  • 20,764
  • 31
  • 72
  • 93
58
votes
9 answers

Should I use panic or return error?

Go provides two ways of handling errors, but I'm not sure which one to use. Assuming I'm implementing a classic ForEach function which accepts a slice or a map as an argument. To check whether an iterable is passed in, I could do: func…
laike9m
  • 18,344
  • 20
  • 107
  • 140
58
votes
3 answers

Go: returning from defer

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 { …
jrichner
  • 699
  • 1
  • 5
  • 9
55
votes
3 answers

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

Consider the following Linux kernel dump stack trace; e.g., 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>]…
0x90
  • 39,472
  • 36
  • 165
  • 245
42
votes
8 answers

How to solve "Kernel panic - not syncing - Attempted to kill init" -- without erasing any user data

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…
Slayer
  • 2,391
  • 4
  • 21
  • 18
35
votes
1 answer

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

The Call Trace contains entries like that: [] FunctionName+0xAB/0xCD [module_name] [] ? AnotherFunctionName+0x12/0x40 [module_name] [] ClearFunctionName+0x88/0x88 [module_name] What is the meaning of the '?' mark…
qdot
  • 6,195
  • 5
  • 44
  • 95
32
votes
2 answers

Why does Go panic on writing to a closed channel?

Why does Go panic on writing to a closed channel? While one can use the value, ok := <-channel idiom for reading from channels, and thus the ok result can be tested for hitting a closed channel: // reading from closed channel package main import…
Everton
  • 12,589
  • 9
  • 47
  • 59
31
votes
5 answers

Android: How to get kernel logs after kernel panic?

I am using an Android Custom ROM on my device, also with a custom boot.img (custom kernel + cmdline + ramdisk). I now want to be able to view the kernel logs immediately after a kernel panic, but unfortunately I can not use a serial console. The…
mreichelt
  • 12,359
  • 6
  • 56
  • 70
23
votes
4 answers

Capturing panic() in golang

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…
David Frascone
  • 283
  • 1
  • 2
  • 6
21
votes
2 answers

What is the point of diverging functions in Rust?

I have read several answers on SO already, and gathered these use-cases: When a function panic!s When a function has an infinite loop in it But it is still unclear to me why we need to define the function like this: fn func() -> ! { …
Oleksandr Novik
  • 489
  • 9
  • 24
18
votes
1 answer

Visual Studio Code Order In AutoCompletion

I recently switched to Visual Studio Code and I love it! It starts so quickly andI just enjoy the open source environment more than Visual Studio. But there's one problem that I have encountered that bothers me more than it should. Before I could…
17
votes
2 answers

Handling panics in go routines

I understand that to handle panic recover is used. But the following block fails to recover when panic arises in go routine func main() { done := make(chan int64) defer fmt.Println("Graceful End of program") defer func() { r :=…
Mohit Jain
  • 733
  • 3
  • 9
  • 24
16
votes
1 answer

runtime: goroutine stack exceeds 1000000000-byte limit, fatal error: stack overflow on printing a nested struct

I have a nested struct. type ConfigOne struct { // Daemon section from config file. Daemon daemon } type daemon struct { Loglevel int Logfile string } And I have a String() string method on that type, which I am trying to return the…
nohup
  • 3,105
  • 3
  • 27
  • 52
16
votes
4 answers

"Starting emulator for AVD" then Panic: could not open..."

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
jerryh91
  • 1,777
  • 10
  • 46
  • 77
15
votes
8 answers

Android/Eclipse PANIC: Could not open

I'm brand new to Android development and Eclipse so I have just set it all up and I am attempting the Hello World tutorial. Sadly when I try and run the program I get the following error: PANIC: Could not open: C:\Users\Nathan…
Kingteeb
  • 243
  • 2
  • 3
  • 8
1
2 3
18 19