• C

Simulating a Memory issue

Dear Experts

One of our testers reported an internal  error after opening all accounts  on our application written C as front end and Oracle as backend. This internal error caused an immediate shutdown of the application and the accounts could not be opened.
In order to simulate this issue , I ran the session with exactly the same criterias as the tester did and debugged the function the application calls when it reaches the summary screen but did not find any discrepancies and I was successful.
The tester gets this internal error anytime , its not specific. I have done the code review of the functions which are called when it reaches the summary screen but did not find any dangling pointer issue.

Please advice me how do i tackle such issues.
What must be done in order to simulte such error.
Your suggestions will be extremely helpful
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

which operating system are you using?
Was the tester using a "release" build?  If so, sometimes, they're different enough to cause problems.  This is when logging becomes important.  I would recommend enhancing the logging functionality within your code.
ronan_40060Author Commented:
its linux OS

guitarist yes testers are using a release build, please let me know more abt logging functionality
thank you
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

I don't know how what is the best way to solve this in linux, but I can explain the principle.

You must find out in which function the application shuts down, and if it always shuts down in the same function. To do that you should log every time you enter and leave a function. Start at a high level, and narrow down to find the exact spot.

For example, if the last line in the log after a shut down is "Entering HandleData", you know this function did not return, so the next step would be adding logging to the functions which are called by HandleData, or several lines inside HandleData.

You could for example write a line to a file. But you would have to flush after each write, which will slow down the program significantly. Such a log file can also become very large in a short time.
Logging is the logical extension of the semi-famous quote, "printf is the best debugging tool you have available."

You just need to add fprintf statements that write the same information that you would like to get from gdb, such as the current call stack, or the value of a variable.  Have the log file go to the current working directory, or /tmp.  You then open the log file, and determine what went wrong, where, when, and why.  As cwwkie stated, you must use fflush often, otherwise you might be misled to believe that a program stopped before it actually did.  Also, in the case of multithreading, you could get out-of-synch output if you don't fflush.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ronan_40060Author Commented:
cwwkie and guitaristx
Thanks for the valuable inputs. I am working on writing fflush and fprintf statements . will get back to you shortly
thanks for ur time
When the program stops, does it just close normaly or does it print out any messages?

ronan_40060Author Commented:

When the program stops , it sends a message on to the screen that " Internal Error occured , press any key to initiate shutdown " when a tester presses any key , it terminates.
And now today our tester reported that , she did not receive any error that she received previously.
I am working on writing fflush and fprintf statemsnt so and will have the log generated in the current working directory in linux
I will get back to u guys,
Thanks all
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.