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

Filter by
Sorted by
Tagged with
4
votes
3answers
121 views

Define bash function which does not show up in xtrace (set -x)

In a bash script I have a log() function that is used in several places, as well as a logs() function that diverts lots of line to log(). When I run parts of the script with set -x, obviously all ...
8
votes
1answer
2k views

Any way to have a “verbose mode” or “debug mode” with sed?

Is there a way to make gnu sed be verbose about what is run and what is done ? I'd like to have something like a "debug mode" so that I can see - for each line of input - the content of the hold space ...
0
votes
1answer
165 views

No desktop up to 15 seconds after login

I was worried that my computer could be compromised and my login session is being hijacked by some malicious hook. In .xsession executed by xdm, I capture a pstree snapshot a file to debug this ...
0
votes
0answers
174 views

Is there an Ansible command to check all essential logs of a web server environment?

I use Debian stable and Apache 2.4. In the past I wrote a script with 3 different commands to read all logs of my webserver. Like: #!/bin/bash nginx -t && echo;echo;echo tail /var/log/...
1
vote
0answers
202 views

How to dump stack trace for all processes in Linux?

I am trying to track down a bug on an Android device that involves IPC between several native processes. At a given point in time I would like to dump native stack traces for all threads in some or ...
5
votes
3answers
818 views

Make systemd debug shell usable again

Specifying systemd.debug-shell=1 as kernel parameter kind of works: I can switch via Alt+F9 to a shell when systemd boot hangs. But this shell is quite impossible because an animated [ *** ] A ...
4
votes
1answer
4k views

set -eux instead set -x in Bash profile for global debugging [closed]

When I work with Bash I love to do so with prominent debug mode, so each time I get a new machine I add to the end of ~/.profile the code set -x. I consider adding eu as well, so to have set -eux as ...
1
vote
1answer
129 views

debugging a statement in a Makefile on OpenBSD

It is not clear to me, where the error comes from, the Makefile code follows: platform_id = $$( uname -s ) platform = $$( \ case $(platform_id) in \ Linux | FreeBSD | OpenBSD | NetBSD ) ...
0
votes
1answer
238 views

lldb hangs when opening a dump

lldb-3.9 hangs when I try to open a dump from a dotnet application. The process gets completely stuck, without consuming CPU. $ gdb -v GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git $ lldb-3.9 -v ...
1
vote
0answers
39 views

CIFS debugging - not enough information

I am using RedHat RHEL 6. The goal is to identify whether an application running on the local server is setting 'HIDDEN' file attribute on the remote CIFS share. I have first enabled the logging in ...
2
votes
1answer
539 views

Debian: Find binary and debug files by build-id

Assuming I have a core dump from a Debian system, where I know the build-ids of the libraries used in the dump, but don't know the exact versions, is there a way to find those files? For example, the ...
4
votes
1answer
554 views

Why some libraries and other parts get repeated in the linux virtual memory with gdb?

This is the result of looking at virtual memory of a process in gdb; I have some questions regarding this: Why are some parts of the virtual memory are repeated? For example, our program (stack6) and ...
0
votes
2answers
90 views

bash & using a variable to decide when to use 'set'? [closed]

Looking to ascertain why when I do something like; [ ${debug:=0} -gt 0 ] && set -x || set +x regardless of the conditional set -x is enabled. The issue is that I am unable to use ${debug} to ...
1
vote
2answers
30 views

List/find the programm(s) that has accessed (in the past! No fuser!) a specific given file (IOW: from a specific file 2 an unknown tool)

I have a javascript file that is used on just one occasion -> if the home folder is deleted and i login the next time. I want to find the mechanism/tool/programm/application which has accessed/used (...
2
votes
1answer
259 views

lldb hangs on Alpine Linux

I'm trying to run lldb on Alpine Linux V3.8, but when trying to debug any program, it hangs. I'm using lldb 5.0.1-r0 from the edge/testing repository, which is the only version available currently in ...
1
vote
0answers
20 views

How to figure out why executable crashes (I don't have the source code) [duplicate]

I'm trying to install PowerPanel Business Edition on Apple OS X.13. The server starts and exits (quits) - no log file, no error message. It works fine on my other OS Apple machines but on this High ...
0
votes
1answer
185 views

How to install debug symbols for corosync package on CentOS?

I got a crash in corosync which I would like to view in gdb. However, currently the core dump shows me only this much info Debug logs for core.1385 (Generated on Jul 26 10:17 BST) [Thread debugging ...
2
votes
1answer
485 views

Install a Linux kernel with debug symbols and without optimizations

My system is Ubuntu 18.04. How do I install a Linux kernel with debug symbols and without optimizations? I would like to trace it with SystemTap.
8
votes
2answers
787 views

function's calling context in zsh: equivalent of bash `caller`

In bash, I can write: caller 0 and receive the caller context's: Line number Function Script name This is extremely useful for debugging. Given: yelp () { caller 0; } I can then write yelp to ...
6
votes
1answer
2k views

Defining a state of a failed SD cards by kernel tracing?

I'm having a series of failing/sometimes failing SD cards. They either give one of the following dmesg outputs: The completely dead ones (don't list at /dev/mmcblk0): [ +0,000010] mmc0: error -110 ...
10
votes
1answer
16k views

ACPI BIOS Error / AE_NOT_FOUND

I'm getting these error messages every single time I reboot my desktop (and a couple of more I don't know how to retain when it's shutting down, but those are not relevant to this question so far): [...
2
votes
2answers
168 views

sh is evaluating bash code from parent shell, and breaking down

I have this code in a bash script: r2g(){ echo "executable is: $0" # "/bin/bash" ( set -e; r2g_internal "$@" \ 2> >( while read line; do echo "r2g error: $line"; done ...
0
votes
0answers
20 views

Process memory usage right before executing of its first instruction

How can I get the size of a process right before its execution without executing the program with any particular input? I was thinking maybe a debugger can do so. I have IDA pro if that helps.
0
votes
1answer
43 views

Debug possible SSL/TLS problem?

I'm running into a couple networking issues which I suspect could be related to SSL/TLS, but I'm not sure how to go about confirming that that's the case. The main problem I'm having is I'm unable to ...
1
vote
0answers
255 views

Crashkernel not starting after crash

I am trying to start a crash kernel using Linux's Kernel Crash Dump. Both of the host and crash kernel are compiled linux-4.13.16 kernel. Unfortunately, the crash kernel fails to start after the crash ...
1
vote
0answers
447 views

How to debug a completely stuck kernel?

Running kernel 4.15 here from F27. Since I moved a week ago from 4.13 to 4.15, a highly threaded app I have been developing started to hang the kernel. Not always, but most of the times. I have an i7 ...
0
votes
0answers
841 views

LLDB Failed to connect port.Under Vmware, CentOS, Android Studio

I am trying to debug JNI code in Android Studio which runs under VM Workstartion + CentOS 7. The error message is: Failed to connect port com.jetbrains.cidr.execution.debugger.backend.lldb....
1
vote
0answers
35 views

Is there a way in which we can notify the tracer (parent process) when the tracee (child process) executes a branch instruction?

As we know, the ptrace system call is one of the most powerful system calls in unix-like systems. All debugging software use ptrace for monitoring and manipulating another process, i.e. tracee. Using ...
4
votes
1answer
263 views

set -x: tab completion results in messy output when working in debug mode

I understand that set -x gets a Bash user into debug mode and I feel that working full time in debug mode will help me handle possible problems better in Bash. I experience a problem when working ...
0
votes
3answers
374 views

Why does a UDP client send 1Gbit speed to 100Mbit server?

I've just found out that in a simple UDP client/server application I wrote on Linux userspace, the UDP client (1 Gbit Ethernet interface) sends the data with 1 Gbit speed to a UDP server which has ...
3
votes
1answer
522 views

Toggle bash script between run commands and print commands

I found a script which used this "trick" to achieve a toggle between running and printing commands: echo_prefix="echo" rm_cmd="rm file1 file2" $echo_prefix $rm_cmd This allows the user to dry run ...
1
vote
2answers
216 views

how to selectively silence rsync

When rsyncing a folder with a million files, a million lines are output to stduot/stderr, containing the file names. (I'm using Travis CI, and this trips it up because their log files can be max 4MB)...
0
votes
1answer
34 views

How to debug time dependent issue

I think one of my cronjobs failed when it ran at 00:00:00 2018-01-01. How can I debug that? Changing the system clock is clearly the wrong way to go, since it would disrupt the whole system and also ...
2
votes
1answer
58 views

Use of __rb_rotate_left()

I have a kernel crash on this function: __rb_rotate_left().  Can someone explain what this function is meant for in simple terms? PC is at __rb_rotate_left+0x24/0x78 LR is at rb_insert_color+0x108/...
3
votes
1answer
3k views

What is `bash -x`

A colleague recently introduced me to bash -x for debugging my bash scripts without taking the echo $foo route. $ bash -x hello-world.sh + echo 'Hello World' Hello World Internally -- how does ...
2
votes
1answer
343 views

Analysing crash dump

On the customer unit, I see this crash and after the crash, the unit goes into hung state. Only hard reboot brings it back to the normal state. Below log shows many register values and memory ...
1
vote
0answers
271 views

Trace sequence of scripts/commands executed upon ssh

I am executing ssh myuser@myserver. Is there any way to trace all actions performed and the names of files being sourced? (similarly as with bash -x) PS: I executed bash -x at the command prompt ...
1
vote
1answer
62 views

How to improve linux debugging ability and be proficient in using linux [closed]

how can I improve myself to be like a professional, especially what kind of materials can I read if any?
0
votes
2answers
30 views

Program to instantly host a mysql database from a dump file [closed]

I'm looking for a utility program which can take a dump of a mysql database and basically host a "fake" or minimal mysql server with that data for testing another program which requires it. Has ...
0
votes
1answer
453 views

.bashrc cannot be sourced, how can I debug? [closed]

When .bashrc is sourced, my terminal immediately closed - I pinpointed it to ~/.bashrc - what's the best way to debug this? Should echo every line to another file? Is there a log I can look to? It ...
3
votes
1answer
3k views

Unable to use Valgrind on executable file for ARM-Linux

I'm having problem using Valgrind on "arm-linux" executable file. I downloaded Valgrind from the main page here : http://valgrind.org/downloads/. Run the following command to install it: sudo ./...
1
vote
0answers
70 views

How do I debug intermittent System Crashes?

Linux/Xorg crashes intermittently on Debian Stretch with a swap partition - display goes all black or leaves the background image. I have to hard reset the box. No logs (Xorg.0.log or syslog) are ...
0
votes
0answers
296 views

Using bashdb, how do I debug a script that must be run as root?

I'm using bashdb release 4.3-0.9 (from the Arch repos). man page: bashdb - bash debugger script http://bashdb.sourceforge.net/bashdb-man.html I would like to debug a bash script with bashdb, but the ...
1
vote
1answer
540 views

How can I debug X11 missing mouse ButtonRelease events that are present in usbmon?

A few days ago, my mouse button releases began sometimes not being recognised when I release two of the buttons simultaneously. The logical state of one button therefore gets stuck on "down", causing ...
2
votes
0answers
66 views

Locate the .desktop file for a special menu item

There are various reasons why orphaned menu items can remain after package removal and need to be fixed in the package. In order to investigate the bug, it can help to see the exact path of the ....
2
votes
0answers
760 views

Not able to see the Linux kernel debug info after building kernel in debug mode

I tried to build Linux Kernel versions 3.10.107 and 4.13.8 in debug mode. I have used following steps to build the kernel. Host machine with Ubuntu 16.04 OS and trying to update its kernel to latest ...
3
votes
1answer
1k views

Unable to use crash utility due to missing /usr/lib/debug/lib/modules/ folder

A CentOS7 server is experiencing crashes. According to RHEL7's documentation, I should be able to view details using the crash utility: crash /var/crash/<timestamp>/vmcore /usr/lib/debug/lib/...
2
votes
0answers
131 views

Is there anyway to verify validity of dlopen handle?

In my case after my program cas dlclose program is crashing and I am not getting stack trace for dlclose or any function on upper frames. I know handle value of dlclose . Is there anyway to check if ...
2
votes
1answer
3k views

How to quit an application running in gdb gracefully when the application isn't reponding.

This is somewhat related to gdb set overwrite logging on should overwrite gdb.txt correct? . Let's say I'm running a session of some application. For example purposes, let me take the example of ...
1
vote
2answers
5k views

Turning off kASLR to debug linux kernel using qemu and gdb

I'm trying to debug linux kernel using qemu and gdb. The problem is that gdb won't stop at breakpoint. I've searched about it and found that turning kASLR off may help, because kASLR confuses gdb. ...

1 2 3 4 5 8