294 questions
0
votes
0
answers
42
views
ESP32's crashes the if the SSID of the WiFi access point contains a ' symbol
ESP-IDF 5.3.4, No Arduino, Win10.
I've loaded an official "station" example which demonstrates how to connect ESP32 to a home wifi access point. Made only 2 changes: .ssid and .password in ...
0
votes
1
answer
102
views
Why can't successfully kmalloc pages in this case?
See the below logs, A critical kernel driver cannot apply for a large block of continuous memory and then panic:
[29001.362425] kworker/u12:4: page allocation failure: order:4, mode:0x40dc0(GFP_KERNEL|...
0
votes
0
answers
57
views
Set kernel parameters on an Android Pixel 8 running CalyxOS
I am running a rooted CalyxOS (rooted using magisk) on a Google Pixel 8 (Shiba) device.
uname -a: Linux localhost 5.15.137-android14-11-gbc062a78e195-ab12057991 #1 SMP PREEMPT Mon Jul 8 12:34:46 UTC ...
0
votes
1
answer
458
views
dracut-install: Failed to find module 'hid-polostar'
I need to resolve a kernel panic on Fedora 41, but when I boot into the live version and mount my partitions, after reinstalling kernel 6.11.4, it won't let me run dracut. It tells me that I am ...
1
vote
1
answer
96
views
"index out of range" with a custom queue type implementing concurrent access
I am trying to create a simple matchmaking server to match two clients to each other. Here's the structure
.
├── bootstrap-server
├── cert.pem.local
├── client.go
├── config.go
├── go.mod
├── go.sum
├─...
0
votes
1
answer
317
views
`kexec -e` can work, but `kexec -p` didn't work
I want use kdump & kexec, so I installed kexec-tools, configured /etc/kdump.conf and kdump.service. STFW, according to the steps, I can use kexec -l, then kexec -e, change to the new kernel ...
1
vote
1
answer
75
views
Golang: gorilla - how to handle requests to endpoint defined with url parameter when the parameter is empty
I have this endpoint definition:
router.NotFoundHandler = http.HandlerFunc(handlerNotFound)
router.HandleFunc("/customer/{id}", handlerCustUpd).Methods(http.MethodPut)
When called URL https:...
-2
votes
2
answers
209
views
Why can't rust code process borrow checking at compile time?
use std::cell::RefCell;
use std::collections::VecDeque;
struct TextEditor {
content: String,
history: RefCell<VecDeque<String>>,
}
impl TextEditor {
fn new(initial_content: &...
0
votes
1
answer
83
views
Redirect stdout and stderr streams of a thread
I am building a cli tool where application would perform multiple tasks by spawning threads. One of these threads would handle the rendering of state of application. The way rendering works is simply ...
0
votes
1
answer
82
views
How to convert error post mortem output to structured log
We use structured logging in our Rust codebase (e.g. via tracing-subscriber). All is well here.
But if the process crashes/panics, then we see this post mortem as multiple events in our log sink (e.g. ...
1
vote
1
answer
222
views
Facing error "panic has occurred: /api/v2/write?org=test\bucket=test\precision=s: runtime error: integer divide by zero" when writing to influxdb2.7.4
I have installed influxdb 2.7.4 docker container on AWS EC2 having AL2023 OS image. I copied the data from S3 to this docker container and this data file in compressed format is around 4 GB. I ...
0
votes
1
answer
133
views
tokio::select! eager evaluation only if outside async block
I'm trying to use the select! macro's pre-condition to only include a branch if an Option is the Some variant.
I observe behavour which surprises me: the unwrap is eagerly evaluated causing panic! ...
2
votes
0
answers
1k
views
Steps to Resolve Serror Panic on ARMv8-A or How to Identify the Faulty Instruction?
I am familiar with kernel panic on x86 but recently encountered an Serror panic on ARMv8-A that needs resolution. Seeking guidance on the general steps to address Serror issues.
The code causing the ...
4
votes
2
answers
696
views
Where is Rust's range indexing behavior documented?
In Rust, if you attempt to index a slice with a "backwards" Range<usize> , the program panics:
let arr = [0,1,2,3,4,5,6];
let slice = &arr[4..1]; // panic: slice index starts at 4 ...
0
votes
2
answers
8k
views
Disable "note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace" message
How to disable 'note: run with RUST_BACKTRACE=1 environment variable to display a backtrace' when panic in Rust? My code:
use std::{env, fs, path::Path};
fn main() {
let args: Vec<String> = ...
1
vote
1
answer
153
views
collect /proc/<pid> information of process during process crash in linux
I am trying to collect some proc file system info of a process during panic. is there any way like script or any program which help to collection those info and put some directory of system.
The ...
0
votes
1
answer
733
views
ESP32 panic'ed with string to int
I'm not a specialist in coding, I try to put toghether some code to control over bluetooth a signal generator with ESP32. I managed to make it functional with a number and now I try to conect some ...
2
votes
0
answers
110
views
golang text/template renders panic into output text
I'm trying to render template, but it seems that there are some cases when error can be rendered directly into result text:
package main
import (
"bytes"
"fmt"
"...
0
votes
1
answer
655
views
Panic from Rust cdylib is causing a fatal runtime error
I'm currently developing a plugin loading system that utilizes C++ Boost to load Rust cdylib modules. Everything is functioning correctly, except when I invoke panic!() within a cdylib. The panic ...
1
vote
1
answer
823
views
How to catch panic for a async function?
I want to try to catch panic for a async function which looks like below:
let x = a_sync_function(param1, param2).await?;
// the return of `a_sync_function` is : Result<Vec<serde_json::Value>,...
0
votes
1
answer
535
views
Calling user space application from kernel panic
I need a way to notify that a kernel panic occurred to U-Boot on my system, I have configured all the related applications like fw_setenv and it is working when launched manually. Now I need to ...
0
votes
0
answers
103
views
Kernel panic obj_cgroup_uncharge
Could someone help me to dechipher this kernel panic backtrace.
uname -a
Linux ubuntu-PC 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21
15:35:31 UTC 2 x86_64 x86_64 x86_64 GNU/...
1
vote
1
answer
206
views
Deadlock Happens Due To Ranging Over Open Channel But Panic Not Thrown
I have this code that I deliberately wrote to cause a deadlock and a subsequent panic throw:
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("...
1
vote
0
answers
202
views
Syscall in Golang to dll lib
I can't bring the string to MZFanDll.dll in Goland and call func inside dll.
func main() {
user32 := syscall.MustLoadDLL("MZFanDll.dll")
messageBox := user32.MustFindProc("...
1
vote
1
answer
230
views
Failed to Recover from Panic during mutex lock and unlock
I am trying to check if i can recover panic from this code:
I have deliberately added mutex.Unlock() at line x
func main() {
defer panicHandler()
x := []int{1, 2, 3, 4}
var mutex sync.Mutex
...
-1
votes
1
answer
405
views
How to prevent unhandled panic from crashing my application process
I want a mechanism by which any unhandled panic (from Go code) does not bring down my application process. At the moment any downstream panic(s) raised by my golang code will freeze/crash my ...
0
votes
1
answer
779
views
dlv attach got panic: <nil> not an Int
when I installed dlv and trying to attach a pid, I got panic:
dlv attach 1
panic: <nil> not an Int
goroutine 1 [running]:
go/constant.Int64Val(0x0, 0x0, 0xc, 0xc0074ff300)
/usr/local/go/...
0
votes
1
answer
478
views
crash: invalid structure member offset: kmem_cache_s_num FILE: memory.c LINE: 9619 FUNCTION: kmem_cache_init()
I'm learning linux kernel dev. Very new to it. I'm playing around with kernel panic.
my os version:
pegasus@pegasusv:~$ uname -a
Linux pegasusv 5.19.0-41-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Mon Apr ...
2
votes
0
answers
1k
views
Override Panic Handler of Rust std
I'm currently experimenting with writing a kernel in Rust. I've just found out the by using
[unstable]
build-std = ["core", "std", "panic_abort"]
I can build the ...
1
vote
1
answer
1k
views
invalid node type panic when implementing a plugin for KrakenD
im working on a plugin for no redirects. Im using krakend-ce 2.2.1 (with golang 1.19) im getting this panic:
gw_krakend_1 | [KRAKEND] 2023/03/15 - 21:09:06.675 ? DEBUG no_redirect_plugin: request ...
1
vote
1
answer
50
views
Run "should_panic" tests with different inputs
Assume the following function which gets the nth bit from a u8:
fn get_bit(&self, n: u8) -> bool {
if n > 7 {
panic!("Overflow detected while using `get_bit`: ...
1
vote
0
answers
49
views
How to handle methods which can panic? [duplicate]
What is ideomatic way of handling methods which can panic. For example take a look at next code
fn main() {
let v = [1, 2];
let b = v.split_at(4);
println!("{:?}", b);
}
...
-1
votes
1
answer
92
views
Why this program prints 421 in result?
I can't to understand, why this program prints 421 instead of 431?
package main
import "fmt"
var x int
func f() int {
x++
return x
}
func main() {
o := fmt.Println
defer ...
0
votes
0
answers
1k
views
What caused the invalid virtual address in linux kernel
Update: the virtual address is invalid address, not null pointer.
=======================================================
Invalid virtual address problem happened in my project, but I did not modify ...
-1
votes
1
answer
280
views
panic while concat strings
I tried to concatenate a string in the function, but a panic error was reported during the concatenation, and it only happened once. After the process restarted, it was fine.The code I wrote in Go is:
...
5
votes
1
answer
543
views
Why is it that panic!(_) can be returned with or without a ;?
Looking at question number 3 here.
As an example, I've edited as such.
fn main() {
never_return();
// println!("Failed!");
}
fn never_return() -> ! {
// Implement this ...
0
votes
1
answer
162
views
Handling a specific runtime error in Go loop
I'd like to catch panic: runtime error: index out of range in the following loop (inside function without returning) and concat X for each panic: runtime error: index out of range to the result:
func ...
-2
votes
1
answer
2k
views
How do I handle errors in a deferred function?
func someFunc() (err error) {
defer func(err_ error) {
r.handleErrOrPanic(err_, obj)
}(err) // err is always nil here
err = ThrowErrOrPanic(ctx, obj)
return err
}
I would ...
-3
votes
2
answers
961
views
Does golang support global recovery? [duplicate]
I have a program with lots of goroutines, and I want to handle the panic globally. It looks like I have to add a recovery in each of the goroutines, is there a way to do it globally?
I wrote a test ...
0
votes
1
answer
2k
views
How to properly handle a tokio::try_join! if one of the tasks panics and cleanly abort?
For the two async functions that I am passing to my try_join!(), let's say there's 3 ways that they could panic.
I'm trying to use a set_hook to catch the errors but I'm not sure how to do a match ...
0
votes
0
answers
79
views
What happend if preempt_enable() inside an nmi?
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-8/-/blob/ccf40dfacd314ab0fea16cfc6f4eded1a08e2710/arch/x86/kernel/cpu/mce/core.c#L1331
preempt_enable() before nmi_exit(), will this ...
3
votes
1
answer
495
views
Why BUG_ON(!in_nmi()) was triggerd?
I got a kernel BUG, I don't know why it was triggered.
[ 242.337362] kernel BUG at arch/x86/kernel/cpu/mce/core.c:1364!
[ 242.337366] invalid opcode: 0000 [#1] SMP NOPTI
This is CentOS 8.5, Kernel 4....
1
vote
1
answer
2k
views
Mocking variadic functions in Google Test and Google Mock
I'm new to Google test and I'm trying to write a unit test for a function that returns void and takes no arguments but the function has an if condition which checks on structure values, and I need to ...
1
vote
1
answer
434
views
Why is in Rust the expression in Option.and evaluated, if option is None?
I don't understand, why Option.and() is evaluated, if option is None. The documentation says ....
Returns None if the option is None, otherwise it returns optb (the argument of and()).
So I would ...
-1
votes
1
answer
1k
views
Why getting panic in Rust program with an expect
Beginner Rust fan - I am getting a panic for either one of these.
I expected it from the first part, but not the second.
What am I missing?
fn main() {
//let age = "4a";
//let age2: ...
0
votes
1
answer
937
views
Procedurally bind struct fields to command line flag values using reflect
I have a several configuration structures that I want to automatically parse into accepted command line flags (to allow a user to override them via CLI). Given that the structures are likely to ...
3
votes
1
answer
1k
views
Continue execution after recovered panic without knowing which function might panic
I was referred to this question: Program recovered from panic does not exit as expected
It works fine but it relies on knowing where the panic occurs in order to place the deferred function.
My code ...
5
votes
2
answers
2k
views
What are all the ways rust might panic without explicitly calling unwrap/panic?
Recently I was writing a driver for a pressure sensor and was avoiding using floating-point instructions as the microcontroller I am using doesn't have a hardware FPU and emulated instructions are ...
0
votes
1
answer
2k
views
Why golang can not recover from a panic in a function called by the defer function [duplicate]
package main
import "fmt"
func myRecover() {
if r := recover(); r != nil {
fmt.Println(r)
}
}
func main() {
defer func() {
myRecover()
}()
panic("...
1
vote
1
answer
1k
views
How to analyze android kernel panic?
i develop a small embeded android system.
and, sometimes suffer from kernel panics.
checked the tombstone log, but it is difficult to analyze the exact cause.
also, sometimes there is no log.
is there ...