debugging a program

Posted on 2006-10-27
Last Modified: 2010-04-16
My company is experiencing a problem with a few of the programs it is writing and while many software engineers have tried to figure out what is going on they have had very little luck.  I have been dragged in to this because I am a Network Engineer and for a while they suspected the network.

Anyway, the problem is this...  Our software people have written a program in C that when run over the network on a Win2k machine hangs the entire machine.  They can do this with the executable and/or while debugging the program.  In the source they have paired down the commands to pretty much loading some variables and then a print statement and it still hangs.  I suspect that it is the compiler linking in windows dlls but then I am not a programmer.  One thing that makes debugging this program hard is that when it runs it takes only 2 seconds to hang the computer.

Since the software team is too busy to continue working on the problem they have left it up to me to figure out.  I have gotten the software people to help me create a test machine that can reproduce the problem at will.  

One thing I do know about this program is that it will only hang the computer when run as an ADMIN.  With that knowledge I was hoping that there was a way that I could get Dr. Watson (or something else) running as an ADMIN to watch this program while it is run as a NON Admin.  Then maybe I could see what it is trying to do.  I was looking at WinDBG and noticed that you can remotely debug a program on another machine.  Not sure how to use it yet.

Any suggestions????  Remember even though I have done some programming I am not a real programmer.

Question by:louisbohm
  • 2

Accepted Solution

_iskywalker_ earned 500 total points
ID: 17818351
Try Microsoft visual studio, it has a debugger! At best try loading the source code and compile it there, with debugging symbols,
then you can follow step by step the program flow.
another idea, is compiling with gnu compiler gcc. You must rewrite some parts of the program so it compiles there.
then you can you the free gdb compiler, which will help you step by step through the process.
I hope you have the c source code. if you have you have this 2 alternatives (MS Visual C is not free but you dont loose time adapting it, gcc, gdb is free but you must adapt the program to the enviroment (you should install cygwin).
you could also boot a linux machine, and try the program with wine. (you could debug wine or make a strce, in both ways you would see where the problem is).
There is many ways to debug, a little more information abouzt what you have , would be nice

Author Comment

ID: 17818387
The programmers are using Codewarrior and when they debug the program it still will hang the machine.  I have asked what it would take to recompile this under GCC for windows and I am being told that it is a major undertaking.  There are lots of libarries that are pulled in to the program that we wrote and other things.  I do have Visual C both the for pay version and the free version.  (Check the Microsoft web site they are giving away parts of the MS Visual Studio for free.  Some things removed.  There was a project here at one point to move to the Free version but I think that got canned.)

I am not sure if the program would even run under WINE but that is an option.  I will have to ask about that.


Expert Comment

ID: 17818415
if you get the program running, just
set a break at main (or winmain with windows)
then go step for step, entering in each relevant function. so
you will get the line is bugging.
LVL 18

Expert Comment

by:Jinesh Kamdar
ID: 17824285
Add break-points to critical sections of ur code. Also add watches to the changing variables and monitor their values. Trace step-by-step to each stmt. and find out the error call.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
recursion example 16 130
silent install of security banner via msiexec command 4 89
Query group by data in SQL Server - cursor? 3 35
backup program with robocopy 6 26
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question