Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Real vague question on a linux core

Posted on 2004-03-25
8
Medium Priority
?
459 Views
Last Modified: 2010-04-22
Hi All

I am on RedHat Linux advanced server. My program recieves and responds to multiple clients using sockets. Program has been built for concurrent conection requests.
(This program is a huge 500K lines of code  and works on Linux, HP, solaris and windows)


Now,

As long as only one client is sending the requets (consider it as oad teting with one user) - program works fine. as soon as the load is increased to two simultaneous clients, program crashes!!!!!!!!!!!!!

(Now you'll say - so??? solve it)..

Ofcourse I am trying to solve it but :

1. Backtrace of the core file is not consistant. Ihave atleast 20 different backtraces.
2. If code is in debug mode, crash does not happen.
2. All the back traces have atlease one function common. Say funca(). As soon as I start putting printfs to get good idea about the crash location, crash does not happen.

So the question is : How do I solve this issue?

I am on linux advanced server 2.1 My code has been compiled using gcc 2.96.

Any kind of help/pointers would be appreciated.

Thanks
-Ajay

0
Comment
Question by:avi_india
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10684535
The information you have so far provided is really too less but this is most likely a problem with signals or other IPC ... alternatively you could be having several bugs instead of just one

Are you doing some sort of signalling ... Try building signal handler for all catchable signals and print the signal number and originator ... you will have to use sigaction and not signal interface for this
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 10685165
In my experience, you are likely experiencing one of these three problems:

1) You have a multithreaded program with unprotected (non-threadsafe)
access to one or more shared data items.  This could even be as a result
of uses of non-threadsafe library calls (like strtok).  Adding printf statements
injects console i/o into the flow of control.  the i/o triggers a thread context
switch, possibly rearranging the context switches such that you avoid concurrent
access.


2) You are corrupting the stack. Probably in funca() or one of the functions it
calls.  Again, adding printf() statements changes how the stack is utilized.


3) There is a compiler optimization problem.  If running in "debug mode" means
you  compiled with -g -O0, rebuild with -g and your normal optimization level.
this will give you symbols into the the offending code (although linenumbers might
not match up).  Then see if the debugger traps.


0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10686543
Take a look at Valgrind (http://valgrind.kde.org/) to resolve any stack (and in general memory) related problems. The advantage of Valgrind is that you don't have to modify your code, so you can run it on the app that crashes.

Also, Helgrind (part of the Valgrind suite of tools) allows you to find potential race conditions in multithreaded apps.
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 10689908
> If code is in debug mode, crash does not happen.
in 99.9xx% this is a problem with allocated memory, pointer problem, memory leak, whatever ..
I'd go vi Valgrind, Mpatrol, Electric Fence ...
  http://www.cbmamiga.demon.co.uk/mpatrol/
  http://perens.com/FreeeSoftware
  http://valgrind.kde.org/
0
 

Author Comment

by:avi_india
ID: 10690070
Thanks guys.. I m trying to use valgrind. Will update the status as soon as i find something.

(only problem which I can forsee is that - my code also uses smart heap. valgring might clash with this)
0
 

Author Comment

by:avi_india
ID: 11319229
Nothing helped here. bug has been marked as deffered for next release of the product.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 12126725
PAQed, with points refunded (500)

CetusMOD
Community Support Moderator
0

Featured Post

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

688 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