Questions tagged [debugging]
is a process of finding and reducing the number of bugs, or defects, in a computer program, thus making it behave as expected
469 questions
1
vote
0
answers
46
views
Mouse middle-button doesn't work in libev, but does in GUIs
I want to use my mouse's middle-button in the TTY, so I tried to debug it. When I perform a middle-click, it doesn't show up in evtest /dev/input/eventN. All other actions show up, so I'm in the ...
0
votes
0
answers
30
views
Signal handling in debugger in linux
I am working on a debugger and found an issue.
I start at the beginning of the dynamic linker (this is a low-level debugger). At this address, I set it so that for a particular signal, the process ...
1
vote
0
answers
30
views
Process Maps in s390x linux systems
So I am working on a debugger for linux s390x system and have the whole disassembler etc set up for reading the ELF file. For debugger I just run it on the process with base address from the process ...
0
votes
0
answers
57
views
LibreOffice crashes with Miniconda3 in path
this is a post that has workaround but not an explanation
Sometime in last 4 weeks my LibreOffice on my debian started crashing. Not producing window with eg. LOWriter, just a "crashed docs ...
0
votes
1
answer
102
views
How to debug the xdg free desktop menu
I'm using KDE on last debian and i get a lot of problem with the menu. I was using the kdemenu to organise the start menu, but i get a lot of trouble :
Some .desktop shows in the start menu but not in ...
1
vote
1
answer
673
views
Arch Linux - pacman stuck in "failed to commit transaction (could not find or read package)" following failed upgrade
During a routine sudo pacman -Syu --needed involving about 50 packages, the upgrade exited early due to a "Less than 1 b/s transferred the last 10 seconds" error. Follwing that, I can no ...
0
votes
1
answer
84
views
flock not working between forks on the same fd
I am working on a process that forks several times. To debug it, I am using a debug file for which I open a fd and which stays the same for all child forks. Then I have a function print_debug, that ...
1
vote
0
answers
365
views
OBS Studio Virtual Camera: Failed to start streaming on '/dev/video2'
Distribution: Arch Linux
OBS Version: 31.0.3
Kernel Version: 6.14.2-arch1-1
v4l2loopback-utils Version: 0.14.0-1
vulkan-radeon Version: 25.0.3-1
> v4l2-ctl --list-devices
OBS Virtual Camera (...
0
votes
1
answer
55
views
Debugging Scanner-0 Process and KVM Issues
I came across the following kernel log entry showing a task named Scanner-0 in an unexpected state, along with a call trace involving kvm_async_pf_task_wait_schedule and a page fault.
[320099.377111] ...
0
votes
0
answers
46
views
Crash utility cannot resolve "p2m_top" when analyzing VMware dump (VMEM) on AlmaLinux guest
I am trying to analyze a VMware memory dump from an AlmaLinux guest. I converted the snapshot to a core dump using vmss2core:
vmss2core-sb-8456865.exe -N vSRV1_Snapshot815.vmsn vSRV1_Snapshot815.vmem
...
-1
votes
1
answer
114
views
How can I invoke Steam for Linux in GDB *via its `.desktop` file*?
Problem
steam-1.0.0.82-1.fc41.i686 from RPMFusion is crashing for me upon startup (when invoked from $HOME/.local/share/applications/steam.desktop). An example of this is visible at youtu.be/...
0
votes
0
answers
105
views
GDB doesn't hit catchpoint on the child process forked off from debuggee
I was re-doing what described here about multiprocessing debugging in GDB.
The weird thing is that GDB doesn't hit the exec catchpoint on the child process running cat command (the latter is forked ...
1
vote
2
answers
141
views
How to get bash script's current line contents being processed prior to interpretation? [duplicate]
When using bash -x or set -x in a script the output shows the result of the line being processed but not the source line which produced the result. There are times when knowing this as well could ...
0
votes
1
answer
54
views
Does Bash have an option to diagnose "expanded to empty value" variables? [duplicate]
Does Bash have an option to diagnose (and optionally abort execution) "expanded to empty value" variables?
Example (hypothetical):
$ bash -c 'echo $x' --xxx
bash: line 1: variable 'x' ...
0
votes
0
answers
96
views
(How) can I set source path (in debuginfo) when building debian package
I need debuginfo for some libraries, for example gstreamer (which are not available in debian repo), but can be built using source packages. However it turns out that the source paths in the debug ...
0
votes
0
answers
70
views
Bottom row of keys will not type, unless they are held down for a random(?) amount of seconds, to which they then work for a bit before regressing
System
$ uname -r
6.6.23-1-rt28-MANJARO
$ cat /etc/*release
Manjaro Linux
DISTRIB_ID="ManjaroLinux"
DISTRIB_RELEASE="24.0.0"
DISTRIB_CODENAME="Wynsdey"
...
0
votes
1
answer
123
views
objdump `--adjust-vma` destroys debug info
When using the --adjust-vma option of objdump all the functions get squashed together, as if there is no debug information about where each function starts.
I'll demonstrate with the following simple ...
2
votes
1
answer
91
views
Plugging in an external DVD drive causes ls, sudo, new SSH connections refused.... what happened?
Title says it all. But I plugged in an external DVD drive into my Raspberry Pi running Raspbian. It says its Linux compatible
However when I actually plug it into the device. Everything goes wrong in ...
0
votes
1
answer
140
views
can't get permissions for debug folder with a custom program
I am running a program on kali Linux. The program uses Openssl and some other networking libraries. When I try to run the program I get the output below:
Failed to open /sys/kernel/debug/ieee80211/...
0
votes
1
answer
150
views
AWStats stuck, but no output on strace: How to debug?
A Perl script is stuck,
root 1317478 99.8 0.0 264072 22516 ? R 04:57 478:37 /usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=domain.tld-http -staticlinks -configdir=/...
0
votes
1
answer
212
views
How to enable debug messages for pam_systemd_home.so?
The manual for pam_systemd_home states that debug messages can be enabled with debug=yes, but they don't state where to put it.
I tried adding the options to the relevant lines in pam.d/system-auth, ...
0
votes
1
answer
379
views
How do I find out reason of missing packets in response to `sendto` syscall?
strace ... -e sendto shows a successful (i.e. positive return value) outcome of trying to send a UDP datagram somewhere, but tcpdump -i any in that network namespace does not show anything relevant in ...
0
votes
0
answers
535
views
Debugging memory leakage: No backtrace saved in core dump after segmentation fault
I am working on an embedded Linux system (kernel-5.10.186), and I want to debug a memory leakage in a program.
With pmap -x PID, I found the process's heap is increasing consistently.
To figure out ...
1
vote
0
answers
44
views
Latency on pselect caused by other user space processes
I have the following pre-condition on Linux:
I'm using a process to read serial data using pselect on a serial device /dev/ttySX.
Data comes in at a stable frequency of 400 Hz.
To optimize latency of ...
0
votes
0
answers
449
views
How to debug an SSH-tunnel that doesn't work (SSH in itself works)?
I posted a question at Ask Different about SSH tunneling of VNC and SMB on MacOS because I thought it was specific for Mac, but it doesn't seem so. In short, I can SSH from my machine A to machine B (...
1
vote
1
answer
210
views
What's the successor of libgcc1-dbg in Debian 11 and onward
I previously had libgcc1-dbg (and other debug symbol packages) installed on Debian 10 "buster" to get readable stack traces in failure cases or to inspect core files.
It seems, that package ...
0
votes
1
answer
172
views
How to report a randomly occurring system freeze?
I'm running debian sid (unstable), and have had a few situations where the system freezes, becoming unresponsive and forcing me to reboot the system. This has happened during work video calls (but not ...
0
votes
0
answers
245
views
tmux continues using variables that are no longer defined in .bashrc
I am trying to reset my .bashrc, because it has become bloated and it takes long to start a console.
For this I did the following:
cp /etc/skel/.bashrc ~/.bashrc
This worked for the normal login bash ...
1
vote
1
answer
557
views
quick-swap TUI mode while using vi keybindings in GDB
In the default mode of gdb, pressing ctrl+x a turns on and off the UI, and ctrl+x 2 cycles through different split views. There are a number of similar useful shortcuts.
I can turn on vi emulation ...
1
vote
1
answer
6k
views
How to clear the /sys/kernel/debug/tracing/trace_pipe quickly?
I am using the bpf_printk() helper to print to the kernel debug to trace some BPF programs. The usage is as follows:
#include <stdio.h>
#include <linux/bpf.h>
#include <sys/socket.h>...
1
vote
0
answers
97
views
Is is possible to configure cppcheck as your linter for nano?
Good debugging tools can save you a lot of time when you are writing code. In nano, it's nice that with bash scripts, you can just hit alt+b to find syntax errors before you try running it.
However, I ...
0
votes
1
answer
771
views
Permission denied for user in group (group has directory write permissions)
I'm getting Permission Denied when attempting to create/touch files in a directory with group ownership permissions.
touch /data/www/acoder.txt
[acoder@box]$ touch /data/www/acoder.txt
touch: cannot ...
2
votes
1
answer
2k
views
GDB fails to download debuginfo for math.h
I have a simple clock program that uses math.h functions. I am currently on Kubuntu 21.10, the GCC version is (Ubuntu 12.2.0-3ubuntu1) 12.2.0, and the GDB version is (Ubuntu 12.1-3ubuntu2) 12.1.
The ...
5
votes
1
answer
36k
views
How to read and debug SSH verbose-mode?
Let's say I use this command:
ssh -vvv user@server
I get an output similar to this:
send packet: type 21
ssh_set_newkeys: mode 1
receive packet: type 6
SSH2_MSG_SERVICE_ACCEPT received
receive packet:...
0
votes
1
answer
340
views
How to diagnose a sharp, sudden increase in the frequency with which processes enter the D ("uninterruptible sleep") state
The Linux cluster I work on recently started getting frozen for a few minutes at a time. I've determined that the reason for this behavior is that processes are very frequently landing in the D (&...
0
votes
1
answer
1k
views
Redirect output of current script to a socket
I am trying to debug a shell script executing on a remote server, where I do not have access to the standard output of the script. Can I redirect the output to go over a socket?
0
votes
1
answer
602
views
Systemtap probe kernel module function while that module is loaded
How to use a Systemtap probe on a kernel module function while that module is loaded. I am trying to print the functions being called for a particular module while it is being loaded. Suppose I have a ...
4
votes
1
answer
184
views
Debug segfault race condition
I can provoke a race condition that gives output similar to this in dmesg:
[ 5432.541379] perl[408327]: segfault at 22 ip 0000564eb8af9cc2 sp 00007ffec318cea0 error 6 in perl[564eb8af7000+1a1000]
[ ...
-2
votes
1
answer
160
views
sh script won't run, (unexpected end of file) but the individual lines execute fine
Below is what I'm attempting to run on my remote machine, and I'm getting 'Unexpected end of file'.
However, if i take the lines and paste them into the CLI, it executes normally.
# if [ -f running....
13
votes
4
answers
4k
views
Temporarily unset bash option -x
I like to use set -x in scripts to show what's going on, especially if the script is going to run in a CI/CD pipeline and I might need to debug some failure post-hoc.
One annoyance with doing this is ...
0
votes
0
answers
97
views
Bash truncates long PS4 strings
I am trying to debug a large build project which calls a bunch of bash scripts. Someone suggested modifying PS4 so I set it to the following snippet in order to print the path of the script and the ...
1
vote
0
answers
51
views
C++ How to debug a WM/DE or X.org crash?
I have a huge code that deals with sockets, threads and processes and it is a complete mess... While editing recently, my WM crashed after I executed my code. Since every window is killed, I can't ...
1
vote
1
answer
456
views
ansible echo to terminal when condition is found
How can I have the output printed to the terminal when condition is met using lineinfile
- lineinfile:
path: /home/pc/date.txt
state: present
line: 'yes'
regexp: '^\s*Wednesday\s*$'
...
0
votes
2
answers
5k
views
Permission error when attaching GDB to PID of running process
I have such a toy C++ program
#include <iostream>
int main() {
int n{};
std::cin >> n; // waits for input
std::cout << n << std::endl;
}
which pauses upon ...
0
votes
0
answers
28
views
Why is my script misbehaving sometimes? [duplicate]
I have created a script that can split an audio file into smaller files via ffmpeg using timestamps, and another script which can take in timestamps & names in batches. My use for this script ...
5
votes
3
answers
985
views
Tool to detect errors in application's execution logic
I want to detect errors in application's execution logic. E.g.:
forgot to call free() on address returned by malloc()
did not close file handle returned by open()
invalid flags passed to open()
...
0
votes
1
answer
3k
views
CodeLLDB for VSCode not working with remote gdbserver
I'm currently trying to set up remote debugging on a Raspberry Pi using the CodeLLDB plugin for Visual Studio Code and gdbserver. Unfortunately this doesn't seem to work, since every breakpoint I set ...
0
votes
0
answers
554
views
Testing an application under Eclipse with sudo elevation
I am developing a C++ application that requires root privilege. I am working under Eclipse and I would like to be able to launch/debug from it.
I know I could start Eclipse as a root, but I am looking ...
2
votes
0
answers
212
views
What is the complete list of file functions equivalent to the "strace -e file" options?
According to man strace the -e file option traces all syscalls which take a file name as an argument. What is the whole set?
%file
file Trace all system calls which take a file ...
0
votes
1
answer
195
views
Why does OpenSSH debug2 handshake logging only on some logins, not on every login?
Running Ubuntu 18.04.1 LTS with package openssh-server 7.6p1-4ubuntu0.5
In /etc/ssh/sshd_config is set LogLevel DEBUG2.
I get the debug2 log message of the client MACs offering part of handshake:
May ...