is a process of finding and reducing the number of bugs, or defects, in a computer program, thus making it behave as expected

learn more… | top users | synonyms (1)

35
votes
2answers
719 views

How did `git pull` eat my homework?

I feel like a kid in the principal's office explaining that the dog ate my homework the night before it was due, but I'm staring some crazy data loss bug in the face and I can't figure out how it ...
24
votes
3answers
1k views

How can I see the exact command line being executed inside some bash instance?

I have a long running bash instance (inside a screen session) that is executing a complex set of commands inside a loop (with each loop doing pipes, redirects, etc). The long command line was ...
23
votes
6answers
2k views

How to debug a bash script?

I'm having some problems with some scripts in bash, about errors and unexpected behaviors. I would like to investigate the causes of the problems so I can apply fixes. Is there a way I can turn some ...
22
votes
4answers
2k views

Kernel Hacking Environment

I have been working in embedded OS like uCOS, ThreadX. While I have coded apps in Linux, now I’m planning to start learning Linux Kernel. I have few questions regarding the environment. Which is ...
18
votes
2answers
4k views

Running application ends with “Segmentation Fault”

I have a command line application that when run does not do what it is supposed to do and at a certain point leaves the message: Segmentation fault What does this mean? What should I do?
14
votes
3answers
1k views

How to know where a program is stuck in linux?

I am running the following command on my ubuntu server root@slot13:~# lxc-stop --name pavan --logfile=test1.txt --logpriority=trace It seems to hang indefinitely. Whenever this happened on AIX, I ...
13
votes
2answers
848 views

How to find out what process is writing to STDOUT?

I have two instances of a process running. One of them is "frEAkIng oUT!" and printing errors non stop to STDOUT. I want to kill the broken process but I have to make sure I don't terminate the wrong ...
12
votes
5answers
9k views

Can we get compiler information from an elf binary?

Is there some chance to know how a binary was built, under Linux? (and or other Unix) Compiler, version, time, flags etc... I looked at readelf and couldn't find much, but there might be other ways ...
12
votes
2answers
1k views

Equivalent of “truss -T” and “truss -U” on Linux?

Is there an equivalent of what the -T and -U option of the truss Solaris utility does on Linux. Those are to specify a system call (-T) or library function (-U) which when called by the traced ...
11
votes
3answers
10k views

Linux network troubleshooting and debugging

From time to time Linux and Unix users faced with various network problems. Many of these problems are presented here and at some others troubleshooting forums, but the are very concrete and contains ...
11
votes
4answers
3k views

How can I debug a Suspend-to-RAM issue on Linux?

I'm hoping to get experience-based suggestions on how to go about debugging suspend-to-RAM issue. Advice specific to my situation(detailed below) would be great, but I am also interested in general ...
10
votes
2answers
898 views

Observing a hard-disk write in kernel space (with drivers/modules)

Apologies in advance if this post is a bit dense/messy, but I'm having a hard time formulating it better... Basically, I would like to study what happens upon a hard disk write, and I'd like to know: ...
10
votes
1answer
9k views

how can I make cron run a job right now, for testing/debugging? without changing the schedule!

I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?
9
votes
4answers
329 views

How can I tell if the currently executing bash script has been invoked with -x for debugging?

I have a script launch.sh that executes itself as another user so as to create files with the correct owner. I want to pass -x to this invocation if it was originally passed to the script if [ ...
9
votes
2answers
2k views

strace for library calls

I know of strace, which is super handy for watching system calls. Is there an equivalent that can trace calls to external libraries? For example, I'm trying to debug some SSLeay misbehavior with a ...
7
votes
2answers
873 views

How exactly does printk work internally?

I know printf needs help from the OS to do its job. I also know printf does not work in the Linux source code as there is no library. And so we have printk for debugging. How does printk work ...
7
votes
3answers
4k views

How to debug a suspend problem?

I used to have Fedora 14 installed on this HP Compaq 610, and the suspend feature worked fine. Now that I've installed Scientific Linux 6.1 suspend doesn't work anymore. How do I debug/fix it?
7
votes
3answers
755 views

Best practise to diagnose problems [closed]

As Linux/Unix users, we run into problems frequently. And after long hours of problem solving, we develop the skill of debugging. Now, what are good principles, methods or best practises when trying ...
7
votes
2answers
2k views

How do I debug a kernel module in which a NULL pointer appears?

I have a custom kernel module that I compiled from this patch that adds support for the logitech G19 keyboard among other G series devices. I compiled it just fine against Ubuntu's maverick kernel's ...
7
votes
4answers
2k views

Debugging Linux machine freezes

I have 15 identical Linux RH 4.7 64-bit severs. They run cluster database (cluster is application level). On occasion (every month or so) a random box (never the same though) freezes. I can ping the ...
7
votes
1answer
1k views

How to debug system freeze?

I'm experiencing strange bug when I close lid of my laptop - system freezes (no reaction on keys, no response form ssh) hard and displays some strange colour effects. The kernel log (after reboot) ...
6
votes
1answer
289 views

Is there a way to see if process listening on TCP port receives a message?

According to tcpdump, my server receives the following TCP packet: 12:52:29.603233 00:19:e2:9e:df:f0 00:16:3e:6a:25:3f, ethertype IPv4 (0x0800), length 74: 10.10.10.65.38869 192.168.215.82.22: ...
6
votes
2answers
644 views

Is it possible to strace the builtin commands to Bash?

Inspired by this question, titled: When are the built-in commands loaded to memory, while attempting to answer this I tried the following command and was a bit surprised that I couldn't run it: $ ...
6
votes
2answers
401 views

bash: escape individual lines from `-x` echoing

In bash, when running with the -x option, is it possible to exempt individual commands from echoing? I'm trying to make the output as neat as possible, so I am running certain parts of my script in a ...
6
votes
3answers
2k views

How can I find what is interfering with CTRL+F?

I'm running LinuxMint12 with Gnome with Cario-Dock and I have a logitech G15 keyboard. I set up a bash script with the extra keys to take the active window, resize it, and move it to a specific ...
6
votes
1answer
156 views

Sending commands to dbx from Vim

Using this information, I've been able to debug code using dbx and display the code from within Vim. What would be really cool is if I could send commands (step, next, print, stop in ... etc) to dbx ...
5
votes
5answers
2k views

How to track/fix a memory-related issue in a large C/C++ code on *nix systems

What strategy you use while tracking a memory-related issue? What tools do you use (open source as well as proprietary) to identify memory leaks, memory corruption etc? How would you track memory ...
5
votes
2answers
288 views

How to determine what instructions a process is executing?

I know about strace and ltrace, but that only tells me what system calls and library calls a process is executing, respectively. I would like to know exactly what instructions a process is executing. ...
5
votes
2answers
1k views

Dump process core without killing the process

Is there a way to get a core dump (or something similar) for a process without actually killing the processes? I have a multithreaded python process running on an embedded system. And I want to be ...
5
votes
1answer
229 views

How do I view executables run by a program?

Is there a way to view or get a list of executables that a program uses? A particular example is file-roller. Is there a way to see which executables it uses, if there is more than one executable it ...
5
votes
1answer
212 views

Debugging lock-up - systemd loses my logs

Ever since I have "upgraded" to systemd on Arch Linux, I keep losing logs when an unexpected lockup happens. I hit the same log-losing issue one month ago and just hit the issue again. There are also ...
5
votes
2answers
4k views

How to enable crash reports/core dumps/stack trace logging globally?

Crashing bugs can be the most annoying ones, leading to data loss, downtime and frustrated users. It would be good if applications crashed less. Because of the complexity of the machine context, ...
5
votes
2answers
336 views

Unclaim a device

So I am using Ubuntu and trying to use some hardware which I had some problems with before. The problem before was that the company who made my hardware sold their internal parts to another company ...
4
votes
3answers
183 views

Adding comments using 'set -x'

Sometimes it is really handy to just add set -x to the top of your script to show all commands before they are executed. There is only one drawback creating scripts with a decent output: I don't ...
4
votes
2answers
3k views

Can gdb debug suid root programs?

I wrote a program that calls setuid(0) and execve("/bin/bash",NULL,NULL). Then I did chown root:root a.out && chmod +s a.out When I execute ./a.out I get a root shell. However when I do gdb ...
4
votes
2answers
380 views

Is there a way to find out which program is segfault-ing?

I have a Busybox/Linux system where a mystery program is segfaulting rarely. Is there a way to find which program is doing this?
4
votes
1answer
285 views

How to dump USB traffic?

I got an USB gamepad and I would like to see and inspect the signals and commands that this peripherals is actually sending to my PC/kernel: how I can do that ? I was assuming that something like ...
4
votes
2answers
2k views

Install debug flash player in Chrome?

I am trying to adapt the instructions from here, here, and here to install the debug version of the flash player on my Ubuntu 13.04 installation such that Chrome 30.0.1599.66 can use it. ...
4
votes
1answer
2k views

What is the difference between /proc/self/stack and output from pstack?

I have been looking through the documentation for /proc and the "stack" object being a new'ish object in proc, I have also looked through the kernel commit to create it -- however the documentation ...
4
votes
5answers
475 views

Unpredictable memory explosions

The main server at my company has recently been having a lot of downtime. For reasons that neither I nor the other admins can determine, it has random (VERY sudden) explosions in memory. It becomes ...
4
votes
1answer
2k views

Kernel and QEMU : Unable to mount root fs error

I am trying to run a distro in the virtual disk image with a custom kernel,so that I can experiment and debug the kernel. I followed this to make a disk image and then install Debian to it. Now I ...
4
votes
2answers
345 views

How to debug an inserted kernel module?

I would like to debug a loaded kernel module I don't have the source code to; I suspect it's a virus. Is there a way to feed it into GDB for analysis?
4
votes
2answers
789 views

Unix/Linux C++ debugger that supports STL containers?

Currently I am using gcc-4.3.6 and Eclipse IDE for c++ development. I want to debug my project in Eclipse with gdb. I am having a hard time debugging code when it contains STL containers. Also I am ...
4
votes
1answer
97 views

Can anything useful be done with a truncated core?

We have processes written in a mix of Python, Java and C++ that core dump from time to time. They allocate more memory in chunks as needed during runtime, and are known to crash when their allocation ...
4
votes
1answer
67 views

Methods to diagnose why an application works for local user account but fails on a network user account?

I have setup a CentOS 6.5 machine that is attached to my company's domain. The OS is configured to allow Active Directory authentication so we do not have to have separate usernames and passwords to ...
3
votes
1answer
775 views

How does a debugger work in Linux?

How does a debugger work in Linux? How does it gets 'attached' to an already running executable or process. I understand that compiler translates code to machine language, but then how does debugger ...
3
votes
1answer
65 views

Echo out lines of script before running them

Is there a way to run scripts in bash that makes it so that it prints each line of the script before executing it? This would be really useful to me for debugging... $./myscript.sh echo "Hello" ...
3
votes
3answers
742 views

Debugging ethernet before NFS boot

I'm trying to boot Linux from U-boot on an embedded ARM board using a filesystem on a remote machine served via NFS. It appears that the ethernet connection is not coming up correctly, which results ...
3
votes
1answer
43 views

How to save the result of printf to a variable in GDB?

(gdb)printf "Hello %d", 7 Hello 7 (gdb)set $MyVar = printf "Hello %d", 7 // ??? How to save the result of printf "Hello %d", 7 to $MyVar?
3
votes
4answers
6k views

How to view core files for debugging purposes in Linux?

I want to view the contents of a core file while debugging a program. How can I view the contents of a core file?